示例#1
0
文件: _util.py 项目: sjklipp/autofile
def is_random_string_identifier(sid):
    """ could this have been generated by `random_string_identifier()`?

    :param sid: string identifier
    :type sid: string
    :returns: is the pattern a random string
    :rtype: bool
    """
    sid_pattern = app.URLSAFE_CHAR * 12
    return apf.full_match(sid_pattern, sid)
示例#2
0
def is_random_string_identifier(sid):
    """ could this have been generated by `random_string_identifier()`?
    """
    sid_pattern = app.URLSAFE_CHAR * 12
    return apf.full_match(sid_pattern, sid)
示例#3
0
def comment_line(zmat_str, symbol_pattern=SYMBOL_PATTERN):
    """ get the comment line (the header, if there is one)
    """
    head_line = apf.strip_spaces(zmat_str.splitlines()[0])
    return '' if apf.full_match(symbol_pattern, head_line) else head_line