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
f8132f4d
Commit
f8132f4d
authored
Aug 14, 2018
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #574
parent
bb5d7d7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
worker.py
cps/worker.py
+10
-7
No files found.
cps/worker.py
View file @
f8132f4d
...
@@ -84,16 +84,12 @@ def get_attachment(bookpath, filename):
...
@@ -84,16 +84,12 @@ def get_attachment(bookpath, filename):
return
attachment
return
attachment
# Class for sending email with ability to get current progress
# Class for sending email with ability to get current progress
class
email
(
smtplib
.
SMTP
):
class
email
base
(
):
transferSize
=
0
transferSize
=
0
progress
=
0
progress
=
0
def
__init__
(
self
,
*
args
,
**
kwargs
):
smtplib
.
SMTP
.
__init__
(
self
,
*
args
,
**
kwargs
)
def
data
(
self
,
msg
):
def
data
(
self
,
msg
):
self
.
transferSize
=
len
(
msg
)
self
.
transferSize
=
len
(
msg
)
(
code
,
resp
)
=
smtplib
.
SMTP
.
data
(
self
,
msg
)
(
code
,
resp
)
=
smtplib
.
SMTP
.
data
(
self
,
msg
)
...
@@ -138,8 +134,15 @@ class email(smtplib.SMTP):
...
@@ -138,8 +134,15 @@ class email(smtplib.SMTP):
return
"100
%
"
return
"100
%
"
# Class for sending ssl encrypted email with ability to get current progress
# Class for sending email with ability to get current progress, derived from emailbase class
class
email_SSL
(
email
,
smtplib
.
SMTP_SSL
):
class
email
(
emailbase
,
smtplib
.
SMTP
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
smtplib
.
SMTP
.
__init__
(
self
,
*
args
,
**
kwargs
)
# Class for sending ssl encrypted email with ability to get current progress, , derived from emailbase class
class
email_SSL
(
emailbase
,
smtplib
.
SMTP_SSL
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
smtplib
.
SMTP_SSL
.
__init__
(
self
,
*
args
,
**
kwargs
)
smtplib
.
SMTP_SSL
.
__init__
(
self
,
*
args
,
**
kwargs
)
...
...
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