]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
explain a bit what we are doing with the regex 201/head
authorAlfredo Deza <alfredo.deza@inktank.com>
Fri, 27 Jun 2014 16:26:34 +0000 (12:26 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Fri, 27 Jun 2014 16:26:34 +0000 (12:26 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
vendor.py

index 375b3087a8c686fcf767146a572ab887028fd883..e1c714ddd99761ac1fd48197c21cb1febfda5d3a 100644 (file)
--- a/vendor.py
+++ b/vendor.py
@@ -54,6 +54,10 @@ def vendor_library(name, version, cmd=None):
         run(['rm', '-rf', vendor_src])
 
     if path.exists(vendor_init):
+        # The following read/regex is done so that we can parse module metadata without the need
+        # to import it. Module metadata is defined as variables with double underscores. We are
+        # particularly insteresting in the version string, so we look into single or double quoted
+        # values, like:  __version__ = '1.0'
         module_file = open(vendor_init).read()
         metadata = dict(re.findall(r"__([a-z]+)__\s*=\s*['\"]([^'\"]*)['\"]", module_file))
         if metadata.get('version') != version: