[Checkins] SVN: zodbupdate/branches/sylvain-persistent-load/ Put back the removed option -s.

Sylvain Viollon sylvain at infrae.com
Tue Feb 2 05:56:32 EST 2010


Log message for revision 108708:
  Put back the removed option -s.
  It seems ZEO access is not supported anymore (because the script is able to ignore POSKeyError where the ZODB code is not).
  
  

Changed:
  U   zodbupdate/branches/sylvain-persistent-load/README.txt
  U   zodbupdate/branches/sylvain-persistent-load/src/zodbupdate/main.py

-=-
Modified: zodbupdate/branches/sylvain-persistent-load/README.txt
===================================================================
--- zodbupdate/branches/sylvain-persistent-load/README.txt	2010-02-02 10:40:58 UTC (rev 108707)
+++ zodbupdate/branches/sylvain-persistent-load/README.txt	2010-02-02 10:56:32 UTC (rev 108708)
@@ -54,20 +54,8 @@
 Non-FileStorage configurations
 ------------------------------
 
-You can configure any storage known to your ZODB installation by providing a
-ZConfig configuration file (similar to zope.conf). For example you can connect
-to a ZEO server by providing a config file `zeo.conf`::
+Are not supported anymore.
 
-    <zeoclient>
-        server 127.0.0.1:8100
-        storage 1
-    </zeoclient>
-
-And then running `zodbupdate` using:
-
-    $ zodbupdate -c zeo.conf
-
-
 Pre-defined rename rules
 ------------------------
 

Modified: zodbupdate/branches/sylvain-persistent-load/src/zodbupdate/main.py
===================================================================
--- zodbupdate/branches/sylvain-persistent-load/src/zodbupdate/main.py	2010-02-02 10:40:58 UTC (rev 108707)
+++ zodbupdate/branches/sylvain-persistent-load/src/zodbupdate/main.py	2010-02-02 10:56:32 UTC (rev 108708)
@@ -30,6 +30,8 @@
                   help="load storage from config file")
 parser.add_option("-n", "--dry-run", action="store_true",
                   help="perform a trial run with no changes made")
+parser.add_option("-s", "--save-renames",
+                  help="save automatically determined rename rules to file")
 parser.add_option("-q", "--quiet", action="store_true",
                   help="suppress non-error messages")
 parser.add_option("-v", "--verbose", action="store_true",
@@ -85,15 +87,23 @@
     updater = zodbupdate.update.Updater(
         storage, dry=options.dry_run,
         renames=rename_rules)
+
     try:
         updater()
     except Exception, e:
         logging.debug(u'An error occured', exc_info=True)
         logging.error(u'Stopped processing, due to: %s' % e)
         raise SystemExit()
+
     implicit_renames = updater.processor.get_found_implicit_rules()
     if implicit_renames:
         print 'Found new rules:'
         print pprint.pformat(implicit_renames)
+    if options.save_renames:
+        print 'Saving rules into %s' % options.save_renames
+        rename_rules.update(implicit_renames)
+        f = open(options.save_renames, 'w')
+        f.write('renames = %s' % pprint.pformat(rename_rules))
+        f.close()
     storage.close()
 



More information about the checkins mailing list