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
b7f3e00f
Commit
b7f3e00f
authored
Feb 21, 2020
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update updater to handle venv folders
parent
de8f6d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
updater.py
cps/updater.py
+12
-1
No files found.
cps/updater.py
View file @
b7f3e00f
...
@@ -193,7 +193,12 @@ class Updater(threading.Thread):
...
@@ -193,7 +193,12 @@ class Updater(threading.Thread):
exclude
=
(
exclude
=
(
os
.
sep
+
'app.db'
,
os
.
sep
+
'calibre-web.log1'
,
os
.
sep
+
'calibre-web.log2'
,
os
.
sep
+
'gdrive.db'
,
os
.
sep
+
'app.db'
,
os
.
sep
+
'calibre-web.log1'
,
os
.
sep
+
'calibre-web.log2'
,
os
.
sep
+
'gdrive.db'
,
os
.
sep
+
'vendor'
,
os
.
sep
+
'calibre-web.log'
,
os
.
sep
+
'.git'
,
os
.
sep
+
'client_secrets.json'
,
os
.
sep
+
'vendor'
,
os
.
sep
+
'calibre-web.log'
,
os
.
sep
+
'.git'
,
os
.
sep
+
'client_secrets.json'
,
os
.
sep
+
'gdrive_credentials'
,
os
.
sep
+
'settings.yaml'
)
os
.
sep
+
'gdrive_credentials'
,
os
.
sep
+
'settings.yaml'
,
os
.
sep
+
'venv'
,
os
.
sep
+
'virtualenv'
,
os
.
sep
+
'access.log'
,
os
.
sep
+
'access.log1'
,
os
.
sep
+
'access.log2'
,
)
additional_path
=
self
.
is_venv
()
if
additional_path
:
exclude
=
exclude
+
(
additional_path
)
for
root
,
dirs
,
files
in
os
.
walk
(
destination
,
topdown
=
True
):
for
root
,
dirs
,
files
in
os
.
walk
(
destination
,
topdown
=
True
):
for
name
in
files
:
for
name
in
files
:
old_list
.
append
(
os
.
path
.
join
(
root
,
name
)
.
replace
(
destination
,
''
))
old_list
.
append
(
os
.
path
.
join
(
root
,
name
)
.
replace
(
destination
,
''
))
...
@@ -229,6 +234,12 @@ class Updater(threading.Thread):
...
@@ -229,6 +234,12 @@ class Updater(threading.Thread):
logger
.
debug
(
"Could not remove:
%
s"
,
item_path
)
logger
.
debug
(
"Could not remove:
%
s"
,
item_path
)
shutil
.
rmtree
(
source
,
ignore_errors
=
True
)
shutil
.
rmtree
(
source
,
ignore_errors
=
True
)
def
is_venv
(
self
):
if
(
hasattr
(
sys
,
'real_prefix'
))
or
(
hasattr
(
sys
,
'base_prefix'
)
and
sys
.
base_prefix
!=
sys
.
prefix
):
return
os
.
sep
+
os
.
path
.
relpath
(
sys
.
prefix
,
constants
.
BASE_DIR
)
else
:
return
False
@
classmethod
@
classmethod
def
_nightly_version_info
(
cls
):
def
_nightly_version_info
(
cls
):
if
is_sha1
(
constants
.
NIGHTLY_VERSION
[
0
])
and
len
(
constants
.
NIGHTLY_VERSION
[
1
])
>
0
:
if
is_sha1
(
constants
.
NIGHTLY_VERSION
[
0
])
and
len
(
constants
.
NIGHTLY_VERSION
[
1
])
>
0
:
...
...
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