Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
a5fe21c9
Commit
a5fe21c9
authored
Aug 03, 2015
by
Jan Broer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add APP_DB_ROOT config variable
parent
0b5b3b84
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
config.py
cps/config.py
+3
-0
ub.py
cps/ub.py
+1
-1
No files found.
cps/config.py
View file @
a5fe21c9
...
...
@@ -44,6 +44,7 @@ def check_setting_int(config, cfg_name, item_name, def_val):
CheckSection
(
'General'
)
DB_ROOT
=
check_setting_str
(
CFG
,
'General'
,
'DB_ROOT'
,
os
.
path
.
join
(
os
.
getcwd
(),
"Calibre Library"
))
APP_DB_ROOT
=
check_setting_str
(
CFG
,
'General'
,
'APP_DB_ROOT'
,
os
.
getcwd
())
TEMPLATEDIR
=
check_setting_str
(
CFG
,
'General'
,
'TEMPLATEDIR'
,
os
.
path
.
join
(
os
.
getcwd
(),
"views"
))
MAIN_DIR
=
check_setting_str
(
CFG
,
'General'
,
'MAIN_DIR'
,
os
.
getcwd
())
PORT
=
check_setting_int
(
CFG
,
'General'
,
'PORT'
,
8083
)
...
...
@@ -59,6 +60,7 @@ SYS_ENCODING="UTF-8"
configval
=
{}
configval
[
"DB_ROOT"
]
=
DB_ROOT
configval
[
"APP_DB_ROOT"
]
=
APP_DB_ROOT
configval
[
"TEMPLATEDIR"
]
=
TEMPLATEDIR
configval
[
"MAIN_DIR"
]
=
MAIN_DIR
configval
[
"PORT"
]
=
PORT
...
...
@@ -72,6 +74,7 @@ def save_config(configval):
new_config
.
filename
=
CONFIG_FILE
new_config
[
'General'
]
=
{}
new_config
[
'General'
][
'DB_ROOT'
]
=
configval
[
"DB_ROOT"
]
new_config
[
'General'
][
'APP_DB_ROOT'
]
=
configval
[
"APP_DB_ROOT"
]
new_config
[
'General'
][
'TEMPLATEDIR'
]
=
configval
[
"TEMPLATEDIR"
]
new_config
[
'General'
][
'MAIN_DIR'
]
=
configval
[
"MAIN_DIR"
]
new_config
[
'General'
][
'PORT'
]
=
configval
[
"PORT"
]
...
...
cps/ub.py
View file @
a5fe21c9
...
...
@@ -8,7 +8,7 @@ import os
from
cps
import
config
from
werkzeug.security
import
generate_password_hash
dbpath
=
os
.
path
.
join
(
config
.
MAIN_DIR
,
"app.db"
)
dbpath
=
os
.
path
.
join
(
config
.
APP_DB_ROOT
,
"app.db"
)
engine
=
create_engine
(
'sqlite:///{0}'
.
format
(
dbpath
),
echo
=
False
)
Base
=
declarative_base
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment