Changeset 52566

Show
Ignore:
Timestamp:
02/15/08 01:05:04 (8 months ago)
Author:
rspivak
Message:

Works with Zope2.9.x now

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/zasync/branches/1.1-nux/CHANGES

    r51972 r52566  
    44New features: 
    55~~~~~~~~~~~~~ 
    6 - 
     6- Works with Zope2.9.x now 
    77Bug fixes: 
    88~~~~~~~~~~ 
  • vendor/zasync/branches/1.1-nux/bucketqueue.py

    r52565 r52566  
    77from time import time as _time, sleep as _sleep 
    88import sets 
     9import sys 
    910try: 
    1011    import thread 
     
    2122    """ 
    2223    def __init__(self, maxsize=0): 
     24        Queue.__init__(self, maxsize) 
     25        self._bucketsema = {} # bucket name to bucket semaphore 
     26        self._threadbucket = {} # thread id to bucket name 
    2327        # in Queue, fsema presumably stands for (not) full semaphore, and esema 
    2428        # stands for (not) empty semaphore.  For us, esema will mean "primed" 
    2529        # or "available" semaphore. 
    26         Queue.__init__(self, maxsize) 
    27         self._bucketsema = {} # bucket name to bucket semaphore 
    28         self._threadbucket = {} # thread id to bucket name 
     30        # Handle change in Queue.py module 
     31        if sys.version_info[:2] >= (2, 4): 
     32            self.fsema = thread.allocate_lock() 
     33            self.esema = thread.allocate_lock() 
     34            self.esema.acquire() 
    2935 
    3036    def primed(self): 
  • vendor/zasync/branches/1.1-nux/client/zasync/config.py

    r52560 r52566  
    2020 
    2121specified_version = None 
     22 
     23try: 
     24    # Zope-2.9.x 
     25    from Zope2.Startup.handlers import * 
     26except ImportError: 
     27    pass 
    2228 
    2329def root_handler(config): 
     
    230236                                                    name, point)) 
    231237            mount_points[point] = name 
    232     from DBTab.DBTab import DBTab 
     238 
     239    try: 
     240        # Zope-2.9.x 
     241        from Zope2.Startup.datatypes import DBTab 
     242    except ImportError: 
     243        # <= Zope-2.8.x 
     244        from DBTab.DBTab import DBTab 
     245 
    233246    section.dbtab = DBTab(mount_factories, mount_points) 
    234247 
     
    289302    # a rush, I might try, but an explicit version argument will do the trick. 
    290303    global specified_version 
    291     if version < 2.7 or version >= 2.9: 
    292         raise RuntimeError('zasync only supports Zope 2.7.x and Zope 2.8.x') 
     304    if version < 2.7 or version > 2.9: 
     305        raise RuntimeError('zasync only supports Zope 2.7.x, 2.8.x and 2.9.x') 
     306 
    293307    mydir = os.path.dirname(__file__) 
    294308    specified_version = version 
    295309    if version < 2.8: 
    296310        schema = 'schema27.xml' 
     311    elif version == 2.8: 
     312        schema = 'schema28.xml' 
    297313    else: 
    298314        schema = 'schema.xml' 
     
    306322    if conffile is None: conffile = sys.argv[1] 
    307323    conf, handler = ZConfig.loadConfig(schema, conffile) 
    308     handler({'root_handler':root_handler}) 
     324    handlers = {'root_handler':root_handler} 
     325    if version == 2.9: 
     326        handlers['rest_output_encoding'] =  rest_output_encoding 
     327        handlers['rest_input_encoding'] = rest_input_encoding 
     328        handlers['rest_header_level'] = rest_header_level 
     329        handlers['rest_language_code'] = rest_language_code 
     330    handler(handlers) 
    309331    return conf 
  • vendor/zasync/branches/1.1-nux/client/zasync/schema.xml

    r33161 r52566  
    2020  <import package="ZODB"/> 
    2121  <import package="tempstorage" /> 
     22 
     23  <!-- for Zope 2.9 --> 
     24 
    2225 
    2326  <sectiontype name="plugin" datatype="zasync.config.plugin"> 
     
    111114      <description> 
    112115       The mount point is the slash-separated path to which this database 
    113        will be mounted within the Zope application server. 
     116       will be mounted within the Zope application server. If the path 
     117       on the ZEO server is different from the path of the mount point then 
     118       you can use a notation "path_on_client:path_on_zeo_server". 
    114119      </description> 
    115120    </multikey> 
     
    124129 
    125130   <key name="class-factory" datatype=".importable_name" 
    126         default="DBTab.ClassFactories.autoClassFactory"> 
     131        default="Zope2.Startup.datatypes.zopeClassFactory"> 
    127132      <description> 
    128133       Change the class factory function a database uses on a 
     
    141146 
    142147  </sectiontype> 
     148 
    143149 
    144150  <!-- end sectiontype defs, begin section and key defs --> 
     
    254260  </key> 
    255261 
     262  <!-- For Zope-2.9 --> 
     263 
     264  <key name="rest-output-encoding" handler="rest_output_encoding"> 
     265    <description> 
     266    Specifies the output encoding of re-StructuredText documents 
     267    (e.g. 'utf-8', 'iso-8859' or any other valid encoding recognized 
     268    by Python).  The default is your Python's default encoding. 
     269    </description> 
     270    <metadefault>unset</metadefault> 
     271  </key> 
     272  <key name="rest-input-encoding" handler="rest_input_encoding"> 
     273    <description> 
     274      Specifies the input encoding of re-StructuredText documents 
     275      (e.g. 'utf-8', 'iso-8859' or any other valid encoding recognized 
     276      by Python).  The default is your Python's default encoding. 
     277    </description> 
     278    <metadefault>unset</metadefault> 
     279  </key> 
     280   <key name="rest-header-level" datatype="integer" default="3" 
     281       handler="rest_header_level"> 
     282    <description> 
     283     Set the default starting HTML header level for restructured text 
     284     documents. The default is 3, which implies that top-level headers 
     285     will be created with an H3 HTML tag. 
     286    </description> 
     287    <metadefault>3</metadefault> 
     288  </key> 
     289  <key name="rest-language-code" handler="rest_language_code" default="en"> 
     290    <description> 
     291     Language code used for some internal translations inside of the docutils 
     292     package and for DTD bibliographic elements mapping. See 
     293     lib/python/docutils/languages/ for a list of supported language codes. 
     294    </description> 
     295    <metadefault>en</metadefault> 
     296  </key> 
     297 
     298  <!-- End for Zope-2.9 --> 
     299 
     300 
    256301  <multisection type="ZODB.Database" name="+" attribute="databases"> 
    257302    <description>