path = os.path.join(root, fname)
os.chmod(path, os.stat(path).st_mode | modes[fname in dirs])
+def make_latest_link(snapshot_path):
+ """ make the latest repo link to the new repo
+ snapshot_path (str): the local path to snapshot
+ """
+ latest = os.path.join(snapshot_path, "../latest")
+ rel_path = os.path.basename(snapshot_path)
+ if os.path.lexists(latest):
+ os.unlink(latest)
+ os.symlink(rel_path, latest)
+
+# The function xml2obj is from http://code.activestate.com/recipes/534109/
+# and is distributed under the PSF License.
+#
+# Author: Wai Yip Tung
+# Last Updated: 2007/10/19
+# Version no: 1.3
+# License: PSF License
+# Source: http://code.activestate.com/recipes/534109/
+
def xml2obj(src):
"""
A simple function to converts XML data into native Python object.
else:
xml.sax.parse(src, builder)
return builder.root._attrs.values()[0]
-
-def make_latest_link(snapshot_path):
- """ make the latest repo link to the new repo
- snapshot_path (str): the local path to snapshot
- """
- latest = os.path.join(snapshot_path, "../latest")
- rel_path = os.path.basename(snapshot_path)
- if os.path.lexists(latest):
- os.unlink(latest)
- os.symlink(rel_path, latest)