[jhbuild/desrt/packagedb: 15/21] packagedb: move from_xml method



commit 5562f2ff7fcbebecbbabdf19287904d60df620dd
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Jan 18 10:08:02 2015 -0500

    packagedb: move from_xml method
    
    Earlier patches put methods in an illogical order.  Fix that up so that
    the to/from xml functions are together at the bottom.
    
    Sorry for the noise.

 jhbuild/utils/packagedb.py |   35 ++++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 17 deletions(-)
---
diff --git a/jhbuild/utils/packagedb.py b/jhbuild/utils/packagedb.py
index b698e33..e7160cb 100644
--- a/jhbuild/utils/packagedb.py
+++ b/jhbuild/utils/packagedb.py
@@ -76,23 +76,6 @@ class PackageEntry:
 
     manifest = property(get_manifest, set_manifest)
 
-    @classmethod
-    def from_xml(cls, node, manifests_dir):
-        package = node.attrib['package']
-        version = node.attrib['version']
-        metadata = {}
-
-        installed_string = node.attrib['installed']
-        if installed_string:
-            metadata['installed-date'] = _parse_isotime(installed_string)
-        configure_hash = node.attrib.get('configure-hash')
-        if configure_hash:
-            metadata['configure-hash'] = configure_hash
-
-        dbentry = cls(package, version, metadata, manifests_dir)
-
-        return dbentry
-
     def write(self):
         writer = fileutils.SafeWriter(os.path.join(self.manifests_dir, self.package))
         writer.fp.write('\n'.join(self.manifest) + '\n')
@@ -112,6 +95,24 @@ class PackageEntry:
 
         return entry_node
 
+    @classmethod
+    def from_xml(cls, node, manifests_dir):
+        package = node.attrib['package']
+        version = node.attrib['version']
+        metadata = {}
+
+        installed_string = node.attrib['installed']
+        if installed_string:
+            metadata['installed-date'] = _parse_isotime(installed_string)
+        configure_hash = node.attrib.get('configure-hash')
+        if configure_hash:
+            metadata['configure-hash'] = configure_hash
+
+        dbentry = cls(package, version, metadata, manifests_dir)
+
+        return dbentry
+
+
 class PackageDB:
     def __init__(self, dbfile, config):
         self.dbfile = dbfile


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]