def do(self, args): from yq import stack transaction = stack.top() if transaction: self.stdout.write(transaction + '\n') else: self.stdout.write("no transactions on the stack\n")
def do(self, args): from yq import stack from yq.backend import yumbackend transaction_name = stack.top() yumbackend.pop(transaction_name) #Remove from the series #yes, this will eat files and babies status = open(config.STATUS, 'r') lines = status.readlines() status.close() status = open(config.STATUS, 'w') for line in lines[:-1]: status.write(line) status.close()
def do(self, args): import os from yq import stack if len(args) == 0: transaction_name = stack.top() if not transaction_name: self.stdout.write("no applied transactions\n") return 0 else: transaction_name = args[0] transaction = open(os.path.join(config.STACKDIR, transaction_name), 'r') self.stdout.writelines(transaction)