def pre_rebase(self, destination): name = destination.split('/')[-1] info("Releasing package '" + name + "' to: '" + destination + "'") ret = trim(undo=True) if ret == code.NOTHING_TO_DO: return 0 else: return ret
def post_rebase(self, destination): # If self.packages is not a dict then this is a stack # and therefore no trim is needed if type(self.packages) is not dict: return 0 # Figure out the trim sub dir name = destination.split('/')[-1] trim_d = [k for k, v in self.packages.iteritems() if v.name == name][0] # Execute trim if trim_d in ['', '.']: return 0 return trim(trim_d)