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
0458ea5a
Commit
0458ea5a
authored
Jan 16, 2017
by
idalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed wrong translations. fixed smtp with ssl has no response.
parent
6fcd65b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
helper.py
cps/helper.py
+17
-11
messages.mo
cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo
+0
-0
messages.po
cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
+2
-2
No files found.
cps/helper.py
View file @
0458ea5a
...
...
@@ -113,13 +113,16 @@ def send_test_mail(kindle_mail):
org_stderr
=
smtplib
.
stderr
smtplib
.
stderr
=
StderrLogger
()
mailserver
=
smtplib
.
SMTP
(
settings
[
"mail_server"
],
settings
[
"mail_port"
],
timeout
)
if
int
(
use_ssl
)
==
1
:
mailserver
=
smtplib
.
SMTP_SSL
(
settings
[
"mail_server"
],
settings
[
"mail_port"
],
timeout
)
else
:
mailserver
=
smtplib
.
SMTP
(
settings
[
"mail_server"
],
settings
[
"mail_port"
],
timeout
)
mailserver
.
set_debuglevel
(
1
)
if
int
(
use_ssl
)
==
1
:
mailserver
.
ehlo
()
mailserver
.
starttls
()
mailserver
.
ehlo
()
#
if int(use_ssl) == 1:
#
mailserver.ehlo()
#
mailserver.starttls()
#
mailserver.ehlo()
if
settings
[
"mail_password"
]:
mailserver
.
login
(
settings
[
"mail_login"
],
settings
[
"mail_password"
])
...
...
@@ -150,7 +153,7 @@ def send_mail(book_id, kindle_mail):
msg
[
'To'
]
=
kindle_mail
msg
[
'Subject'
]
=
_
(
'Send to Kindle'
)
text
=
_
(
'This email has been sent via calibre web.'
)
msg
.
attach
(
MIMEText
(
text
))
msg
.
attach
(
MIMEText
(
text
.
encode
(
'UTF-8'
),
'plain'
,
'UTF-8'
))
use_ssl
=
settings
.
get
(
'mail_use_ssl'
,
0
)
...
...
@@ -201,13 +204,16 @@ def send_mail(book_id, kindle_mail):
org_stderr
=
smtplib
.
stderr
smtplib
.
stderr
=
StderrLogger
()
mailserver
=
smtplib
.
SMTP
(
settings
[
"mail_server"
],
settings
[
"mail_port"
],
timeout
)
if
int
(
use_ssl
)
==
1
:
mailserver
=
smtplib
.
SMTP_SSL
(
settings
[
"mail_server"
],
settings
[
"mail_port"
],
timeout
)
else
:
mailserver
=
smtplib
.
SMTP
(
settings
[
"mail_server"
],
settings
[
"mail_port"
],
timeout
)
mailserver
.
set_debuglevel
(
1
)
if
int
(
use_ssl
)
==
1
:
mailserver
.
ehlo
()
mailserver
.
starttls
()
mailserver
.
ehlo
()
#
if int(use_ssl) == 1:
#
mailserver.ehlo()
#
mailserver.starttls()
#
mailserver.ehlo()
if
settings
[
"mail_password"
]:
mailserver
.
login
(
settings
[
"mail_login"
],
settings
[
"mail_password"
])
...
...
cps/translations/zh_Hans_CN/LC_MESSAGES/messages.mo
View file @
0458ea5a
No preview for this file type
cps/translations/zh_Hans_CN/LC_MESSAGES/messages.po
View file @
0458ea5a
...
...
@@ -41,7 +41,7 @@ msgstr "发送到Kindle"
#: cps/helper.py:174 cps/helper.py:189
msgid "Could not find any formats suitable for sending by email"
msgstr "无法适合邮件发送的格式"
msgstr "无法
找到
适合邮件发送的格式"
#: cps/helper.py:183
msgid "Could not convert epub to mobi"
...
...
@@ -156,7 +156,7 @@ msgstr "此书已被成功发给 %(kindlemail)s"
#: cps/web.py:1212
#, python-format
msgid "There was an error sending this book: %(res)s"
msgstr "发送
%(res)s 这本书的时候出现错误
"
msgstr "发送
这本书的时候出现错误: %(res)s
"
#: cps/web.py:1214
msgid "Please configure your kindle email address first..."
...
...
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