def cmd_description(args, context): if len(args) == 0: # Show story description. body = "Description: " + sf.data[-1]["info"]["description"] else: # Change story description. sf.new_revision() sf.set_info("description", " ".join(args)) body = "Description updated." return {"body": body}
def cmd_description(args, context): if len(args) == 0: # Show story description. body = "Description: " + sf.data[-1]["info"]["description"] else: # Change story description. sf.new_revision() sf.set_info("description", ' '.join(args)) body = "Description updated." return {"body": body}
def cmd_author(args, context): if len(args) == 0: # Show story author. body = "Author: " + sf.data[-1]["info"]["author"] else: # Change story author. sf.new_revision() sf.set_info("author", " ".join(args)) body = "Author updated." return {"body": body}
def cmd_author(args, context): if len(args) == 0: # Show story author. body = "Author: " + sf.data[-1]["info"]["author"] else: # Change story author. sf.new_revision() sf.set_info("author", ' '.join(args)) body = "Author updated." return {"body": body}
def cmd_notes(args, context): if len(args) != 0: return False contents = sf.text_edit(sf.data[-1]["info"]["notes"]) if not contents: body = "Error processing tempfile." return {"body": body} sf.set_info("notes", contents) body = "Notes updated." return {"body": body}
def cmd_name(args, context): if context[1] == "STORY": if len(args) == 0: # Show story name. body = "Story Name: " + sf.data[-1]["info"]["name"] else: # Change story name. sf.new_revision() sf.set_info("name", " ".join(args)) body = "Story name updated." c = "" elif context[1] == "SCENE": if len(args) == 0: # Show scene name. body = "Scene Name: " + sf.get_scene_by_id(context[2])[1] else: # Change scene name. sf.new_revision() sf.set_scene(context[2], "name", " ".join(args)) body = "Scene name updated." c = "Scene: " if len(args) != 0: return {"body": body, "name": '{0}"{1}"'.format(c, " ".join(args))} else: return {"body": body}
def cmd_name(args, context): if context[1] == "STORY": if len(args) == 0: # Show story name. body = "Story Name: " + sf.data[-1]["info"]["name"] else: # Change story name. sf.new_revision() sf.set_info("name", ' '.join(args)) body = "Story name updated." c = "" elif context[1] == "SCENE": if len(args) == 0: # Show scene name. body = "Scene Name: " + sf.get_scene_by_id(context[2])[1] else: # Change scene name. sf.new_revision() sf.set_scene(context[2], "name", ' '.join(args)) body = "Scene name updated." c = "Scene: " if len(args) != 0: return {"body": body, "name": "{0}\"{1}\"".format(c, ' '.join(args))} else: return {"body": body}