Esempio n. 1
0
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}
Esempio n. 2
0
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}
Esempio n. 3
0
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}
Esempio n. 4
0
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}
Esempio n. 5
0
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}
Esempio n. 6
0
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}
Esempio n. 7
0
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}
Esempio n. 8
0
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}