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
a659f2e4
Commit
a659f2e4
authored
Jan 03, 2021
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved logging for emails
Removed private data from debug export
parent
760fbbb3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
config_sql.py
cps/config_sql.py
+1
-1
logger.py
cps/logger.py
+7
-0
convert.py
cps/tasks/convert.py
+9
-3
mail.py
cps/tasks/mail.py
+1
-1
No files found.
cps/config_sql.py
View file @
a659f2e4
...
@@ -275,7 +275,7 @@ class _ConfigSQL(object):
...
@@ -275,7 +275,7 @@ class _ConfigSQL(object):
def
toDict
(
self
):
def
toDict
(
self
):
storage
=
{}
storage
=
{}
for
k
,
v
in
self
.
__dict__
.
items
():
for
k
,
v
in
self
.
__dict__
.
items
():
if
k
[
0
]
!=
'_'
or
k
.
endswith
(
"password
"
):
if
k
[
0
]
!=
'_'
and
not
k
.
endswith
(
"password"
)
and
not
k
.
endswith
(
"secret
"
):
storage
[
k
]
=
v
storage
[
k
]
=
v
return
storage
return
storage
...
...
cps/logger.py
View file @
a659f2e4
...
@@ -49,6 +49,13 @@ class _Logger(logging.Logger):
...
@@ -49,6 +49,13 @@ class _Logger(logging.Logger):
else
:
else
:
self
.
error
(
message
,
stacklevel
=
2
,
*
args
,
**
kwargs
)
self
.
error
(
message
,
stacklevel
=
2
,
*
args
,
**
kwargs
)
def
debug_no_auth
(
self
,
message
,
*
args
,
**
kwargs
):
if
message
.
startswith
(
"send: AUTH"
):
self
.
debug
(
message
[:
16
],
stacklevel
=
2
,
*
args
,
**
kwargs
)
else
:
self
.
debug
(
message
,
stacklevel
=
2
,
*
args
,
**
kwargs
)
def
get
(
name
=
None
):
def
get
(
name
=
None
):
return
logging
.
getLogger
(
name
)
return
logging
.
getLogger
(
name
)
...
...
cps/tasks/convert.py
View file @
a659f2e4
...
@@ -66,9 +66,15 @@ class TaskConvert(CalibreTask):
...
@@ -66,9 +66,15 @@ class TaskConvert(CalibreTask):
# if we're sending to kindle after converting, create a one-off task and run it immediately
# if we're sending to kindle after converting, create a one-off task and run it immediately
# todo: figure out how to incorporate this into the progress
# todo: figure out how to incorporate this into the progress
try
:
try
:
worker_thread
.
add
(
self
.
user
,
TaskEmail
(
self
.
settings
[
'subject'
],
self
.
results
[
"path"
],
worker_thread
.
add
(
self
.
user
,
TaskEmail
(
self
.
settings
[
'subject'
],
filename
,
self
.
settings
,
self
.
kindle_mail
,
self
.
results
[
"path"
],
self
.
settings
[
'subject'
],
self
.
settings
[
'body'
],
internal
=
True
))
filename
,
self
.
settings
,
self
.
kindle_mail
,
self
.
settings
[
'subject'
],
self
.
settings
[
'body'
],
internal
=
True
)
)
except
Exception
as
e
:
except
Exception
as
e
:
return
self
.
_handleError
(
str
(
e
))
return
self
.
_handleError
(
str
(
e
))
...
...
cps/tasks/mail.py
View file @
a659f2e4
...
@@ -44,7 +44,7 @@ class EmailBase:
...
@@ -44,7 +44,7 @@ class EmailBase:
def
send
(
self
,
strg
):
def
send
(
self
,
strg
):
"""Send `strg' to the server."""
"""Send `strg' to the server."""
log
.
debug
(
'send:
%
r'
,
strg
[:
300
]
)
log
.
debug
_no_auth
(
'send: {}'
.
format
(
strg
[:
300
])
)
if
hasattr
(
self
,
'sock'
)
and
self
.
sock
:
if
hasattr
(
self
,
'sock'
)
and
self
.
sock
:
try
:
try
:
if
self
.
transferSize
:
if
self
.
transferSize
:
...
...
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