def readDatabase(self, filename, *args, **kargs):
        """Import all records from a database file.

        For now, it can only read databases using flatkeydb.
        args and kargs can be used to specify arguments for the
        FlatDB constructor.
        """
        mat = FlatDB(*args, **kargs)
        mat.readFile(filename)
        for k, v in mat.iteritems():
            self[k] = Dict(v)
示例#2
0
    def readDatabase(self,filename,*args,**kargs):
        """Import all records from a database file.

        For now, it can only read databases using flatkeydb.
        args and kargs can be used to specify arguments for the
        FlatDB constructor.
        """
        mat = FlatDB(*args,**kargs)
        mat.readFile(filename)
        for k, v in mat.items():
            self[k] = Dict(v)
示例#3
0
print __doc__
from pyformex.flatkeydb import FlatDB
from pyformex.utils import runCommand,removeTree

import os,sys,commands,datetime

now = datetime.datetime.now().replace(microsecond=0).isoformat(' ')
print now

curdir = os.path.dirname(__file__)
dbfile = os.path.join(curdir,'pyformex-releases.fdb')
if not os.path.exists(dbfile):
    print("The dbfile %s does not exist"%dbfile)
    sys.exit()
    
DB = FlatDB(req_keys=['tag','date','rev'],beginrec = 'release',endrec = '')

DB.readFile(dbfile)
keys = DB.keys()
keys.sort()

print "List of releases: %s" % keys

tmpdir = '_sloccount_'
workdir = os.path.join(curdir,tmpdir)


def runCmd(cmd):
    print cmd
    return commands.getstatusoutput(cmd)
示例#4
0
print __doc__
from pyformex.flatkeydb import FlatDB
from pyformex.utils import removeTree

import os,sys,commands,datetime

now = datetime.datetime.now().replace(microsecond=0).isoformat(' ')
print now

curdir = os.path.dirname(__file__)
dbfile = os.path.join(curdir,'pyformex-releases.fdb')
if not os.path.exists(dbfile):
    print("The dbfile %s does not exist"%dbfile)
    sys.exit()

DB = FlatDB(req_keys=['tag','date','rev'],beginrec = 'release',endrec = '')

DB.readFile(dbfile)
keys = DB.keys()
keys.sort()

print "List of releases: %s" % keys

tmpdir = '_sloccount_'
workdir = os.path.join(curdir,tmpdir)


def Cmd(cmd):
    print cmd
    return commands.getstatusoutput(cmd)