Package x2go :: Package backends :: Package printing :: Module _winreg
[frames] | no frames]

Source Code for Module x2go.backends.printing._winreg

 1  # -*- coding: utf-8 -*- 
 2   
 3  # Copyright (C) 2010-2011 by Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 
 4  # 
 5  # Python X2go is free software; you can redistribute it and/or modify 
 6  # it under the terms of the GNU General Public License as published by 
 7  # the Free Software Foundation; either version 3 of the License, or 
 8  # (at your option) any later version. 
 9  # 
10  # Python X2go is distributed in the hope that it will be useful, 
11  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
13  # GNU General Public License for more details. 
14  # 
15  # You should have received a copy of the GNU General Public License 
16  # along with this program; if not, write to the 
17  # Free Software Foundation, Inc., 
18  # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 
19   
20  """\ 
21  L{X2goClientPrintingWINREG} class is one of Python X2go's public API classes.  
22   
23  Retrieve an instance of this class from your L{X2goClient} instance. 
24  Use this class in your Python X2go based applications to access the »printing«  
25  configuration of your X2go client application. 
26   
27  """ 
28  __NAME__ = 'x2goprint-pylib' 
29   
30  # modules 
31  import types 
32  import ConfigParser 
33   
34  # Python X2go modules 
35  import x2go.log as log 
36  import x2go.printactions as printactions 
37  # we hide the default values from epydoc (that's why we transform them to _UNDERSCORE variables) 
38  from x2go.defaults import X2GO_CLIENTPRINTING_DEFAULTS as _X2GO_CLIENTPRINTING_DEFAULTS 
39  from x2go.defaults import X2GO_PRINTING_CONFIGFILES as _X2GO_PRINTING_CONFIGFILES 
40  import x2go.inifiles as inifiles 
41   
42 -class X2goClientPrintingWINREG(inifiles.X2goIniFile):
43 """\ 44 L{X2goClientPrinting} provides access to the X2go ini-like file 45 »printing« as stored in C{~/.x2goclient/printing} resp. globally 46 C{/etc/x2goclient/printing}. 47 48 An instance of L{X2goClientPrinting} is created on each incoming 49 print job. This facilitates that on every print job the print action 50 for this job is derived from the »printing« configuration file. 51 52 Thus, changes on the file are active for the next incoming print job. 53 54 """ 55 config_files = [] 56 _print_action = None 57 defaultValues = _X2GO_CLIENTPRINTING_DEFAULTS 58
59 - def __init__(self, config_files=_X2GO_PRINTING_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT):
60 """\ 61 @param config_files: a list of configuration files names (e.g. a global filename and a user's home 62 directory filename) 63 @type config_files: C{list} 64 @param defaults: a cascaded Python dicitionary structure with ini file defaults (to override 65 Python X2go's hard coded defaults in L{defaults} 66 @type defaults: C{dict} 67 @param logger: you can pass an L{X2goLogger} object to the 68 L{X2goPrintAction} constructor 69 @type logger: C{instance} 70 @param loglevel: if no L{X2goLogger} object has been supplied a new one will be 71 constructed with the given loglevel 72 @type loglevel: C{int} 73 74 """ 75 raise X2goNotImplementedYetException('WINREG backend support is not implemented yet')
76