PEATDB/Utils.py
def saveDBCopy(DB, filename, callback=None):
    """Save local copy of a remote or another local DB"""
    import copy
    total = len(DB.getRecs())
    if filename == '' or filename == None:
        return False
    if os.path.exists(filename):
        for i in ['.lock','.index','']:
            os.remove(filename+i)
    newDB = PDatabase(local=filename)
    newDB = copyDB(DB, newDB)
    newDB.commit()    
    newDB.close() 
    return newDB
Save local copy of a remote or another local DB
Save local copy of a remote or another local DB
Save local copy of a remote or another local DB
def saveDBCopy(DB, filename, callback=None):
    import copy
    total = len(DB.getRecs())
    if filename == '' or filename == None:
        return False
    if os.path.exists(filename):
        for i in ['.lock','.index','']:
            os.remove(filename+i)
    newDB = PDatabase(local=filename)
    newDB = copyDB(DB, newDB)
    newDB.commit()    
    newDB.close() 
    return newDB
def saveDBCopy ( DB , filename , callback = None ) : import copy total = len ( DB . getRecs ( ) ) if filename == '' or filename == None : return False if os . path . exists ( filename ) : for i in [ '.lock' , '.index' , '' ] : os . remove ( filename + i ) newDB = PDatabase ( local = filename ) newDB = copyDB ( DB , newDB ) newDB . commit ( ) newDB . close ( ) return newDB
Save local copy of a remote or another local DB
Save local copy of a remote or another local DB
"""Save local copy of a remote or another local DB"""
DB
filename
callback