Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Create the database directory if it does not yet exist.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:dc839bab91fa3467bd66edf0c3b9f58d4bcab442
User & Date: brandon 2018-12-06 21:36:27
Context
2018-12-06
21:40
Fix module name check-in: 1cb7348a70 user: brandon tags: trunk
21:36
Create the database directory if it does not yet exist. check-in: dc839bab91 user: brandon tags: trunk
2018-11-14
22:12
Decrease right info panel width a bit check-in: 9c8f793655 user: brandon tags: trunk
Changes

Changes to grotesque.

69
70
71
72
73
74
75


76
77
78
79
80
81
82
        gui.setup_assistant(settings)
        if not os.path.exists(settings.configdir):
            os.makedirs(settings.configdir)
        settings.save()
    library_filename = settings.get_library_filename()
    # Connect to the db
    if not os.path.exists(library_filename):


        conn = db.connect(library_filename)
        db.create_tables(conn)
        db.set_up_db(conn, __version__)
    else:
        conn = db.connect(library_filename)
        try:
            db_version = db.query.get_db_version(conn)







>
>







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
        gui.setup_assistant(settings)
        if not os.path.exists(settings.configdir):
            os.makedirs(settings.configdir)
        settings.save()
    library_filename = settings.get_library_filename()
    # Connect to the db
    if not os.path.exists(library_filename):
        if not os.path.exists(settings.datadir):
            os.makedirs(settings.datadir)
        conn = db.connect(library_filename)
        db.create_tables(conn)
        db.set_up_db(conn, __version__)
    else:
        conn = db.connect(library_filename)
        try:
            db_version = db.query.get_db_version(conn)

Changes to src/grotesque/settings.py.

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
            if home_configdir is None:
                self.configdir = os.path.join(os.path.expanduser('~'),
                                              '.config', 'grotesque')
            else:
                self.configdir = os.path.join(home_configdir, 'grotesque')
            home_datadir = os.getenv('XDG_DATA_HOME')
            if home_datadir is None:
                datadir = os.path.join(os.path.expanduser('~'), '.local',
                                       'share', 'grotesque')
            else:
                datadir = os.path.join(home_datadir, 'grotesque')
            # Create a directory for Grotesque.
            # Define program's files.
            self.settings_filename = os.path.join(self.configdir,
                                                  'grotesque.cfg')
            self.library_filename = os.path.join(datadir,
                                                 'library.db')

    def load(self):
        return len(self.config.read(self.settings_filename)) > 0

    def save(self):
        with open(self.settings_filename, 'w') as f:







|
|

|




|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
            if home_configdir is None:
                self.configdir = os.path.join(os.path.expanduser('~'),
                                              '.config', 'grotesque')
            else:
                self.configdir = os.path.join(home_configdir, 'grotesque')
            home_datadir = os.getenv('XDG_DATA_HOME')
            if home_datadir is None:
                self.datadir = os.path.join(os.path.expanduser('~'), '.local',
                                            'share', 'grotesque')
            else:
                self.datadir = os.path.join(home_datadir, 'grotesque')
            # Create a directory for Grotesque.
            # Define program's files.
            self.settings_filename = os.path.join(self.configdir,
                                                  'grotesque.cfg')
            self.library_filename = os.path.join(self.datadir,
                                                 'library.db')

    def load(self):
        return len(self.config.read(self.settings_filename)) > 0

    def save(self):
        with open(self.settings_filename, 'w') as f: