コード例 #1
0
ファイル: foper.py プロジェクト: andreyskv/twilight-commander
    def __init__(self, app, action = '', func = None, lst = [], *args):

        if func in ['copy', 'backup']:
            func, action  = self.copy, 'Copying files'
        elif func in ['move', 'rename']:
            func, action = self.move, 'Moving files'

        #initilize size to copy
        self.total_size , self.cur_total_size = 0,0
        self.cur_dest_size, self.cur_source_size = 0,0
        self.dest_file  = ''

        self.src_file = ''


        #self.time = 0
        #self.speed = 0 
        #self.cur_size_previous = 0 
        #self.time_previous = 0


        self.cur_tim,  self.prev_tim = 0, 0
        for i in range(len(lst)):
            self.total_size += files.get_size(os.path.join(args[0],lst[i]))

        ProcessBaseLoop.__init__(self, app, action, func, lst, *args)
        self.overwrite_all = not self.app.prefs.confirmations['overwrite']
        self.overwrite_none = False
コード例 #2
0
    def __init__(self, app, action='', func=None, lst=[], *args):

        if func in ['copy', 'backup']:
            func, action = self.copy, 'Copying files'
        elif func in ['move', 'rename']:
            func, action = self.move, 'Moving files'

        #initilize size to copy
        self.total_size, self.cur_total_size = 0, 0
        self.cur_dest_size, self.cur_source_size = 0, 0
        self.dest_file = ''

        self.src_file = ''

        #self.time = 0
        #self.speed = 0
        #self.cur_size_previous = 0
        #self.time_previous = 0

        self.cur_tim, self.prev_tim = 0, 0
        for i in range(len(lst)):
            self.total_size += files.get_size(os.path.join(args[0], lst[i]))

        ProcessBaseLoop.__init__(self, app, action, func, lst, *args)
        self.overwrite_all = not self.app.prefs.confirmations['overwrite']
        self.overwrite_none = False
コード例 #3
0
    def __init__(self, app, func = None, lst = [], *args):

        self.app = app
        #self.unpack_flag = False
        if func == 'comp_dir':
            func = self.do_compress_uncompress_dir
            action= 'Compressing directory'

        elif func == 'uncomp_dir':
            func = self.do_compress_uncompress_dir
            action = 'Uncompressing directory'
            #self.unpack_flag = True

        elif func == 'ucomp_file':
            func = self.do_compress_uncompress_file
            action = '(Un)Compressing file'

        #elif func == 'uncomp_vfs':
            #func = self.do_compress_uncompress_dir
            #action = 'Creating archive VFS'
            ##self.unpack_flag = True

        #elif func == 'comp_vfs':

            #func = self.do_compress_vfs
            #action = 'Rebuilding archive'

        else:
            return

        #self.source_file = args[0]+os.sep+lst[0]
        self.source_file = os.path.join(args[0], lst[0])
        self.source_size = files.get_size(self.source_file)
        ProcessBaseLoop.__init__(self, app, action, func, lst, *args)
コード例 #4
0
    def __init__(self, app, func=None, lst=[], *args):

        self.app = app
        #self.unpack_flag = False
        if func == 'comp_dir':
            func = self.do_compress_uncompress_dir
            action = 'Compressing directory'

        elif func == 'uncomp_dir':
            func = self.do_compress_uncompress_dir
            action = 'Uncompressing directory'
            #self.unpack_flag = True

        elif func == 'ucomp_file':
            func = self.do_compress_uncompress_file
            action = '(Un)Compressing file'

        #elif func == 'uncomp_vfs':
        #func = self.do_compress_uncompress_dir
        #action = 'Creating archive VFS'
        ##self.unpack_flag = True

        #elif func == 'comp_vfs':

        #func = self.do_compress_vfs
        #action = 'Rebuilding archive'

        else:
            return

        #self.source_file = args[0]+os.sep+lst[0]
        self.source_file = os.path.join(args[0], lst[0])
        self.source_size = files.get_size(self.source_file)
        ProcessBaseLoop.__init__(self, app, action, func, lst, *args)
コード例 #5
0
ファイル: foper.py プロジェクト: andreyskv/twilight-commander
 def __init__(self, app, lst = [], *args):
     ProcessBaseLoop.__init__(self, app, 'Deleting files', self.delete, lst, *args)
     self.delete_all = not self.app.prefs.confirmations['delete']
コード例 #6
0
 def __init__(self, app, lst=[], *args):
     ProcessBaseLoop.__init__(self, app, 'Deleting files', self.delete, lst,
                              *args)
     self.delete_all = not self.app.prefs.confirmations['delete']