(self)
Load current version numbers from .upgrade.sql files.
Load current version numbers from .upgrade.sql files.
Load current version numbers from . upgrade . sql files .
def load_cur_versions(self):
        """Load current version numbers from .upgrade.sql files."""

        vrc = re.compile(r"^ \s+ return \s+ '([0-9.]+)';", re.X | re.I | re.M)
        for s in AUTO_UPGRADE:
            fn = '%s.upgrade.sql' % s
            fqfn = skytools.installer_find_file(fn)
            try:
                f = open(fqfn, 'r')
            except IOError, d:
                raise skytools.UsageError('%s: cannot find upgrade file: %s [%s]' % (s, fqfn, str(d)))

            sql = f.read()
            f.close()
            m = vrc.search(sql)
            if not m:
                raise skytools.UsageError('%s: failed to detect version' % fqfn)

            ver = m.group(1)
            cur = [s, ver, fn, None]
            self.log.info("Loaded %s %s from %s", s, ver, fqfn)
            version_list.append(cur)
def load_cur_versions ( self ) : vrc = re . compile ( r"^ \s+ return \s+ '([0-9.]+)';" , re . X | re . I | re . M ) for s in AUTO_UPGRADE : fn = '%s.upgrade.sql' % s fqfn = skytools . installer_find_file ( fn ) try : f = open ( fqfn , 'r' ) except IOError , d : raise skytools . UsageError ( '%s: cannot find upgrade file: %s [%s]' % ( s , fqfn , str ( d ) ) ) sql = f . read ( ) f . close ( ) m = vrc . search ( sql ) if not m : raise skytools . UsageError ( '%s: failed to detect version' % fqfn ) ver = m . group ( 1 ) cur = [ s , ver , fn , None ] self . log . info ( "Loaded %s %s from %s" , s , ver , fqfn ) version_list . append ( cur )