mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-02 05:34:40 +01:00
...
This commit is contained in:
parent
73d13c3f6a
commit
3de3f3d4fb
3 changed files with 5 additions and 3 deletions
|
|
@ -18,6 +18,6 @@ def recipe_title_callback(raw):
|
|||
return eval(raw.decode('utf-8'))
|
||||
|
||||
vipy.session.add_content_browser('.r', ',r', 'Recipe',
|
||||
vipy.session.glob_based_iterator(os.path.join(project_dir, 'resources', 'recipes', '*.recipe')),
|
||||
vipy.session.glob_based_iterator(os.path.join(project_dir, 'recipes', '*.recipe')),
|
||||
vipy.session.regexp_based_matcher(r'title\s*=\s*(?P<title>.+)', 'title', recipe_title_callback))
|
||||
EOFPY
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
'dot-dot-dash': 'dotted',
|
||||
'outset': 'outset',
|
||||
'tripple': 'double',
|
||||
'triple': 'double',
|
||||
'thick-thin-small': 'solid',
|
||||
'thin-thick-small': 'solid',
|
||||
'thin-thick-thin-small': 'solid',
|
||||
|
|
|
|||
|
|
@ -251,12 +251,12 @@ def to_png(self):
|
|||
img.load(bmp)
|
||||
return img.export('png')
|
||||
|
||||
def wmf_unwrap(wmf_data):
|
||||
def wmf_unwrap(wmf_data, verbose=0):
|
||||
'''
|
||||
Return the largest embedded raster image in the WMF.
|
||||
The returned data is in PNG format.
|
||||
'''
|
||||
w = WMF()
|
||||
w = WMF(verbose=verbose)
|
||||
w(wmf_data)
|
||||
if not w.has_raster_image:
|
||||
raise ValueError('No raster image found in the WMF')
|
||||
|
|
@ -266,4 +266,5 @@ def wmf_unwrap(wmf_data):
|
|||
wmf = WMF(verbose=4)
|
||||
wmf(open(sys.argv[-1], 'rb'))
|
||||
open('/t/test.bmp', 'wb').write(wmf.bitmaps[0])
|
||||
open('/t/test.png', 'wb').write(wmf.to_png())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue