def rename(self) : print('Renaming') for folder in self.rename_watchs : for name in os.listdir(folder) : src = os.path.join(folder, name) if name[0] != '#' and Tools.is_media(src) : renamer = AVRenamer(src, self.sql) renamer.rename() tools.split_line()
def to_work(self) : print('Moving to working space') move = os.path.join(self.dl_tmp, '#move') if os.path.isdir(move) : tool = Tools(move, self.work_new) tool.move_sub_into(match_func=Tools.is_media) remove = os.path.join(self.dl_tmp, '#remove') if os.path.isdir(remove) and len(os.listdir(remove)) > 0 : print('Removing {0}'.format(remove)) shutil.rmtree(remove) os.makedirs(remove) tools.split_line()
def parse_dl(self) : plan.Plan.parse_dl(self) for name in os.listdir(self.dl_tmp) : src = os.path.join(self.dl_tmp, name) if name[0] == '#' : continue elif os.path.isdir(src) : tool = Tools(src, self.dl_tmp) tool.move_sub_into(match_func=Tools.is_media) print('Removing ... : {0}'.format(src)) shutil.rmtree(src) tools.split_line()
def make_db(self) : print('Making database') self.maker.make() tools.split_line()