def done(cmd, opt): if cmd.done_rate is None: done_ratio = "100" else: done_ratio = cmd.done_rate if int(done_ratio) == 0: status = "1" elif int(done_ratio) > 0 and int(done_ratio) < 100: status = "2" elif int(done_ratio) == 100: status = "3" xml = __prexml( """<done_ratio>%s</done_ratio> <status_id>%s</status_id>""" % (done_ratio, status) ) tools.put(ticket_url(cmd), xml) print("ticket %s is change -> done rate is %s" % (cmd.ticket, done_ratio))
def assign(cmd, opt): conf = tools.load_configure(cmd.configure_filename) if not "REDMINE_ID" in conf: xml_data_path = conf["URL"] + "users/current.xml?key=" + conf["API_KEY"] xml = etree.parse(urllib.urlopen(xml_data_path)).find(".//id") print( """Oops!! :( Your Redmine Id is not found by Configure Yaml. your_home_dir/.redline -> REDMINE_ID: 666 oh,don't you know your redmine id ? your redmine id is %s :) Have a fun!! """ % (xml.text) ) exit() xml = __prexml("<assigned_to_id>%i</assigned_to_id>" % (conf["REDMINE_ID"])) tools.put(ticket_url(cmd), xml) print("ticket %s is Assigned by you." % (cmd.ticket))
def close(cmd, opt): xml = __prexml("<status_id>%s</status_id><notes>%s</notes>" % (5, cmd.log)) tools.put(ticket_url(cmd), xml) print("ticket %s is close" % (cmd.ticket))