Module Expr Str ImportFrom alias TryExcept body ImportFrom alias Import alias Import alias Import alias Import alias ImportFrom alias handlers ExceptHandler type NameLoad name NameStore body Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Str NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str If CompareNotIn NameLoad TupleLoad Str Str Str Str body Raise Call NameLoad Str Assign NameStore BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore Str If CompareEq NameLoad Str body AugAssignAdd NameStore Str Assign NameStore TupleLoad NameLoad NameLoad orelse AugAssignAdd NameStore BinOpAdd NameLoad Str Assign NameStore TupleLoad NameLoad Assign NameStore Call NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr GeneratorExp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareIs NameLoad NameLoad body Assign NameStore TupleLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse If UnaryOpNot CompareEq SubscriptLoad NameLoad Index Num NameLoad body Raise Call NameLoad BinOpAdd Call NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd BinOpAdd Str Call NameLoad NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareNotEq SubscriptLoad NameLoad Index Num Num body Return Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad BinOpAdd NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore TupleLoad NameLoad Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs Call NameLoad NameLoad Num body Return NameLoad orelse If CompareNotEq NameLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Num body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str NameLoad body Expr Str If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Str handlers ExceptHandler type NameLoad body Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return orelse Assign NameStore AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Call NameLoad Assign NameStore TupleLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad body Expr Str Assign NameStore TupleLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str If CompareEq Call NameLoad Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Num body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore SubscriptLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Index Num Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore TupleLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr BinOpAdd NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr GeneratorExp Call AttributeLoad NameLoad attr NameLoad NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore TupleLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore BinOpAdd NameLoad ListComp TupleLoad SubscriptLoad NameLoad Index Num NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Return ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Return ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Str attr BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args defaults body Expr Str Import alias Assign NameStore Call NameLoad For NameStore Call NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return Call AttributeLoad Call AttributeLoad Str attr NameLoad attr decorator_list
N/A N/A 
The SQLite backend implementation.

Database Layout
===============

current version number: 9
tables: version, accounts, account_$ACCOUNTNAME

version:
    version (INT): only one line: current db version

account:
    account (TEXT): name of the account
    resource (TEXT)
    ctag (TEXT) ctag of the collection

$ACCOUNTNAME_r:   # as in resource
    href (TEXT)
    etag (TEXT)
    name (TEXT): name as in vcard, seperated by ';'
    fname (TEXT): formated name
    status (INT): status of this card, see below for meaning
    vcard (TEXT): the actual vcard

 __future__ print_function N/A N/A pycarddav model N/A xdg.BaseDirectory N/A sys N/A sqlite3 N/A logging os path N/A N/A N/A ImportError N/A error N/A N/A N/A print error N/A N/A N/A sys exit 1 N/A OK 0 N/A NEW 1 N/A CHANGED 2 N/A DELETED 9 SQLiteDb N/A object N/A N/A Querying the addressbook database

    the type() of parameters named "account" should be something like str()
    and of parameters named "accountS" should be an iterable like list()
     __init__ N/A N/A self db_path encoding errors debug N/A None utf-8 strict False N/A N/A N/A db_path None N/A N/A db_path N/A N/A N/A N/A xdg BaseDirectory save_data_path pycard abook.db N/A N/A self db_path N/A N/A path expanduser db_path N/A N/A self conn N/A N/A sqlite3 connect N/A self db_path N/A N/A self cursor N/A N/A N/A self conn cursor N/A N/A self encoding encoding N/A N/A self errors errors N/A N/A self debug debug N/A N/A self display_all False N/A N/A self print_function print_contact_info N/A N/A N/A self _create_default_tables N/A N/A N/A self _check_table_version N/A __del__ N/A N/A self N/A N/A N/A N/A N/A N/A self conn close N/A search N/A N/A self search_string accounts where N/A vcard N/A N/A returns list of parsed vcards from db matching search_string
        where can be any of 'vcard', 'name', 'fname' or 'allnames' (meaning is
        searched for both 'name' or 'fname' for matches)
         N/A N/A where N/A vcard name fname allnames N/A N/A N/A ValueError Invalid 'where' argument N/A search_str N/A N/A % search_string % N/A sql_fmt SELECT href, vcard, etag FROM {0} WHERE  N/A N/A where allnames N/A N/A sql_fmt name LIKE (?) OR fname LIKE (?) N/A sql_args N/A search_str search_str N/A N/A sql_fmt N/A where  LIKE (?) N/A sql_args N/A search_str N/A result N/A list N/A account accounts N/A N/A rows N/A N/A self sql_ex N/A N/A sql_fmt format N/A account _r sql_args N/A N/A N/A result extend N/A N/A N/A self get_vcard_from_data account r N/A r rows N/A result N/A _dump N/A N/A self account_name N/A N/A N/A return table self.account, used for testing N/A sql_s N/A N/A SELECT * FROM {0} format N/A account_name _r N/A result N/A N/A self sql_ex sql_s N/A result N/A _check_table_version N/A N/A self N/A N/A N/A tests for current db Version
        if the table is still empty, insert db_version
         N/A database_version 11 N/A N/A N/A N/A self cursor execute SELECT version FROM version N/A result N/A N/A N/A self cursor fetchone N/A N/A result None N/A N/A stuple N/A database_version N/A N/A N/A N/A self cursor execute INSERT INTO version (version) VALUES (?) stuple N/A N/A N/A N/A self conn commit N/A N/A N/A N/A N/A result N/A 0 database_version N/A N/A N/A Exception N/A N/A str N/A self db_path  is probably an invalid or outdated database.
