bversion/storage/journaling_filesystem.py
def do_action(self, command: dict, write_journal: bool = True):
        """ Implementation for declarative file operations. """

        cmd = 0; src = 1; path = 1; data = 2; dst = 2

        if write_journal:
            self.client_db.write_fs_journal(command['undo'])
            self.client_db.commit()

        d = command['do']
        if   d[cmd] == 'copy':   shutil.copy(d[src], d[dst])
        elif d[cmd] == 'move':   shutil.move(d[src], d[dst])
        elif d[cmd] == 'backup': shutil.move(d[src], self.new_backup(d[src]))
        elif d[cmd] == 'write' :
            if callable(d[data]): d[data](d[path])
            else: file_put_contents(d[path], d[data])
 Implementation for declarative file operations. 
Implementation for declarative file operations.
Implementation for declarative file operations .
def do_action(self, command: dict, write_journal: bool = True):
        cmd = 0; src = 1; path = 1; data = 2; dst = 2
        if write_journal:
            self.client_db.write_fs_journal(command['undo'])
            self.client_db.commit()
        d = command['do']
        if   d[cmd] == 'copy':   shutil.copy(d[src], d[dst])
        elif d[cmd] == 'move':   shutil.move(d[src], d[dst])
        elif d[cmd] == 'backup': shutil.move(d[src], self.new_backup(d[src]))
        elif d[cmd] == 'write' :
            if callable(d[data]): d[data](d[path])
            else: file_put_contents(d[path], d[data])
def do_action ( self , command : dict , write_journal : bool = True ) : cmd = 0 ; src = 1 ; path = 1 ; data = 2 ; dst = 2 if write_journal : self . client_db . write_fs_journal ( command [ 'undo' ] ) self . client_db . commit ( ) d = command [ 'do' ] if d [ cmd ] == 'copy' : shutil . copy ( d [ src ] , d [ dst ] ) elif d [ cmd ] == 'move' : shutil . move ( d [ src ] , d [ dst ] ) elif d [ cmd ] == 'backup' : shutil . move ( d [ src ] , self . new_backup ( d [ src ] ) ) elif d [ cmd ] == 'write' : if callable ( d [ data ] ) : d [ data ] ( d [ path ] ) else : file_put_contents ( d [ path ] , d [ data ] )
Implementation for declarative file operations.
Implementation for declarative file operations .
""" Implementation for declarative file operations. """
self
command
dict
write_journal
bool