Exemple #1
0
def getUser(string):
    """Return the user which has created the post."""
    user = string.rpartition('-')[2]
    if user == 'None':
        return None
    else:
        return user
Exemple #2
0
def getUser(string):
    """Return the user which has created the post."""
    user = string.rpartition('-')[2]
    if user == 'None':
        return None
    else:
        return user
Exemple #3
0
def get_object_from_string(string):
    """
    Given a string identifying an object (as returned by the get_class_string
    method) load and return the actual object.
    """
    import importlib

    the_module, _, the_name = string.rpartition('.')

    return getattr(importlib.import_module(the_module), the_name)
Exemple #4
0
def getTime(string):
    """Return the time a post was created."""
    return string.rpartition('-')[0].rpartition('-')[0].rpartition('-')[2]
Exemple #5
0
def getTitle(string):
    """Return the title of a post."""
    return string.rpartition('-')[0].rpartition('-')[0].rpartition(
        '-')[0].partition('-')[2]
Exemple #6
0
def getDisplayMode(string):
    """Return the display mode of a post."""
    return string.rpartition('-')[0].rpartition('-')[2]
def convert_pastesite_url(string):
    """ Convert the pastesite URL to downloadable format """
    head, sep, tail = string.rpartition('/')
    return_url = head + '/plain/' + tail + '.txt'
    return return_url
def convert_privatepaste_url(string):
    """ Convert the privatepate URL to downloadable format """
    head, sep, tail = string.rpartition('/')
    return_url = head + '/download/' + tail
    return return_url
Exemple #9
0
def getTime(string):
    """Return the time a post was created."""
    return string.rpartition('-')[0].rpartition('-')[0].rpartition('-')[2]
Exemple #10
0
def getTitle(string):
    """Return the title of a post."""
    return string.rpartition('-')[0].rpartition('-')[0].rpartition('-')[0].partition('-')[2]
Exemple #11
0
def getDisplayMode(string):
    """Return the display mode of a post."""
    return string.rpartition('-')[0].rpartition('-')[2]
def convert_pastesite_url(string):
    """ Convert the pastesite URL to downloadable format """
    head, sep, tail = string.rpartition("/")
    return_url = head + "/plain/" + tail + ".txt"
    return return_url