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
274d2d9d
Commit
274d2d9d
authored
Jun 04, 2018
by
SiphonSquirrel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve rename logic for directory name collisions.
parent
43a391d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
helper.py
cps/helper.py
+6
-1
No files found.
cps/helper.py
View file @
274d2d9d
...
...
@@ -332,7 +332,12 @@ def update_dir_stucture(book_id, calibrepath):
if
titledir
!=
new_titledir
:
try
:
new_title_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
path
),
new_titledir
)
os
.
renames
(
path
,
new_title_path
)
if
not
os
.
path
.
exists
(
new_title_path
):
os
.
renames
(
path
,
new_title_path
)
else
:
for
dir_name
,
subdir_list
,
file_list
in
os
.
walk
(
path
):
for
file
in
file_list
:
os
.
renames
(
os
.
path
.
join
(
dir_name
,
file
),
os
.
path
.
join
(
new_title_path
+
dir_name
[
len
(
path
):],
file
))
path
=
new_title_path
localbook
.
path
=
localbook
.
path
.
split
(
'/'
)[
0
]
+
'/'
+
new_titledir
except
OSError
as
ex
:
...
...
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