You should consider to remove it and sync again using pycardsyncer.
 N/A _create_default_tables N/A N/A self N/A N/A N/A creates version and account tables and insert table version number

         N/A N/A N/A N/A N/A N/A self cursor execute CREATE TABLE IF NOT EXISTS version
                                ( version INTEGER ) N/A N/A N/A logging debug made sure version table exists N/A N/A N/A Exception N/A error N/A N/A N/A N/A N/A sys stderr write N/A N/A Failed to connect to database,Unknown Error:  N/A str error N/A N/A N/A N/A self conn commit N/A N/A N/A N/A N/A N/A self cursor execute CREATE TABLE IF NOT EXISTS accounts (
                account TEXT NOT NULL,
                resource TEXT NOT NULL,
                ctag TEXT
                ) N/A N/A N/A logging debug made sure accounts table exists  N/A N/A N/A Exception N/A error N/A N/A N/A N/A N/A sys stderr write N/A N/A Failed to connect to database,Unknown Error:  N/A str error N/A N/A N/A N/A self conn commit N/A N/A N/A self _check_table_version N/A sql_ex N/A N/A self statement stuple N/A N/A N/A wrapper for sql statements, does a "fetchall"  N/A N/A N/A N/A self cursor execute statement stuple N/A result N/A N/A N/A self cursor fetchall N/A N/A N/A N/A self conn commit N/A result N/A check_account_table N/A N/A self account_name resource N/A N/A N/A count_sql_s SELECT count(*) FROM accounts
                WHERE account = ? AND resource = ? N/A N/A N/A N/A self cursor execute count_sql_s N/A account_name resource N/A result N/A N/A N/A self cursor fetchone N/A N/A N/A result N/A 0 0 N/A N/A N/A sql_s N/A N/A CREATE TABLE IF NOT EXISTS {0} (
                href TEXT,
                etag TEXT,
                name TEXT,
                fname TEXT,
                vcard TEXT,
                status INT NOT NULL,
                PRIMARY KEY(href)
                ) format N/A account_name _r N/A N/A N/A self sql_ex sql_s N/A sql_s INSERT INTO accounts (account, resource) VALUES (?, ?) N/A N/A N/A self sql_ex sql_s N/A N/A account_name _r resource N/A N/A N/A logging debug N/A N/A made sure {0} table exists format account_name N/A needs_update N/A N/A self href account_name etag N/A N/A N/A checks if we need to update this vcard
        if no table with the name account_$ACCOUNT exists, it will be created

        :param href: href of vcard
        :type href: str()
        :param etag: etag of vcard
        :type etag: str()
        :return: True or False
         N/A stuple N/A href N/A sql_s N/A N/A SELECT etag FROM {0} WHERE href = ? format N/A account_name _r N/A result N/A N/A self sql_ex sql_s stuple N/A N/A N/A len result 0 N/A N/A True N/A N/A N/A etag N/A N/A result N/A 0 N/A 0 N/A N/A True N/A N/A False N/A update N/A N/A self vcard account_name href etag status N/A OK N/A N/A insert a new or update an existing card in the db

        :param vcard: vcard to be inserted or updated
        :type vcard: model.VCard() or unicode() (an actual vcard)
        :param href: href of the card on the server, if this href already
                     exists in the db the card gets updated. If no href is
                     given, a random href is chosen and it is implied that this
                     card does not yet exist on the server, but will be
                     uploaded there on next sync.
        :type href: str()
        :param etag: the etga of the vcard, if this etag does not match the
                     remote etag on next sync, this card will be updated from
                     the server. For locally created vcards this should not be
                     set
        :type etag: str()
        :param status: status of the vcard
                       * OK: card is in sync with remote server
                       * NEW: card is not yet on the server, this needs to be
                              set for locally created vcards
                       * CHANGED: card locally changed, will be updated on the
                                  server on next sync (if remote card has not
                                  changed since last sync)
                       * DELETED: card locally delete, will also be deleted on
                                  one the server on next sync (if remote card
                                  has not changed)
        :type status: one of backend.OK, backend.NEW, backend.CHANGED,
                      BACKEND.DELETED

         N/A N/A isinstance vcard N/A str unicode N/A N/A N/A N/A vcard_s N/A N/A vcard decode utf-8 N/A N/A N/A UnicodeEncodeError N/A N/A vcard_s vcard N/A N/A N/A vcard N/A N/A model vcard_from_string vcard N/A N/A N/A Exception N/A error N/A N/A N/A N/A logging error N/A N/A VCard {0} could not be inserted into the db format href N/A N/A N/A logging debug error N/A N/A N/A logging info vcard N/A N/A N/A vcard_s N/A vcard vcf N/A N/A href N/A N/A href N/A get_random_href N/A stuple N/A etag N/A vcard name N/A vcard fname vcard_s status href href N/A sql_s N/A N/A INSERT OR REPLACE INTO {0} (etag, name, fname, vcard, status, href) VALUES (?, ?, ?, ?, ?, COALESCE((SELECT href FROM {0} WHERE href = ?), ?)); format N/A account_name _r N/A N/A N/A self sql_ex sql_s stuple N/A update_href N/A N/A self old_href new_href account_name etag status N/A OK N/A N/A updates old_href to new_href, can also alter etag and status,
        see update() for an explanation of these parameters N/A stuple N/A new_href etag status old_href N/A sql_s N/A N/A UPDATE {0} SET href = ?, etag = ?, status = ?              WHERE href = ?; format N/A account_name _r N/A N/A N/A self sql_ex sql_s stuple N/A href_exists N/A N/A self href account_name N/A N/A N/A returns True if href already exist in db

        :param href: href
        :type href: str()
        :returns: True or False
         N/A sql_s N/A N/A SELECT href FROM {0} WHERE href = ?; format N/A account_name _r N/A N/A N/A len N/A N/A self sql_ex sql_s N/A href 0 N/A N/A False N/A N/A True N/A get_etag N/A N/A self href account_name N/A N/A N/A get etag for href

        type href: str()
        return: etag
        rtype: str()
         N/A sql_s N/A N/A SELECT etag FROM {0} WHERE href=(?); format N/A account_name _r N/A etag N/A N/A N/A N/A self sql_ex sql_s N/A href N/A 0 N/A 0 N/A etag N/A delete_vcard_from_db N/A N/A self href account_name N/A N/A N/A 
        removes the whole vcard,
        returns nothing
         N/A stuple N/A href N/A N/A N/A logging debug N/A locally deleting  N/A str href N/A N/A N/A self sql_ex N/A N/A DELETE FROM {0} WHERE href=(?) format N/A account_name _r stuple N/A get_all_href_from_db N/A N/A self accounts N/A N/A N/A returns a list with all parsed vcards
         N/A result N/A list N/A account accounts N/A N/A rows N/A N/A self sql_ex N/A N/A SELECT href, vcard, etag FROM {0} ORDER BY fname COLLATE NOCASE format N/A account _r N/A N/A N/A result extend N/A N/A N/A self get_vcard_from_data account r N/A r rows N/A result N/A get_all_href_from_db_not_new N/A N/A self accounts N/A N/A N/A returns list of all not new hrefs N/A result N/A list N/A account accounts N/A N/A sql_s N/A N/A SELECT href FROM {0} WHERE status != (?) format N/A account _r N/A stuple N/A NEW N/A hrefs N/A N/A self sql_ex sql_s stuple N/A result N/A result N/A N/A N/A href N/A 0 account N/A href hrefs N/A result N/A get_vcard_from_data N/A N/A self account_name href vcard etag N/A N/A N/A returns a VCard()
         N/A vcard N/A N/A model vcard_from_string vcard N/A N/A vcard href href N/A N/A vcard account account_name N/A N/A vcard etag etag N/A vcard N/A get_vcard_from_db N/A N/A self href account_name N/A N/A N/A returns a VCard()
         N/A sql_s N/A N/A SELECT vcard, etag FROM {0} WHERE href=(?) format N/A account_name _r N/A result N/A N/A self sql_ex sql_s N/A href N/A N/A N/A self get_vcard_from_data account_name href N/A result N/A 0 N/A get_changed N/A N/A self account_name N/A N/A N/A returns list of hrefs of locally edited vcards
         N/A sql_s N/A N/A SELECT href FROM {0} WHERE status == (?) format N/A account_name _r N/A result N/A N/A self sql_ex sql_s N/A CHANGED N/A N/A N/A row N/A 0 N/A row result N/A get_new N/A N/A self account_name N/A N/A N/A returns list of hrefs of locally added vcards
         N/A sql_s N/A N/A SELECT href FROM {0} WHERE status == (?) format N/A account_name _r N/A result N/A N/A self sql_ex sql_s N/A NEW N/A N/A N/A row N/A 0 N/A row result N/A get_marked_delete N/A N/A self account_name N/A N/A N/A returns list of tuples (hrefs, etags) of locally deleted vcards
         N/A sql_s N/A N/A SELECT href, etag FROM {0} WHERE status == (?) format N/A account_name _r N/A result N/A N/A self sql_ex sql_s N/A DELETED N/A result N/A mark_delete N/A N/A self href account_name N/A N/A N/A marks the entry as to be deleted on server on next sync
         N/A sql_s N/A N/A UPDATE {0} SET STATUS = ? WHERE href = ? format N/A account_name _r N/A N/A N/A self sql_ex sql_s N/A DELETED href N/A reset_flag N/A N/A self href account_name N/A N/A N/A 
        resets the status for a given href to 0 (=not edited locally)
         N/A sql_s N/A N/A UPDATE {0} SET status = ? WHERE href = ? format N/A account_name _r N/A N/A N/A self sql_ex sql_s N/A OK href N/A N/A get_random_href N/A N/A N/A N/A N/A returns a random href
     N/A random N/A tmp_list N/A list N/A _ N/A xrange 3 N/A N/A rand_number N/A N/A random randint 0 4294967296 N/A N/A N/A tmp_list append N/A N/A {0:x} format rand_number N/A N/A N/A N/A N/A - join tmp_list upper N/A