Skip to content

Commit

Permalink
debug mode is no longer an environment variable (prev commit was rath…
Browse files Browse the repository at this point in the history
…er short lived) but a proper option in CLAM interface
  • Loading branch information
proycon committed Jun 6, 2018
1 parent 2e41d3a commit f9965ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions webservice/picclservice/picclservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@
BooleanParameter('parser','Dependency Parser',"Dependency parser (for Dutch only!)", default=False),
BooleanParameter('chunker','Chunker / Shallow-parser Parser',"Chunker / Shallow parser (for Dutch only!)", default=False),
]),
('Debug', [
BooleanParameter('debug',"Enable extra debug output (make sure to delete the project after you are done!)", default=False),
]),
#('Focus Word Selection', [
# IntegerParameter('minlength','Minimum Word Length','Integer between zero and one hundred',default=5,minvalue=0, maxvalue=100), #old ticcl -x
# IntegerParameter('maxlength','Maximum Word Length','Integer between zero and one hundred',default=100,minvalue=0, maxvalue=100), #old ticcl -y
Expand Down
7 changes: 6 additions & 1 deletion webservice/picclservice/picclservice_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

print("System default encoding: ", sys.getdefaultencoding(), file=sys.stderr)


#If you make use of CUSTOM_FORMATS, you need to import your service configuration file here and set clam.common.data.CUSTOM_FORMATS
#Moreover, you can import any other settings from your service configuration file as well:

Expand All @@ -56,6 +57,10 @@
#Obtain all data from the CLAM system (passed in $DATAFILE (clam.xml)), always pass CUSTOM_FORMATS as second argument if you make use of it!
clamdata = clam.common.data.getclamdata(datafile)

if 'debug' in clamdata and clamdata['debug']:
print("Locale information: ", file=sys.stderr)
os.system("locale >&2", file=sys.stderr)

#You now have access to all data. A few properties at your disposition now are:
# clamdata.system_id , clamdata.project, clamdata.user, clamdata.status , clamdata.parameters, clamdata.inputformats, clamdata.outputformats , clamdata.input , clamdata.output

Expand All @@ -65,7 +70,7 @@ def fail(prefix=None):
if prefix:
nextflowout(prefix)
if os.path.exists('work'):
if not os.environ.get('PICCLDEBUG',False):
if 'debug' not in clamdata or not clamdata['debug']:
shutil.rmtree('work')
sys.exit(1)

Expand Down

0 comments on commit f9965ed

Please sign in to comment.