Esempio n. 1
0
def get_record_locked_since(recid, uid):
    """ Get modification time for the given recid and uid
    """
    mtime = get_cache_post_date(recid, uid)
    if mtime:
        locked_since = mtime.strftime('%b %d, %H:%M')
    else:
        locked_since = ""

    return locked_since
Esempio n. 2
0
def get_record_locked_since(recid, uid):
    """ Get modification time for the given recid and uid
    """
    mtime = get_cache_post_date(recid, uid)
    if mtime:
        locked_since = mtime.strftime('%b %d, %H:%M')
    else:
        locked_since = ""

    return locked_since
Esempio n. 3
0
def get_cache_mtime(recid, uid):
    """Get the last modified time of the BibEdit cache file. Check that the
    cache exists before calling this function.

    """
    post_date = get_cache_post_date(recid, uid)
    if not post_date:
        return
    # In python 3.3 we can call .timestamp() on datetimes
    # In python 2.7 we can call .total_seconds() on timedeltas
    # In python 2.4 we have this
    # It think it is beautiful
    td = (post_date - datetime(1970, 1, 1))
    return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
Esempio n. 4
0
def get_cache_mtime(recid, uid):
    """Get the last modified time of the BibEdit cache file. Check that the
    cache exists before calling this function.

    """
    post_date = get_cache_post_date(recid, uid)
    if not post_date:
        return
    # In python 3.3 we can call .timestamp() on datetimes
    # In python 2.7 we can call .total_seconds() on timedeltas
    # In python 2.4 we have this
    # It think it is beautiful
    td = (post_date - datetime(1970, 1, 1))
    return (td.microseconds +
            (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6