Changeset 2405
- Timestamp:
- 08/26/05 14:14:40 (19 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r2392 r2405 353 353 # 354 354 # unknown_billingcode : create 355 356 # Where should we store our (temporary) files when printing ? 357 # if unset, defaults to a system directory dedicated to temporary 358 # files and evaluated at runtime (see Python's documentation 359 # for the tempfile.gettempdir() function). 360 # This value can be set either globally or on a per printer basis 361 # If both are defined, the printer option has priority. 362 # directory : /tmp 363 # directory : /var/spool/cups 364 365 # Should we keep our work files on disk after printing ? 366 # If unset, temporary files are deleted once the work is finished. 367 # If set to yes, files are kept on disk in the 'directory' 368 # named with the previous directive. 369 # This value can be set either globally or on a per printer basis 370 # If both are defined, the printer option has priority. 371 # Default value is No, meaning temporary files are deleted 372 # keepfiles : yes 373 keepfiles : no 374 355 375 356 376 # What is the accounting backend to use -
pykota/trunk/pykota/config.py
r2385 r2405 24 24 25 25 import os 26 import tempfile 26 27 import ConfigParser 27 28 … … 431 432 return self.isTrue(self.getGlobalOption("reject_unknown", ignore=1)) 432 433 434 def getPrinterKeepFiles(self, printername) : 435 """Returns 1 if files must be kept on disk, else 0.""" 436 try : 437 return self.isTrue(self.getPrinterOption(printername, "keepfiles")) 438 except PyKotaConfigError : 439 return 0 440 441 def getPrinterDirectory(self, printername) : 442 """Returns the path to our working directory, else a directory suitable for temporary files.""" 443 try : 444 return self.getPrinterOption(printername, "directory").strip() 445 except PyKotaConfigError : 446 return tempfile.gettempdir() 447 433 448 def getDenyDuplicates(self, printername) : 434 449 """Returns 1 or a command if we want to deny duplicate jobs, else 0."""