Ζ
zUσ9c       ss   d  Z  d Z d Z d k Z d k l Z l Z l Z l Z d k Z d f  d     YZ	 d e i f d     YZ
 d S(	   sΛ  Data Store API.

Stores may have the following properties:

  read    - can open existing databases for reading
  write   - can open existing databases for writing
  create  - can create new databases (which are implicitly open for writing)
  delete  - can delete databases
  list    - can list databases and their info
  install - has an install method which should be used when copying into
            this store, instead of using the normal 'copy' method
s2   $Id: Store.py,v 1.10 1999/11/29 06:57:18 rob Exp $s.   Copyright 1999 Rob Tillotson <robt@debian.org>N(   s   Plugins   Databases	   PrefBlocks   _s	   BaseStorec      sο   f  Z  f  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d	   Z
 d
   Z d e f  d  Z d d e f  e e d  Z d   Z d   Z d   Z e e e d  Z d d  Z d d d  Z d   Z d   Z RS(   Nc    s   t  |  _ d  S(   N(   s   Nones   selfs   context(   s   selfs=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   __init__1 s    c    s   | |  _ d  S(   N(   s   cs   selfs   context(   s   selfs   cs=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   set_context4 s    c    sH   t  |  i d  o |  i i i |  o |  i i | Sn
 t |  d  S(   Ns   option_values(   s   hasattrs   selfs   contexts   option_valuess   has_keys   ks   AttributeError(   s   selfs   ks=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   __getattr__7 s    )c    s*   t  |  i d  o |  i i i |  Sd  S(   Ns   option_values(   s   hasattrs   selfs   contexts   option_valuess   has_keys   k(   s   selfs   ks=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys
   has_option= s    c    s2   t  |  i d  o |  i i | Sn
 t |  d  S(   Ns   option_values(   s   hasattrs   selfs   contexts   option_valuess   ks   KeyError(   s   selfs   ks=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys
   get_optionA s    c    s   t  |  i i | |  Sd  S(   N(   s   applys   selfs   contexts
   get_plugins   as   kw(   s   selfs   as   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys
   get_pluginF s    c    s   t  |  i i | |  Sd  S(   N(   s   applys   selfs   contexts   list_pluginss   as   kw(   s   selfs   as   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   list_pluginsI s    c    s   t  |  i i | |  Sd  S(   N(   s   applys   selfs   contexts   list_plugin_infos   as   kw(   s   selfs   as   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   list_plugin_infoL s    c    s   | |  i j Sd  S(   N(   s   ps   selfs
   properties(   s   selfs   ps=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   has_propertyP s    c    s6   x( | d r } | |  i j o t Sn q	 W|  i Sd S(   s0  Check whether this store can provide a particular type of database.
	
	Given a list of DB properties, this function tests whether a database
	with the requested properties is possible using this store.  If it is,
	this function returns a propertly list which describes the resulting
	database.  (Note that the returned property list might be LONGER than
	the one supplied to this function: that is, if you ask for a database
	with the 'foo' property and the only way the store can grant that is
	by returning a ['foo', 'bar', 'baz'] database, that's what will be
	returned.  If the property combination isn't possible, returns None.

	The standard behavior of this function assumes that all databases opened
	by a particular Store have the same properties.  Should this not be
	the case, the Store should override.
	i    N(   s
   propertiess   ps   selfs   db_propertiess   None(   s   selfs
   propertiess   ps=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   test_db_propertiesR s     	  c    sW   |  i |  o t t d  |  n t |  i | | | f |  } t | |  Sd  S(   Ns$   cannot provide db with properties %s(   s   selfs   test_db_propertiess
   propertiess   RuntimeErrors   _s   applys   _opens   names   modes   kws   ts   dbclass(   s   selfs   names   modes   dbclasss
   propertiess   kws   ts=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   openf s    s   rsc
  	  sc   |  i |  o t t d  |  n t |  i | | | | | | |	 f |
  } t | |  Sd  S(   Ns$   cannot provide db with properties %s(   s   selfs   test_db_propertiess
   propertiess   RuntimeErrors   _s   applys   _creates   names   creators   types   flagss   versions   filenames   infos   kws   ts   dbclass(   s   selfs   names   creators   types   flagss   versions   dbclasss
   propertiess   filenames   infos   kws   ts=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   createl s
    !	i    i   c    s   t  t d   d S(   s   Delete a database in the store.s   unimplemented methodN(   s   RuntimeErrors   _(   s   selfs   names   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   deleteu s     c    s   t  t d   d S(   s   Get info about a database.s   unimplemented methodN(   s   RuntimeErrors   _(   s   selfs   names   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   infoy s     c    s   t  t d   d S(   s    Return a list of database names.s   unimplemented methodN(   s   RuntimeErrors   _(   s   selfs   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   list} s     c    s   t  t d   d S(   s1   Return a list of database names with information.s   unimplemented methodN(   s   RuntimeErrors   _(   s   selfs   names   creators   types   kws=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   listinfo s     c    s   t  t d   d S(   s'   Return a preference (as a raw string!).s   unimplemented methodN(   s   RuntimeErrors   _(   s   selfs   creators   ids   saveds=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   getpref s     c    s   t  t d   d S(   s   Set a preference.s   unimplemented methodN(   s   RuntimeErrors   _(   s   selfs   raws   creators   ids   versions   saveds=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   setpref s     c    s   | i |  |  d  S(   N(   s   stores   copys   selfs   name(   s   selfs   stores   names=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   install s    c 	   s*  |  i | d  } y | i |  Wn n Xd } | i d o | d B} n | i d o | d B} n | i d o | d B} n | i d	 o | d
 B} n | i d o | d B} n | i d o | d B} n | i d o | d B} n | i d o | d B} n | i | | i d | i d | | i d d | i } y | i
   } | i |  Wn n X| i d o= x6 t d t |   d r } | | } | i |  qWnU xQ t d t |   d r8 } | | } | i p | i o qΦn | i |  qΦW| i   | i   d S(   s#   Copy a database into another store.s   rsi    s	   flagReseti    s   flagResourcei   s	   flagNeweri   s   flagExcludeFromSynci   s   flagAppInfoDirtyi   s   flagReadOnlyi   s
   flagBackupi   s   flagOpeni   s   creators   types   versions   infoN(   s   selfs   opens   names   idbs   stores   deletes   flagss   infos   creates   odbs   get_appblocks   as   set_appblocks   ranges   lens   is   rs   appends   deleteds   archiveds   close(	   s   selfs   stores   names   idbs   flagss   odbs   as   is   rs=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   copy sV              
 

(   s
   propertiess   db_propertiess   __init__s   set_contexts   __getattr__s
   has_options
   get_options
   get_plugins   list_pluginss   list_plugin_infos   has_propertys   test_db_propertiess   Databases   opens   Nones   creates   deletes   infos   lists   listinfos   getprefs   setprefs   installs   copy(    s=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys	   BaseStore- s,    															s   Storec      s   d Z  e Z d   Z RS(   Ns   Storec    sf   t  |  i | |  } | i |   |  i | _ |  i | _ |  i	 | _	 |  i
 | _
 |  i | _ | Sd  S(   N(   s   applys   selfs   store_classs   as   kws   os   set_contexts   names   versions   authors   descriptions   url(   s   selfs   as   kws   os=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   __call__Ε s    (   s   types	   BaseStores   store_classs   __call__(    s=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   StoreΑ s    (   s   __doc__s   __version__s   __copyright__s   Pyrites   Plugins   Databases	   PrefBlocks   _s   syss	   BaseStores   Store(    s=   /mit/python/lib/python2.0/site-packages/Pyrite/Store/Store.pys   ?! s   		