Skip to content

Commit f9965ed

Browse files
committed
debug mode is no longer an environment variable (prev commit was rather short lived) but a proper option in CLAM interface
1 parent 2e41d3a commit f9965ed

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

webservice/picclservice/picclservice.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@
404404
BooleanParameter('parser','Dependency Parser',"Dependency parser (for Dutch only!)", default=False),
405405
BooleanParameter('chunker','Chunker / Shallow-parser Parser',"Chunker / Shallow parser (for Dutch only!)", default=False),
406406
]),
407+
('Debug', [
408+
BooleanParameter('debug',"Enable extra debug output (make sure to delete the project after you are done!)", default=False),
409+
]),
407410
#('Focus Word Selection', [
408411
# IntegerParameter('minlength','Minimum Word Length','Integer between zero and one hundred',default=5,minvalue=0, maxvalue=100), #old ticcl -x
409412
# IntegerParameter('maxlength','Maximum Word Length','Integer between zero and one hundred',default=100,minvalue=0, maxvalue=100), #old ticcl -y

webservice/picclservice/picclservice_wrapper.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

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

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

@@ -56,6 +57,10 @@
5657
#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!
5758
clamdata = clam.common.data.getclamdata(datafile)
5859

60+
if 'debug' in clamdata and clamdata['debug']:
61+
print("Locale information: ", file=sys.stderr)
62+
os.system("locale >&2", file=sys.stderr)
63+
5964
#You now have access to all data. A few properties at your disposition now are:
6065
# clamdata.system_id , clamdata.project, clamdata.user, clamdata.status , clamdata.parameters, clamdata.inputformats, clamdata.outputformats , clamdata.input , clamdata.output
6166

@@ -65,7 +70,7 @@ def fail(prefix=None):
6570
if prefix:
6671
nextflowout(prefix)
6772
if os.path.exists('work'):
68-
if not os.environ.get('PICCLDEBUG',False):
73+
if 'debug' not in clamdata or not clamdata['debug']:
6974
shutil.rmtree('work')
7075
sys.exit(1)
7176

0 commit comments

Comments
 (0)