How to use the zdict.constants.DB_FILE function in zdict

To help you get started, we’ve selected a few zdict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zdict / zdict / zdict / models.py View on Github external
import peewee

from zdict.constants import DB_FILE


db = peewee.SqliteDatabase(DB_FILE)


class Record(peewee.Model):
    '''
    A model for storing the query results into the SQLite db.

    :param word: the vocabulary
    :param content: the query result of the vocabulary.
        It's a json document has the following spec.
        {
            'word': word,
            // storing the querying result.
            'pronounce': [
                ('key', 'value'),
                ...
            ],
github zdict / zdict / zdict / utils.py View on Github external
def create_zdict_db_if_not_exists():
    if not os.path.exists(constants.DB_FILE):
        open(constants.DB_FILE, 'a').close()
github zdict / zdict / zdict / utils.py View on Github external
def create_zdict_db_if_not_exists():
    if not os.path.exists(constants.DB_FILE):
        open(constants.DB_FILE, 'a').close()
github zdict / zdict / zdict / utils.py View on Github external
def create_zdict_db_if_not_exists():
    if not os.path.exists(constants.DB_FILE):
        open(constants.DB_FILE, 'a').close()
github zdict / zdict / zdict / utils.py View on Github external
def create_zdict_db_if_not_exists():
    if not os.path.exists(constants.DB_FILE):
        open(constants.DB_FILE, 'a').close()