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)
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)
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) def sloccount(rel):
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) def sloccount(rel):