Example #1
0
def insert_by_id(paste_id):
    """Fetches paste with `paste_id` and inserts it into current buffer"""
    paste = lodgeit.get_paste_by_id(paste_id)
    if paste:
        lisp.insert(paste.code)
    else:
        lisp.error('There is no paste with id %s', paste_id)
Example #2
0
def fetch_by_id(paste_id):
    """Fetches paste with `paste_id` and inserts it into a new buffer"""
    paste = lodgeit.get_paste_by_id(paste_id)
    if paste:
        new_buffer_from_paste(paste)
    else:
        lisp.error('There is no paste with id %s', paste_id)
Example #3
0
def insert_by_id(paste_id):
    """Fetches paste with `paste_id` and inserts it into current buffer"""
    paste = lodgeit.get_paste_by_id(paste_id)
    if paste:
        lisp.insert(paste.code)
    else:
        lisp.error('There is no paste with id {0}'.format(paste_id))
Example #4
0
def fetch_by_id(paste_id):
    """Fetches paste with `paste_id` and inserts it into a new buffer"""
    paste = lodgeit.get_paste_by_id(paste_id)
    if paste:
        new_buffer_from_paste(paste)
    else:
        lisp.error('There is no paste with id'.format(paste_id))
Example #5
0
def new_paste(code, language, filename):
    """Creates a new paste."""
    lisp.message('Transferring paste to server...')
    id = lodgeit.new_paste(code, language, filename=filename)
    paste = lodgeit.get_paste_by_id(id)
    lisp.message('New paste with id %s created. Refer to %s', paste.id,
                 paste.url)
    if lisp.paste_kill_url.value():
        lisp.kill_new(paste.url)
    if lisp.paste_show_in_browser.value():
        lisp.browse_url(paste.url)
Example #6
0
def new_paste(code, language, filename):
    """Creates a new paste."""
    lisp.message('Transferring paste to server...')
    id = lodgeit.new_paste(code, language, filename=filename)
    paste = lodgeit.get_paste_by_id(id)
    lisp.message(
        'New paste with id {0.id} created. Refer to {0.url}'.format(paste))
    if lisp.paste_kill_url.value():
        lisp.kill_new(paste.url)
    if lisp.paste_show_in_browser.value():
        lisp.browse_url(paste.url)