Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, work_dir, input_file, **kwargs):
self.tools = utils.DrillerTools()
self.match = kwargs.get('match', self.exp_match)
super().__init__(work_dir, input_file, **kwargs)
self.template_name = 'shared_storage.html'
self.title = 'Shared Storage'
self.Titles = {
'_id': 'Index',
'directory': 'Directory',
'fname': 'Filename',
'size': 'Size',
'mtime': 'Modified',
}
def ab_to_tar(self):
ab_file = self.get_file('', ftype=[('AB File', '*.ab')])
if ab_file:
logger.info(f'Converting {ab_file}')
self.StatusMsg.set('Converting to tar...')
tar_ = DrillerTools.ab_to_tar(ab_file, to_tmp=False)
logger.info(f'Converted to: {tar_}')
self.StatusMsg.set('Finished')
def ab_to_folder(self):
ab_file = self.get_file('', ftype=[('AB File', '*.ab')])
if ab_file:
logger.info(f'Converting {ab_file}')
self.StatusMsg.set('Converting to tar...')
tar_ = DrillerTools.ab_to_tar(ab_file, to_tmp=False)
self.StatusMsg.set('Extracting tar members...')
dst_ = pathlib.Path(f'{ab_file}_extracted/')
dst_.mkdir()
for _ in DrillerTools.extract_form_tar(tar_, dst_, full=True):
pass
logger.info(f'Extracted to: {dst_}')
self.StatusMsg.set('Finished')