vendor/zasync/1.1

changeset 43:91843245a3c1 1.1-nux

Removed trailing whitespaces
author rspivak
date Thu, 14 Feb 2008 21:47:46 +0000
parents 63e95f01aa79
children 584f189d4f82
files client/zasync/config.py
diffstat 1 files changed, 25 insertions(+), 25 deletions(-) [+]
line diff
     1.1 --- a/client/zasync/config.py
     1.2 +++ b/client/zasync/config.py
     1.3 @@ -25,18 +25,18 @@
     1.4      this was combined from datatypes and configs in Zope gradually as
     1.5      necessary elements emerged; it should probably be separated again
     1.6      at some point in the future."""
     1.7 -    
     1.8 +
     1.9      # This is in two parts: set up Zope, then set up zasync.  Unsurprisingly,
    1.10      # it takes a lot more to set up Zope.
    1.11 -    
    1.12 +
    1.13      # ...but first we'll set up logging
    1.14 -    import zLOG 
    1.15 +    import zLOG
    1.16      zLOG._call_initialize = 0
    1.17      config.eventlog()
    1.18      config.zasync()
    1.19      config.zasync_plugins.name="zasync.plugins"
    1.20      config.zasync_plugins()
    1.21 -    
    1.22 +
    1.23      ###############
    1.24      # Set up Zope #
    1.25      ###############
    1.26 @@ -45,9 +45,9 @@
    1.27      if config.environment:
    1.28          for k,v in config.environment.items():
    1.29              os.environ[k] = v
    1.30 -    
    1.31 +
    1.32      # set up Zope as minimally as possible while still getting it to work
    1.33 -    
    1.34 +
    1.35      # Add directories to the pythonpath; always insert instancehome/lib/python
    1.36      instancelib = os.path.join(config.instancehome, 'lib', 'python')
    1.37      if instancelib not in config.path:
    1.38 @@ -64,14 +64,14 @@
    1.39      instanceprod = os.path.join(config.instancehome, 'Products')
    1.40      if instanceprod not in config.products:
    1.41          config.products.append(instanceprod)
    1.42 -    
    1.43 +
    1.44      import Products
    1.45      L = []
    1.46      for d in config.products + Products.__path__:
    1.47          if d not in L:
    1.48              L.append(d)
    1.49      Products.__path__[:] = L
    1.50 -    
    1.51 +
    1.52      import App, App.config
    1.53      par = os.path.dirname
    1.54      config.softwarehome = par(par(os.path.abspath(App.__file__)))
    1.55 @@ -81,7 +81,7 @@
    1.56      if getattr(config, 'clienthome', None) is None:
    1.57          config.clienthome = os.path.join(config.instancehome, 'var')
    1.58      App.config.setConfiguration(config)
    1.59 -    
    1.60 +
    1.61      import AccessControl
    1.62      AccessControl.setImplementation(
    1.63          config.security_policy_implementation)
    1.64 @@ -94,10 +94,10 @@
    1.65          AccessControl.setDefaultBehaviors(
    1.66              not config.skip_ownership_checking,
    1.67              not config.skip_authentication_checking)
    1.68 -    
    1.69 +
    1.70      import OFS.Application
    1.71      OFS.Application.import_products()
    1.72 -    
    1.73 +
    1.74      try: # Zope 2.8
    1.75          from App import ZApplication
    1.76      except ImportError: # 2.7
    1.77 @@ -113,7 +113,7 @@
    1.78          from Zope import ClassFactory
    1.79  
    1.80      Globals.DatabaseVersion='3'
    1.81 -    
    1.82 +
    1.83      DB = config.dbtab.getDatabase('/', is_root=1)
    1.84      try: # Zope 2.7
    1.85          DB.setClassFactory(ClassFactory.ClassFactory)
    1.86 @@ -136,16 +136,16 @@
    1.87  
    1.88      # "Log off" as system user
    1.89      noSecurityManager()
    1.90 -    
    1.91 +
    1.92      #################
    1.93      # Set up zasync #
    1.94      #################
    1.95 -    
    1.96 +
    1.97      from zasync import client
    1.98 -    
    1.99 +
   1.100      client.DB = DB
   1.101      client.app = app
   1.102 -    
   1.103 +
   1.104      path = client.tool_path = tuple(filter(None, config.target.split('/')))
   1.105      config.target_path = path
   1.106      try:
   1.107 @@ -153,9 +153,9 @@
   1.108      except (AttributeError, LookupError):
   1.109          raise ZConfig.ConfigurationError(
   1.110              "target could not be found: %s" % config.target)
   1.111 -    
   1.112 +
   1.113      application._p_jar.close()
   1.114 -    
   1.115 +
   1.116      # configure retry behavior
   1.117      client.max_conflict_resolution_attempts = (
   1.118          max(config.max_conflict_resolution_attempts, 0))
   1.119 @@ -164,14 +164,14 @@
   1.120      client.retry_exponential_backoff = (
   1.121          max(config.retry_exponential_backoff, 1))
   1.122      client.max_total_retry = max(config.max_total_retry, 0)
   1.123 -    
   1.124 +
   1.125      # configure traceback verbosity
   1.126      client.verbose_traceback = config.verbose_traceback
   1.127 -    
   1.128 -    # load in plugins.  We don't want to calculate the callables until 
   1.129 +
   1.130 +    # load in plugins.  We don't want to calculate the callables until
   1.131      # this root handler because the python environment is not set up until here.
   1.132      for plugin in config.plugins:
   1.133 -        # based off of 
   1.134 +        # based off of
   1.135          # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223972
   1.136          fullFuncName = plugin['handler']
   1.137          lastDot = fullFuncName.rfind(u".")
   1.138 @@ -231,7 +231,7 @@
   1.139              mount_points[point] = name
   1.140      from DBTab.DBTab import DBTab
   1.141      section.dbtab = DBTab(mount_factories, mount_points)
   1.142 -    
   1.143 +
   1.144      s = sets.Set()
   1.145      for plugin in section.plugins:
   1.146          name = plugin['name']
   1.147 @@ -239,13 +239,13 @@
   1.148              raise ConfigurationError(
   1.149                  'plugin name duplicated: %s' % name)
   1.150              s.add(name)
   1.151 -    
   1.152 +
   1.153      return section
   1.154  
   1.155  _ident_re = "[_a-zA-Z][_a-zA-Z0-9]*"
   1.156  class DottedNameFunctionConversion(
   1.157      ZConfig.datatypes.RegularExpressionConversion):
   1.158 -    
   1.159 +
   1.160      def __init__(self):
   1.161          ZConfig.datatypes.RegularExpressionConversion.__init__(
   1.162              self, r"%s(?:\.%s)+" % (_ident_re, _ident_re))