Example #1
0
def getCursor(location=path.join('Resources', 'quip.db')):
    """

    @param location: file location of database
    @return: database connection cursor
    """
    return connect(absolutePath(location), isolation_level=None).cursor()
Example #2
0
            '.wav': 'audio-x-wav',
            '.wiz': 'application-msword',
            '.wsdl': 'application-xml',
            '.xbm': 'image-x-generic',
            '.xhtml': 'application-xhtml+xml.png',
            '.xlb': 'application-vnd.ms-excel',
            '.xls': 'application-vnd.ms-excel',
            '.xml': 'text-xml',
            '.xpdl': 'application-xml',
            '.xpm': 'image-x-generic',
            '.xsl': 'application-xml',
            '.xslt': 'application-xlst+xml',
            '.xwd': 'image-x-generic',
            '.zip': 'application-zip'}

EMOTICON_RESOURCES = {r: t for t, r in EMOTICONS.items()}

# flag image directory relative path
FLAGS = absolutePath(path.join('Resources', 'Images', 'flags'))
EXT = absolutePath(path.join('Resources', 'Images', 'extensions'))

#################
# Regex patterns
#################
# basic url finding pattern
URL_PATTERN = re.compile('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+')
# emoticon format
EMOTE_PATTERN = re.compile(r':\w+:')
# resource pattern format
RESOURCE_PATTERN = re.compile(r'<img src=":/quip/Images/\S+png" />')