mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: More unicode porting
This commit is contained in:
parent
6e0ec5b65c
commit
4ed839f595
@ -1,4 +1,4 @@
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
@ -166,11 +166,11 @@ class OptionParser(optparse.OptionParser):
|
||||
|
||||
def options_iter(self):
|
||||
for opt in self.option_list:
|
||||
if str(opt).strip():
|
||||
if native_string_type(opt).strip():
|
||||
yield opt
|
||||
for gr in self.option_groups:
|
||||
for opt in gr.option_list:
|
||||
if str(opt).strip():
|
||||
if native_string_type(opt).strip():
|
||||
yield opt
|
||||
|
||||
def option_by_dest(self, dest):
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python2
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
from __future__ import print_function
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
@ -49,4 +49,3 @@ def diff_hists(h1, h2):
|
||||
if h1[k] != h2[k]:
|
||||
print("%s: %d -> %d (%s%d)" % (
|
||||
k, h1[k], h2[k], h2[k] > h1[k] and "+" or "", h2[k] - h1[k]))
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env python2
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
|
||||
from __future__ import with_statement
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
@ -85,7 +84,7 @@ def get_image_path(path, data=False, allow_user_override=True):
|
||||
|
||||
|
||||
def js_name_to_path(name, ext='.coffee'):
|
||||
path = (u'/'.join(name.split('.'))) + ext
|
||||
path = ('/'.join(name.split('.'))) + ext
|
||||
d = os.path.dirname
|
||||
base = d(d(os.path.abspath(__file__)))
|
||||
return os.path.join(base, path)
|
||||
|
Loading…
x
Reference in New Issue
Block a user