def is_that_exists(self): if not os.path.exists(self.args): if star_ops.is_star_cmd(self.args): star_ops.star_rm(self.args) else: print 'WRONG path!' else: self.rm_the_shit()
def copy_func(self): if not os.path.exists(self.old): if star_ops.is_star_cmd(self.old): cp_list = glob.glob(self.old) for item in cp_list: self.is_destination_exists(item,self.new) else: print 'Target NOT EXISTS!' else: self.is_destination_exists(self.old,self.new) return
def move_dir(self): if not os.path.exists(self.old): if star_ops.is_star_cmd(self.old): mv_list = glob.glob(self.old) for item in mv_list: self.real_move(item) else: print 'Target NOT EXISTS!' else: if os.path.exists(self.new): self.real_move(self.old) else: print 'The destination not exists, I will Create the shit!' mkd = mkdir.Mkdir(self.new) mkd.make_dir() self.real_move(self.old) return