Example #1
0
def get_message():
    '''
    get message from editor
    '''
    prompt = '''
# Please enter the message for your tag. Lines starting with '#'
# will be ignored, and an empty message aborts the submission.
#'''
    raw = edit(prompt)
    useful = [i for i in raw.splitlines() if not i.startswith('#') ]
    return os.linesep.join(useful).strip()
Example #2
0
def get_message():
    '''
    get message from editor
    '''
    prompt = '''
# Please enter the message for your tag. Lines starting with '#'
# will be ignored, and an empty message aborts the submission.
#'''

    #check for additional submit template
    template_path = _lookup_submit_template()
    if template_path:
        with open(template_path, 'r') as template_file:
            submit_template = template_file.read()
            prompt = submit_template

    raw = edit(prompt)
    useful = [i for i in raw.splitlines() if not i.startswith('#')]
    return os.linesep.join(useful).strip()
Example #3
0
def get_message():
    '''
    get message from editor
    '''
    prompt = '''
# Please enter the message for your tag. Lines starting with '#'
# will be ignored, and an empty message aborts the submission.
#'''

    #check for additional submit template
    template_path = _lookup_submit_template()
    if template_path:
        with open(template_path, 'r') as template_file:
            submit_template = template_file.read()
            prompt = submit_template

    raw = edit(prompt)
    useful = [i for i in raw.splitlines() if not i.startswith('#')]
    return os.linesep.join(useful).strip()