Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.script.old.migration.152_to_1050300 Namespace Reference

Functions

def migrate

Variables

list data_dirs = ['data', ]

Function Documentation

Definition at line 36 of file 152_to_1050300.py.

00036 
00037 def migrate(dirlist):
00038     errors = warnings = success = 0
00039     for dir in dirlist:
00040         if not (os.path.exists(os.path.join(dir, 'pages')) and
00041                 os.path.exists(os.path.join(dir, 'user'))):
00042             print "Error: Skipping %s - does not look like a data_dir" % dir
00043             errors += 1
00044         else:
00045             fname = os.path.join(dir, 'meta')
00046             if os.path.exists(fname):
00047                 print "Warning: There already is a meta file there, skipping %s" % dir
00048                 warnings += 1
00049             else:
00050                 try:
00051                     f = open(fname, 'w')
00052                     f.write("data_format_revision: 01050300\n") # 01050300 = 1.5.3(.0)
00053                     f.close()
00054                     success += 1
00055                 except:
00056                     errors += 1
00057                     print "Error: Exception when migrating %s" % dir
00058     print "%d data_dirs successfully migrated, %d warnings, %d errors." % (success, warnings, errors)


Variable Documentation

Definition at line 61 of file 152_to_1050300.py.