mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
python3: make recent_uas build
This commit is contained in:
parent
a7bbf0f51e
commit
13d236f556
@ -10,11 +10,13 @@ from datetime import datetime
|
|||||||
|
|
||||||
from setup import download_securely
|
from setup import download_securely
|
||||||
|
|
||||||
|
from polyglot.builtins import filter
|
||||||
|
|
||||||
is_ci = os.environ.get('CI', '').lower() == 'true'
|
is_ci = os.environ.get('CI', '').lower() == 'true'
|
||||||
|
|
||||||
|
|
||||||
def filter_ans(ans):
|
def filter_ans(ans):
|
||||||
return filter(None, (x.strip() for x in ans))
|
return list(filter(None, (x.strip() for x in ans)))
|
||||||
|
|
||||||
|
|
||||||
def common_user_agents():
|
def common_user_agents():
|
||||||
|
@ -270,7 +270,7 @@ class RecentUAs(Command): # {{{
|
|||||||
from setup.browser_data import get_data
|
from setup.browser_data import get_data
|
||||||
data = get_data()
|
data = get_data()
|
||||||
with open(self.UA_PATH, 'wb') as f:
|
with open(self.UA_PATH, 'wb') as f:
|
||||||
f.write(json.dumps(data, indent=2))
|
f.write(json.dumps(data, indent=2).encode('utf-8'))
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user