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
b4aede78
Commit
b4aede78
authored
Nov 28, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for the piping problem (#395)
parent
6e714f3f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
helper.py
cps/helper.py
+2
-1
web.py
cps/web.py
+1
-1
No files found.
cps/helper.py
View file @
b4aede78
...
@@ -281,7 +281,8 @@ def get_valid_filename(value, replace_whitespace=True):
...
@@ -281,7 +281,8 @@ def get_valid_filename(value, replace_whitespace=True):
if
replace_whitespace
:
if
replace_whitespace
:
#*+:\"/<>? are replaced by _
#*+:\"/<>? are replaced by _
value
=
re
.
sub
(
r'[\*\+:\\\"/<>\?]+'
,
u'_'
,
value
,
flags
=
re
.
U
)
value
=
re
.
sub
(
r'[\*\+:\\\"/<>\?]+'
,
u'_'
,
value
,
flags
=
re
.
U
)
# pipe has to be replaced with comma
value
=
re
.
sub
(
r'[\|]+'
,
u','
,
value
,
flags
=
re
.
U
)
value
=
value
[:
128
]
value
=
value
[:
128
]
if
not
value
:
if
not
value
:
raise
ValueError
(
"Filename cannot be empty"
)
raise
ValueError
(
"Filename cannot be empty"
)
...
...
cps/web.py
View file @
b4aede78
...
@@ -600,7 +600,7 @@ def modify_database_object(input_elements, db_book_object, db_object, db_session
...
@@ -600,7 +600,7 @@ def modify_database_object(input_elements, db_book_object, db_object, db_session
# if no element is found add it
# if no element is found add it
if
new_element
is
None
:
if
new_element
is
None
:
if
db_type
==
'author'
:
if
db_type
==
'author'
:
new_element
=
db_object
(
add_element
,
add_element
,
""
)
new_element
=
db_object
(
add_element
,
add_element
.
replace
(
'|'
,
','
)
,
""
)
elif
db_type
==
'series'
:
elif
db_type
==
'series'
:
new_element
=
db_object
(
add_element
,
add_element
)
new_element
=
db_object
(
add_element
,
add_element
)
elif
db_type
==
'custom'
:
elif
db_type
==
'custom'
:
...
...
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