This commit is contained in:
Kovid Goyal 2008-08-04 12:59:12 -07:00
parent cd5e2bb849
commit e236efdad5
10 changed files with 466 additions and 291 deletions

View File

@ -21,7 +21,7 @@ DBUS = '/usr/lib/libdbus-1.so.3'
LIBMNG = '/usr/lib/libmng.so.1' LIBMNG = '/usr/lib/libmng.so.1'
LIBZ = '/lib/libz.so.1' LIBZ = '/lib/libz.so.1'
LIBBZ2 = '/lib/libbz2.so.1' LIBBZ2 = '/lib/libbz2.so.1'
LIBUSB = '/lib/libusb.so' LIBUSB = '/usr/lib/libusb.so'
LIBPOPPLER = '/usr/lib/libpoppler.so.3' LIBPOPPLER = '/usr/lib/libpoppler.so.3'

View File

@ -213,7 +213,6 @@ File ::D9A3AF75-5939-CB51-9F33-5A048911103E -type dir -name etc -parent 6CCF3F71
File ::A628E495-239B-DAF4-D858-BCE36CB41E6E -type dir -name imageformats -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::A628E495-239B-DAF4-D858-BCE36CB41E6E -type dir -name imageformats -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::0A533DB2-D494-A9ED-1334-DECC357BD426 -type dir -name codecs -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::0A533DB2-D494-A9ED-1334-DECC357BD426 -type dir -name codecs -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::0F47A44E-E347-1CD4-E89F-37B447C4A270 -type dir -name driver -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::0F47A44E-E347-1CD4-E89F-37B447C4A270 -type dir -name driver -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::19A416A8-8DDD-658B-A3D4-F89ABD02CFBB -type dir -name ImageMagick -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A146565C-D163-7F68-7C70-A6A336B32526 -type dir -name iconengines -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::A146565C-D163-7F68-7C70-A6A336B32526 -type dir -name iconengines -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::3245B06C-1C22-1A8A-5710-6D36651AAA70 -name etree.pyd -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::3245B06C-1C22-1A8A-5710-6D36651AAA70 -name etree.pyd -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B49A5610-13F6-FB5D-0673-DB47C6BB385D -name rtf-meta.exe.local -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::B49A5610-13F6-FB5D-0673-DB47C6BB385D -name rtf-meta.exe.local -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
@ -355,6 +354,144 @@ File ::293E6ABE-17C9-5E53-1B44-C27029C8C061 -name winutil.pyd -parent 36E8EEAC-F
File ::A5737158-18DF-7F20-2BDF-2DF615663891 -name lzx.pyd -parent 36E8EEAC-F54D-5DE9-02D8-ECDFEBB4B5E2 File ::A5737158-18DF-7F20-2BDF-2DF615663891 -name lzx.pyd -parent 36E8EEAC-F54D-5DE9-02D8-ECDFEBB4B5E2
File ::CA9E098C-2931-9781-1303-213C242F9A5E -name lit2oeb.exe -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::CA9E098C-2931-9781-1303-213C242F9A5E -name lit2oeb.exe -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::16B5A447-066C-C93E-F63D-8BC0D57CA544 -name lit2oeb.exe.local -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3 File ::16B5A447-066C-C93E-F63D-8BC0D57CA544 -name lit2oeb.exe.local -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::ABF342D2-82A9-2A20-BA97-54AD5BAF1A2A -name IM_MOD_RL_sfw_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::3877E295-C7EB-DF63-DA91-B9E2F9D8035A -name comic2lrf.exe.local -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F47345A3-6CE0-4F5B-9CAE-3F4A18D4AA5A -name IM_MOD_RL_rle_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::3A211C93-1B8B-A8AA-E240-A3287974DAB4 -name IM_MOD_RL_tiff_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F24F3123-05A3-B452-D12B-CE6C126501B1 -name CORE_RL_libxml_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::D7034E85-2733-DB61-DB49-C34B767B4B45 -name IM_MOD_RL_sun_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::21C1F4D3-487E-5FFF-C8CE-8E5FE779A786 -name IM_MOD_RL_msl_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::01EC7979-C9CB-696C-E8B3-F5945E1115BB -name IM_MOD_RL_jp2_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::0F86B693-D83A-DB03-8641-219FE766D980 -name CORE_RL_ttf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::DDCAEB76-7AC4-CA1A-0742-34B556592D2A -name IM_MOD_RL_exr_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::4D274537-6B6D-63F2-2615-E0CD279880A3 -name CORE_RL_Magick++_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A87CE00E-9F87-DBE3-DDA5-FC68D6D0731E -name IM_MOD_RL_dib_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::9114D530-B73B-CC7C-F6A6-655B7271AB35 -name IM_MOD_RL_preview_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::31EE0880-F1C8-94D6-4EDC-B09A576E0908 -name CORE_RL_magick_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::BEA2B769-1A54-4398-E8B4-5BE15637B705 -name IM_MOD_RL_svg_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::7E300AD4-7C03-5835-0DD6-E9FA8737585A -name IM_MOD_RL_mpeg_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::5E9901D8-BBB7-A17C-5A04-837C0ADF8CAE -name IM_MOD_RL_clipboard_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F13497D2-87C0-243D-916A-0A160F1A1896 -name IM_MOD_RL_png_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::DBD1CF95-1B01-9F5C-66D9-C7B4E1B44CC7 -name CORE_RL_bzlib_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::149C038D-9CD6-20C5-49C3-FC6948D0709D -name IM_MOD_RL_wmf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F77F5E54-1D54-F7D3-9520-BB1811C11AA6 -name IM_MOD_RL_txt_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::3545B38D-1BDF-B355-F779-4D83F292E2B6 -name IM_MOD_RL_viff_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::6E33F2FD-17BB-F096-4551-0E3B22924A4D -name IM_MOD_RL_ps2_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F4C810FF-4291-4491-0FA2-CFAD0BA690A9 -name type.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::02A3CD7D-743C-FAA8-9C20-3E8E59B8C2C2 -name IM_MOD_RL_ps3_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::697020D6-C5DA-A7DC-9454-1F9523D7748D -name IM_MOD_RL_dot_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::E9D0609E-2D12-A8C0-9B47-D09CACB4A3AF -name IM_MOD_RL_xwd_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F237A6C8-4037-B9E5-8D65-29A5A69CADFE -name IM_MOD_RL_fits_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::BDB45C50-E57A-357D-1D5A-392036227E6B -name IM_MOD_RL_histogram_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::5A6DBEB5-CD8A-4109-A04C-EF0436BC1CDC -name mfc71.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::FCC2A44D-D2F9-74DC-0C27-86F094E2C3E9 -name IM_MOD_RL_pnm_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::8E71473E-34AE-B7A3-B506-8A6AA622DAD7 -name IM_MOD_RL_ipl_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B680E84A-BA1C-5EA2-902E-095DD22A48F2 -name msvcp71.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::6AF09D1D-8889-8A87-9FD4-1471DBB1354C -name IM_MOD_RL_rgb_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::941B86E2-428A-3F4A-EB34-CBDBDDAD648C -name IM_MOD_RL_xbm_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::1613269D-8A63-C843-E862-9B80CC17E60F -name IM_MOD_RL_otb_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::334E3925-703D-DDCA-A079-C53DB06AA069 -name IM_MOD_RL_avi_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::23549B03-F856-3B90-C9C5-3B64A5910C7B -name CORE_RL_lcms_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::0E3F5727-D99A-44CD-35E0-4FDFBB95FCBC -name IM_MOD_RL_xpm_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::955B5799-4DB3-F422-589A-CDC20A82B6CB -name IM_MOD_RL_xcf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::D3AB494C-3218-0137-4399-3FB1662C05D3 -name IM_MOD_RL_emf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::1DEF5AF0-2376-539B-2A61-35B6ADC2F4BA -name log.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::D472B449-3644-C538-30EF-EC42E3B84C43 -name IM_MOD_RL_mtv_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::8B4E61F1-8FC2-7E65-4B94-3F19100DF58B -name CORE_RL_tiff_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B747FE2A-0054-6815-40D0-74F89FC8C757 -name IM_MOD_RL_dps_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::8B1660CC-7A97-96A2-1280-34554028CB9F -name IM_MOD_RL_dcm_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::21B7EBEC-30C8-F2E8-9D73-E4E6965EA856 -name locale.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::85087BFC-42D6-C583-586E-19CAD45E6A61 -name CORE_RL_wand_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::BE24EB64-E7BB-0E63-256E-DEDC2BBF1C2B -name IM_MOD_RL_ttf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::7693E752-1A81-F6F3-C55D-9E8D94D6E4DC -name IM_MOD_RL_dpx_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A1451D28-A06B-3F03-4DCA-884729C5A030 -name IM_MOD_RL_jpeg_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::3F0D8F7A-906F-8CAE-84D7-E3480A09D39D -name IM_MOD_RL_fax_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::CA8F1852-F5C1-86E8-31B9-8B1EFE837ADB -name IM_MOD_RL_avs_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::72370AAC-67CF-F570-2AA2-658E4C81C859 -name IM_MOD_RL_mvg_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A8265A1E-E9B5-A38F-9ACF-99669CAE1E9F -name IM_MOD_RL_tga_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A8A9A383-0364-515F-C1D8-F82C274D652B -name configure.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A2167661-AF2B-E15E-60DA-715F47E5AA30 -name IM_MOD_RL_uil_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::7608E2FF-1BF6-E18A-A884-244794BDA01B -name IM_MOD_RL_cut_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::772CA344-5EFD-78A0-3542-777F12356C8D -name Xext.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::37F8D85E-4EE9-80E5-A4A2-8F30444AD5CC -name IM_MOD_RL_scr_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::973011B9-D193-6D64-D4EB-D82B0C730379 -name IM_MOD_RL_map_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::9B9F088C-A20A-0C19-EF7D-52908A020D36 -name thresholds.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::831AAF1C-7CBE-CAD3-79A8-7430E8DE484E -name IM_MOD_RL_thumbnail_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::85236603-D71F-359C-B235-98C77809DDF1 -name IM_MOD_RL_mpc_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::94300805-117F-8337-A9BF-41E10D8AB437 -name IM_MOD_RL_cmyk_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::618A299D-4A28-E37A-D4BF-9209B594FAAF -name IM_MOD_RL_pcd_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::9F6572D8-6BE6-290B-D4A7-A0D4E4DBAC23 -name IM_MOD_RL_sct_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::942E63AC-F579-0D17-FF56-E2C8CC5DECA3 -name IM_MOD_RL_pict_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F68DE3F9-742C-D8EE-B2FC-FF9B37EED8F3 -name IM_MOD_RL_gradient_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::C460E29B-38EE-6FC0-757B-69563EFC3225 -name IM_MOD_RL_icon_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::AE00BD3D-734C-78F6-9078-C04749F4652A -name X11.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B70ED455-A480-56E3-3BDE-E06CDDB62C04 -name IM_MOD_RL_jbig_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::CFFC9A5D-2902-FD37-DBD1-6800C7C0C1AE -name magic.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::32DA3775-410C-0391-7ADB-B58028CC04E2 -name IM_MOD_RL_mat_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::AB64F079-1F8D-BE3A-731B-4B20ABD20289 -name IM_MOD_RL_meta_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::5A7F49E9-119A-FD9B-8186-0BE6B9DCF210 -name IM_MOD_RL_gray_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::D92B4157-F307-64A4-9AA5-C5AA1F138E1B -name IM_MOD_RL_pwp_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::BA631BF0-CB17-D0EC-FAA9-D7B426457DD3 -name IM_MOD_RL_fpx_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::9EA95108-72D5-13B5-2BD4-87CECED9B367 -name IM_MOD_RL_pcl_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::3111AC7E-2387-AD7D-253F-979195AC4EA1 -name english.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::14C1E910-6F5D-9540-7430-6B0B92311EB2 -name IM_MOD_RL_wpg_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::5D7050F4-177A-03A2-3DD1-A7DFC968E4ED -name IM_MOD_RL_pdb_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::5BACE29D-FAFD-E673-16A9-D22DCE6E0655 -name IM_MOD_RL_label_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::25F84452-26F7-4305-B405-B1D0C7D072D2 -name IM_MOD_RL_clip_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::807E6FF7-2D61-F308-BA2A-BD07A213078A -name IM_MOD_RL_pix_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::1A951976-DBCC-9FAE-190C-B24BBA38A97A -name colors.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::8608BB2C-6CDE-BBE7-39C6-DF83625D5BFB -name IM_MOD_RL_cin_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::CBE1DFDA-7E32-759F-346E-DD469B1CE1F0 -name IM_MOD_RL_bmp_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::7AD432A3-5146-4966-8C8E-85ACDCC8CA7A -name IM_MOD_RL_raw_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::9DC22033-0F40-26CC-9E09-959738F62855 -name IM_MOD_RL_cip_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A8C777EC-AEAA-6B3F-22A6-CEC28A2E5058 -name IM_MOD_RL_pdf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::ACA1A829-27AE-EFE7-4EDD-01D050A2E0A6 -name analyze.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::C883300E-0C2A-EAF6-D72E-81E8B99535E1 -name IM_MOD_RL_mpr_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A223D40F-EFC5-31E3-8E33-B90984080A3E -name CORE_RL_jpeg_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::DE197248-9758-A368-6058-B72C5169E0DD -name IM_MOD_RL_wbmp_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::FD15A9C0-5C14-11CA-AA27-D66D638E58FC -name IM_MOD_RL_stegano_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::6668D58B-E040-328B-4AF4-14C738C172BA -name CORE_RL_jp2_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::871E464B-4566-1FC2-55CB-B65AEB416413 -name IM_MOD_RL_yuv_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::7D7A8325-4C69-B9D3-C832-803BCF999B5C -name coder.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B0A3651D-19B1-09F1-8197-1E58ED2CC704 -name IM_MOD_RL_null_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::AB877243-6DAE-BF0C-70C2-F2D702B16231 -name IM_MOD_RL_pattern_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F571F366-1737-7E65-5441-DEBD166DE247 -name IM_MOD_RL_plasma_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::93F18CDE-B871-B2D4-3C0F-7C1B933E1ACB -name IM_MOD_RL_pcx_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::D1567C76-29D0-C200-9FC7-F7E1399D3011 -name CORE_RL_xlib_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::BEF1E1AC-9564-EA49-2B8F-1AAC9F6A7669 -name IM_MOD_RL_caption_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::2D14864E-6A39-FE03-4EA8-CCE7AC94487D -name comic2lrf.exe -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::27CD65A5-D5F9-C982-5096-65298417EE61 -name IM_MOD_RL_url_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A273E901-0B63-390B-D44A-7240491C6F59 -name IM_MOD_RL_info_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B39B27EC-325A-D222-01FC-F6B3BC92E99A -name IM_MOD_RL_hdf_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::BA634D39-716B-C895-73DD-2E5FA3CA2F9C -name CORE_RL_png_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::35560FB0-A7BD-54C7-C799-3EB2922BED2C -name delegates.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::FCE51670-E4AE-B813-6CFC-A7A9B627F72C -name IM_MOD_RL_matte_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::D10DB719-887D-4898-DAA8-8F1C6A4203B2 -name IM_MOD_RL_mono_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::78A66F97-ECEC-BFEC-75F2-2FA2087927C2 -name CORE_RL_jbig_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::FB74C41B-3F08-A9E8-B38D-C7C2FDFE9560 -name IM_MOD_RL_xtrn_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::ABC0A7AF-B14B-09BE-4756-76C8FE771517 -name IM_MOD_RL_vicar_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::F69B9AAD-EC2B-5EC7-5ED8-1395033DE0F5 -name IM_MOD_RL_psd_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::66CB1D9D-9995-F71C-155D-F1F4AA3B6D40 -name IM_MOD_RL_uyvy_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::4DB66BC3-4C48-C763-9BCA-9E831CA1FF0B -name IM_MOD_RL_art_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::EB24F574-4226-6404-B069-7B46C04988E0 -name IM_MOD_RL_ycbcr_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A9990A18-D6A1-AA14-1EDF-FC43D8AE0C7E -name type-ghostscript.xml -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::5B72558A-192B-76EB-1BA8-C4CBA43C6C05 -name IM_MOD_RL_x_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::A3937F85-1D17-D3DD-2DF5-FB9FE4A99ADB -name IM_MOD_RL_dng_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B2C41CC1-EB2D-F7E7-B22E-0C154C4C96C1 -name IM_MOD_RL_html_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::68A62902-7F48-6E7A-E5D3-1F58C895B409 -name IM_MOD_RL_tim_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::E5C83E45-56B1-9BD7-7676-07CABD98E0BF -name IM_MOD_RL_tile_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::084206D9-98DB-DE2A-19BC-FD17A191096D -name IM_MOD_RL_xc_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::43BE7C18-6369-E035-8390-2E13C8CBB33C -name CORE_RL_zlib_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::EFC4D6E5-4FC9-25D5-B308-8CC8C13EF3A1 -name IM_MOD_RL_gif_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::05A8646B-F100-4803-5916-4CBAC154BFE9 -name IM_MOD_RL_sgi_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::1B354F22-4795-739A-A47D-8F2D99DFB58A -name IM_MOD_RL_ept_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::B6725A29-1F09-2982-6BE1-29062A90F684 -name IM_MOD_RL_palm_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::445BD28F-0E70-B452-15B3-9E0C353CE345 -name IM_MOD_RL_ps_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::183A1789-2ED2-D555-AE4B-B7EBC97EB1D5 -name IM_MOD_RL_miff_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::69178142-77D3-D7C5-74C7-6F1597474123 -name IM_MOD_RL_vid_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::9D84C810-6DEC-5831-CFC6-AD0543D95881 -name IM_MOD_RL_rla_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::514DCC61-0BE9-6C5C-A970-170219D3A87E -name IM_MOD_RL_magick_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
File ::AAF94AED-250D-DE8D-14C5-FA8BC05AAE74 -name IM_MOD_RL_djvu_.dll -parent 6CCF3F71-74BB-ED69-D0E6-9F12348ABDD3
Component ::F6829AB7-9F66-4CEE-CA0E-21F54C6D3609 -setup Install -active Yes -platforms {AIX-ppc FreeBSD-4-x86 FreeBSD-x86 HPUX-hppa Linux-x86 Solaris-sparc Windows} -name Main -parent Components Component ::F6829AB7-9F66-4CEE-CA0E-21F54C6D3609 -setup Install -active Yes -platforms {AIX-ppc FreeBSD-4-x86 FreeBSD-x86 HPUX-hppa Linux-x86 Solaris-sparc Windows} -name Main -parent Components
SetupType ::D9ADE41C-B744-690C-2CED-CF826BF03D2E -setup Install -active Yes -platforms {AIX-ppc FreeBSD-4-x86 FreeBSD-x86 HPUX-hppa Linux-x86 Solaris-sparc Windows} -name Typical -parent SetupTypes SetupType ::D9ADE41C-B744-690C-2CED-CF826BF03D2E -setup Install -active Yes -platforms {AIX-ppc FreeBSD-4-x86 FreeBSD-x86 HPUX-hppa Linux-x86 Solaris-sparc Windows} -name Typical -parent SetupTypes

226
setup.py
View File

@ -48,112 +48,140 @@ main_functions = {
if __name__ == '__main__': if __name__ == '__main__':
from setuptools import setup, find_packages, Extension from setuptools import setup, find_packages, Extension
import subprocess, glob import subprocess, glob
if 'mydevelop' in sys.argv:
LAUNCHER = '''\
#!%(exe)s
import sys
sys.path.insert(0, %(ppath)s)
sys.argv[0] = %(basename)s
from %(module)s import %(func)s
%(func)s()
entry_points['console_scripts'].append('calibre_postinstall = calibre.linux:post_install') '''
ext_modules = [Extension('calibre.plugins.lzx', bindir = os.path.expanduser('~/bin')
sources=['src/calibre/utils/lzx/lzxmodule.c', def create_launcher(basename, module, func):
'src/calibre/utils/lzx/lzxd.c'], args = dict(exe=os.path.realpath(sys.executable),
include_dirs=['src/calibre/utils/lzx']), ppath=repr(os.path.abspath('src')),
Extension('calibre.plugins.msdes', basename=repr(basename),
sources=['src/calibre/utils/msdes/msdesmodule.c', module=module,
'src/calibre/utils/msdes/des.c'], func=func)
include_dirs=['src/calibre/utils/msdes'])] script = LAUNCHER%args
if iswindows: p = os.path.join(bindir, basename)
ext_modules.append(Extension('calibre.plugins.winutil', open(p, 'wb').write(script)
sources=['src/calibre/utils/windows/winutil.c'], subprocess.check_call('chmod +x '+p, shell=True)
libraries=['shell32', 'setupapi'], for x in ('console', 'gui'):
include_dirs=['C:/WinDDK/6001.18001/inc/api/']) for i in range(len(basenames[x])):
) create_launcher(basenames[x][i], main_modules[x][i], main_functions[x][i])
if isosx: create_launcher('calibre_postinstall', 'calibre.linux', 'post_install')
ext_modules.append(Extension('calibre.plugins.usbobserver', subprocess.check_call('python setup.py build', shell=True)
sources=['src/calibre/devices/usbobserver/usbobserver.c']) subprocess.check_call('sudo %s/calibre_postinstall'%bindir, shell=True)
) else:
def build_PyQt_extension(path): entry_points['console_scripts'].append('calibre_postinstall = calibre.linux:post_install')
pro = glob.glob(os.path.join(path, '*.pro'))[0] ext_modules = [Extension('calibre.plugins.lzx',
raw = open(pro).read() sources=['src/calibre/utils/lzx/lzxmodule.c',
base = qtplugin = re.search(r'TARGET\s*=\s*(.*)', raw).group(1) 'src/calibre/utils/lzx/lzxd.c'],
ver = re.search(r'VERSION\s*=\s*(\d+)', raw).group(1) include_dirs=['src/calibre/utils/lzx']),
cwd = os.getcwd() Extension('calibre.plugins.msdes',
os.chdir(os.path.dirname(pro)) sources=['src/calibre/utils/msdes/msdesmodule.c',
try: 'src/calibre/utils/msdes/des.c'],
if not os.path.exists('.build'): include_dirs=['src/calibre/utils/msdes'])]
os.mkdir('.build') if iswindows:
os.chdir('.build') ext_modules.append(Extension('calibre.plugins.winutil',
subprocess.check_call(( (os.path.expanduser('~/qt/bin/qmake') if isosx else 'qmake'), '..'+os.sep+os.path.basename(pro))) sources=['src/calibre/utils/windows/winutil.c'],
subprocess.check_call(['mingw32-make' if iswindows else 'make']) libraries=['shell32', 'setupapi'],
os.chdir(os.path.join('..', 'PyQt')) include_dirs=['C:/WinDDK/6001.18001/inc/api/'])
if not os.path.exists('.build'): )
os.mkdir('.build') if isosx:
os.chdir('.build') ext_modules.append(Extension('calibre.plugins.usbobserver',
python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python' if isosx else 'python' sources=['src/calibre/devices/usbobserver/usbobserver.c'])
subprocess.check_call([python, '..'+os.sep+'configure.py']) )
subprocess.check_call(['mingw32-make' if iswindows else 'make'])
ext = '.pyd' if iswindows else '.so'
plugin = glob.glob(base+ext)[0]
shutil.copyfile(plugin, os.path.join(cwd, 'src', 'calibre', 'plugins', plugin))
finally:
os.chdir(cwd)
if islinux or isosx:
for f in glob.glob(os.path.join('src', 'calibre', 'plugins', '*')):
try:
os.readlink(f)
os.unlink(f)
except:
continue
for path in [(os.path.join('src', 'calibre', 'gui2', 'pictureflow'))]: def build_PyQt_extension(path):
build_PyQt_extension(path) pro = glob.glob(os.path.join(path, '*.pro'))[0]
raw = open(pro).read()
base = qtplugin = re.search(r'TARGET\s*=\s*(.*)', raw).group(1)
ver = re.search(r'VERSION\s*=\s*(\d+)', raw).group(1)
cwd = os.getcwd()
os.chdir(os.path.dirname(pro))
try:
if not os.path.exists('.build'):
os.mkdir('.build')
os.chdir('.build')
subprocess.check_call(( (os.path.expanduser('~/qt/bin/qmake') if isosx else 'qmake'), '..'+os.sep+os.path.basename(pro)))
subprocess.check_call(['mingw32-make' if iswindows else 'make'])
os.chdir(os.path.join('..', 'PyQt'))
if not os.path.exists('.build'):
os.mkdir('.build')
os.chdir('.build')
python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python' if isosx else 'python'
subprocess.check_call([python, '..'+os.sep+'configure.py'])
subprocess.check_call(['mingw32-make' if iswindows else 'make'])
ext = '.pyd' if iswindows else '.so'
plugin = glob.glob(base+ext)[0]
shutil.copyfile(plugin, os.path.join(cwd, 'src', 'calibre', 'plugins', plugin))
finally:
os.chdir(cwd)
if islinux or isosx:
for f in glob.glob(os.path.join('src', 'calibre', 'plugins', '*')):
try:
os.readlink(f)
os.unlink(f)
except:
continue
setup( for path in [(os.path.join('src', 'calibre', 'gui2', 'pictureflow'))]:
name=APPNAME, build_PyQt_extension(path)
packages = find_packages('src'),
package_dir = { '' : 'src' },
version=VERSION,
author='Kovid Goyal',
author_email='kovid@kovidgoyal.net',
url = 'http://%s.kovidgoyal.net'%APPNAME,
package_data = {'calibre':['plugins/*']},
include_package_data=True,
entry_points = entry_points,
zip_safe = False,
options = { 'bdist_egg' : {'exclude_source_files': True,}, },
ext_modules=ext_modules,
description =
'''
E-book management application.
''',
long_description =
'''
%s is an e-book library manager. It can view, convert and catalog e-books in most of the major e-book formats. It can also talk to a few e-book reader devices. It can go out to the internet and fetch metadata for your books. It can download newspapers and convert them into e-books for convenient reading. It is cross platform, running on Linux, Windows and OS X.
For screenshots: https://%s.kovidgoyal.net/wiki/Screenshots setup(
name=APPNAME,
packages = find_packages('src'),
package_dir = { '' : 'src' },
version=VERSION,
author='Kovid Goyal',
author_email='kovid@kovidgoyal.net',
url = 'http://%s.kovidgoyal.net'%APPNAME,
package_data = {'calibre':['plugins/*']},
include_package_data=True,
entry_points = entry_points,
zip_safe = False,
options = { 'bdist_egg' : {'exclude_source_files': True,}, },
ext_modules=ext_modules,
description =
'''
E-book management application.
''',
long_description =
'''
%s is an e-book library manager. It can view, convert and catalog e-books in most of the major e-book formats. It can also talk to a few e-book reader devices. It can go out to the internet and fetch metadata for your books. It can download newspapers and convert them into e-books for convenient reading. It is cross platform, running on Linux, Windows and OS X.
For installation/usage instructions please see For screenshots: https://%s.kovidgoyal.net/wiki/Screenshots
http://%s.kovidgoyal.net
For source code access: For installation/usage instructions please see
bzr branch http://bzr.kovidgoyal.net/code/%s/trunk %s http://%s.kovidgoyal.net
To update your copy of the source code: For source code access:
bzr merge bzr branch http://bzr.kovidgoyal.net/code/%s/trunk %s
'''%(APPNAME, APPNAME, APPNAME, APPNAME, APPNAME), To update your copy of the source code:
license = 'GPL', bzr merge
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: X11 Applications :: Qt',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Hardware :: Hardware Drivers'
]
)
if 'develop' in ' '.join(sys.argv) and islinux: '''%(APPNAME, APPNAME, APPNAME, APPNAME, APPNAME),
subprocess.check_call('calibre_postinstall', shell=True) license = 'GPL',
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: X11 Applications :: Qt',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Hardware :: Hardware Drivers'
]
)
if 'develop' in ' '.join(sys.argv) and islinux:
subprocess.check_call('calibre_postinstall', shell=True)

View File

@ -7,7 +7,7 @@ Embedded console for debugging.
''' '''
import sys, os, re import sys, os, re
from calibre import OptionParser, iswindows from calibre import OptionParser, iswindows, isosx
from calibre.libunzip import update from calibre.libunzip import update
def option_parser(): def option_parser():
@ -30,13 +30,18 @@ def update_zipfile(zipfile, mod, path):
pat = re.compile(mod.replace('.', '/')+r'\.py[co]*') pat = re.compile(mod.replace('.', '/')+r'\.py[co]*')
name = mod.replace('.', '/') + os.path.splitext(path)[-1] name = mod.replace('.', '/') + os.path.splitext(path)[-1]
update(zipfile, [pat], [path], [name]) update(zipfile, [pat], [path], [name])
def update_module(mod, path): def update_module(mod, path):
if not hasattr(sys, 'frozen'): if not hasattr(sys, 'frozen'):
raise RuntimeError('Modules can only be updated in frozen installs.') raise RuntimeError('Modules can only be updated in frozen installs.')
if True or iswindows: zp = None
if iswindows:
zp = os.path.join(os.path.dirname(sys.executable), 'library.zip') zp = os.path.join(os.path.dirname(sys.executable), 'library.zip')
elif isosx:
zp = os.path.join(os.path.dirname(getattr(sys, 'frameworks_dir')),
'Resources', 'lib', 'python2.5', 'site-packages.zip')
if zp is not None:
update_zipfile(zp, mod, path) update_zipfile(zp, mod, path)
else: else:
raise ValueError('Updating modules is not supported on this platform.') raise ValueError('Updating modules is not supported on this platform.')
@ -53,10 +58,10 @@ def main(args=sys.argv):
from IPython.Shell import IPShellEmbed from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed() ipshell = IPShellEmbed()
ipshell() ipshell()
return 0 return 0
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())

View File

@ -11,7 +11,7 @@ from optparse import OptionParser
from calibre import __version__, iswindows, __appname__ from calibre import __version__, iswindows, __appname__
from calibre.devices.errors import PathError from calibre.devices.errors import PathError
from calibre.terminfo import TerminalController from calibre.utils.terminfo import TerminalController
from calibre.devices.errors import ArgumentError, DeviceError, DeviceLocked from calibre.devices.errors import ArgumentError, DeviceError, DeviceLocked
from calibre.devices import devices from calibre.devices import devices
from calibre.devices.scanner import DeviceScanner from calibre.devices.scanner import DeviceScanner

View File

@ -16,14 +16,14 @@ if os.environ.has_key('DESTDIR'):
entry_points = { entry_points = {
'console_scripts': [ \ 'console_scripts': [ \
'prs500 = calibre.devices.prs500.cli.main:main', 'prs500 = calibre.devices.prs500.cli.main:main',
'lrf-meta = calibre.ebooks.lrf.meta:main', 'lrf-meta = calibre.ebooks.lrf.meta:main',
'rtf-meta = calibre.ebooks.metadata.rtf:main', 'rtf-meta = calibre.ebooks.metadata.rtf:main',
'pdf-meta = calibre.ebooks.metadata.pdf:main', 'pdf-meta = calibre.ebooks.metadata.pdf:main',
'lit-meta = calibre.ebooks.metadata.lit:main', 'lit-meta = calibre.ebooks.metadata.lit:main',
'opf-meta = calibre.ebooks.metadata.opf:main', 'opf-meta = calibre.ebooks.metadata.opf:main',
'epub-meta = calibre.ebooks.metadata.epub:main', 'epub-meta = calibre.ebooks.metadata.epub:main',
'txt2lrf = calibre.ebooks.lrf.txt.convert_from:main', 'txt2lrf = calibre.ebooks.lrf.txt.convert_from:main',
'html2lrf = calibre.ebooks.lrf.html.convert_from:main', 'html2lrf = calibre.ebooks.lrf.html.convert_from:main',
'markdown-calibre = calibre.ebooks.markdown.markdown:main', 'markdown-calibre = calibre.ebooks.markdown.markdown:main',
'lit2lrf = calibre.ebooks.lrf.lit.convert_from:main', 'lit2lrf = calibre.ebooks.lrf.lit.convert_from:main',
@ -51,8 +51,8 @@ entry_points = {
'calibredb = calibre.library.cli:main', 'calibredb = calibre.library.cli:main',
'calibre-fontconfig = calibre.utils.fontconfig:main', 'calibre-fontconfig = calibre.utils.fontconfig:main',
'calibre-parallel = calibre.parallel:main', 'calibre-parallel = calibre.parallel:main',
], ],
'gui_scripts' : [ 'gui_scripts' : [
__appname__+' = calibre.gui2.main:main', __appname__+' = calibre.gui2.main:main',
'lrfviewer = calibre.gui2.lrf_renderer.main:main', 'lrfviewer = calibre.gui2.lrf_renderer.main:main',
], ],
@ -60,7 +60,7 @@ entry_points = {
def options(option_parser): def options(option_parser):
parser = option_parser() parser = option_parser()
options = parser.option_list options = parser.option_list
for group in parser.option_groups: for group in parser.option_groups:
options += group.option_list options += group.option_list
@ -72,7 +72,7 @@ def options(option_parser):
def opts_and_words(name, op, words): def opts_and_words(name, op, words):
opts = '|'.join(options(op)) opts = '|'.join(options(op))
words = '|'.join([w.replace("'", "\\'") for w in words]) words = '|'.join([w.replace("'", "\\'") for w in words])
return '_'+name+'()'+\ return '_'+name+'()'+\
''' '''
{ {
@ -82,13 +82,13 @@ def opts_and_words(name, op, words):
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
opts="%s" opts="%s"
words="%s" words="%s"
case "${cur}" in case "${cur}" in
-* ) -* )
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
COMPREPLY=( $( echo ${COMPREPLY[@]} | sed 's/ /\\\\ /g' | tr '\\n' '\\t' ) ) COMPREPLY=( $( echo ${COMPREPLY[@]} | sed 's/ /\\\\ /g' | tr '\\n' '\\t' ) )
return 0 return 0
;; ;;
* ) * )
COMPREPLY=( $(compgen -W "${words}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )
COMPREPLY=( $( echo ${COMPREPLY[@]} | sed 's/ /\\\\ /g' | tr '\\n' '\\t' ) ) COMPREPLY=( $( echo ${COMPREPLY[@]} | sed 's/ /\\\\ /g' | tr '\\n' '\\t' ) )
@ -167,16 +167,16 @@ def setup_completion(fatal_errors):
from calibre.ebooks.lrf.feeds.convert_from import option_parser as feeds2lrf from calibre.ebooks.lrf.feeds.convert_from import option_parser as feeds2lrf
from calibre.ebooks.metadata.epub import option_parser as epub_meta from calibre.ebooks.metadata.epub import option_parser as epub_meta
from calibre.ebooks.lrf.comic.convert_from import option_parser as comicop from calibre.ebooks.lrf.comic.convert_from import option_parser as comicop
f = open_file('/etc/bash_completion.d/libprs500') f = open_file('/etc/bash_completion.d/libprs500')
f.close() f.close()
os.remove(f.name) os.remove(f.name)
manifest = [] manifest = []
f = open_file('/etc/bash_completion.d/calibre') f = open_file('/etc/bash_completion.d/calibre')
manifest.append(f.name) manifest.append(f.name)
f.write('# calibre Bash Shell Completion\n') f.write('# calibre Bash Shell Completion\n')
f.write(opts_and_exts('html2lrf', htmlop, f.write(opts_and_exts('html2lrf', htmlop,
['htm', 'html', 'xhtml', 'xhtm', 'rar', 'zip', 'php'])) ['htm', 'html', 'xhtml', 'xhtm', 'rar', 'zip', 'php']))
f.write(opts_and_exts('txt2lrf', txtop, ['txt'])) f.write(opts_and_exts('txt2lrf', txtop, ['txt']))
f.write(opts_and_exts('lit2lrf', htmlop, ['lit'])) f.write(opts_and_exts('lit2lrf', htmlop, ['lit']))
@ -185,8 +185,8 @@ def setup_completion(fatal_errors):
f.write(opts_and_exts('mobi2lrf', htmlop, ['mobi', 'prc'])) f.write(opts_and_exts('mobi2lrf', htmlop, ['mobi', 'prc']))
f.write(opts_and_exts('fb22lrf', htmlop, ['fb2'])) f.write(opts_and_exts('fb22lrf', htmlop, ['fb2']))
f.write(opts_and_exts('pdf2lrf', htmlop, ['pdf'])) f.write(opts_and_exts('pdf2lrf', htmlop, ['pdf']))
f.write(opts_and_exts('any2lrf', htmlop, f.write(opts_and_exts('any2lrf', htmlop,
['epub', 'htm', 'html', 'xhtml', 'xhtm', 'rar', 'zip', ['epub', 'htm', 'html', 'xhtml', 'xhtm', 'rar', 'zip',
'txt', 'lit', 'rtf', 'pdf', 'prc', 'mobi', 'fb2'])) 'txt', 'lit', 'rtf', 'pdf', 'prc', 'mobi', 'fb2']))
f.write(opts_and_exts('lrf2lrs', lrf2lrsop, ['lrf'])) f.write(opts_and_exts('lrf2lrs', lrf2lrsop, ['lrf']))
f.write(opts_and_exts('lrf-meta', metaop, ['lrf'])) f.write(opts_and_exts('lrf-meta', metaop, ['lrf']))
@ -228,17 +228,17 @@ _prs500_ls()
prefix="${prefix}/" prefix="${prefix}/"
fi fi
echo $(compgen -P "${prefix}" -W "${listing}" "${pattern}") echo $(compgen -P "${prefix}" -W "${listing}" "${pattern}")
} }
_prs500() _prs500()
{ {
local cur prev local cur prev
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
COMPREPLY=() COMPREPLY=()
case "${prev}" in case "${prev}" in
ls|rm|mkdir|touch|cat ) ls|rm|mkdir|touch|cat )
COMPREPLY=( $(_prs500_ls "${cur}") ) COMPREPLY=( $(_prs500_ls "${cur}") )
return 0 return 0
;; ;;
@ -284,7 +284,7 @@ complete -o nospace -F _prs500 prs500
import traceback import traceback
traceback.print_exc() traceback.print_exc()
return manifest return manifest
def setup_udev_rules(group_file, reload, fatal_errors): def setup_udev_rules(group_file, reload, fatal_errors):
print 'Trying to setup udev rules...' print 'Trying to setup udev rules...'
manifest = [] manifest = []
@ -325,7 +325,7 @@ def setup_udev_rules(group_file, reload, fatal_errors):
break break
if not called and os.access('/etc/rc.d/rc.hald', os.X_OK): if not called and os.access('/etc/rc.d/rc.hald', os.X_OK):
call(('/etc/rc.d/rc.hald', 'restart')) call(('/etc/rc.d/rc.hald', 'restart'))
try: try:
check_call('udevadm control --reload_rules', shell=True) check_call('udevadm control --reload_rules', shell=True)
except: except:
@ -351,9 +351,9 @@ def option_parser():
help='File from which to read group information. Default: %default') help='File from which to read group information. Default: %default')
parser.add_option('--dont-check-root', action='store_true', default=False, dest='no_root', parser.add_option('--dont-check-root', action='store_true', default=False, dest='no_root',
help='If set, do not check if we are root.') help='If set, do not check if we are root.')
parser.add_option('--make-errors-fatal', action='store_true', default=False, parser.add_option('--make-errors-fatal', action='store_true', default=False,
dest='fatal_errors', help='If set die on errors.') dest='fatal_errors', help='If set die on errors.')
parser.add_option('--save-manifest-to', default=None, parser.add_option('--save-manifest-to', default=None,
help='Save a manifest of all installed files to the specified location') help='Save a manifest of all installed files to the specified location')
return parser return parser
@ -366,12 +366,14 @@ def install_man_pages(fatal_errors):
f.write('[see also]\nhttp://%s.kovidgoyal.net\n'%__appname__) f.write('[see also]\nhttp://%s.kovidgoyal.net\n'%__appname__)
f.close() f.close()
manifest = [] manifest = []
os.environ['PATH'] += ':'+os.path.expanduser('~/bin')
for src in entry_points['console_scripts']: for src in entry_points['console_scripts']:
prog = src[:src.index('=')].strip() prog = src[:src.index('=')].strip()
if prog in ('prs500', 'pdf-meta', 'epub-meta', 'lit-meta', if prog in ('prs500', 'pdf-meta', 'epub-meta', 'lit-meta',
'markdown-calibre', 'calibre-debug', 'fb2-meta', 'markdown-calibre', 'calibre-debug', 'fb2-meta',
'calibre-fontconfig', 'calibre-parallel'): 'calibre-fontconfig', 'calibre-parallel'):
continue continue
help2man = ('help2man', prog, '--name', 'part of %s'%__appname__, help2man = ('help2man', prog, '--name', 'part of %s'%__appname__,
'--section', '1', '--no-info', '--include', '--section', '1', '--no-info', '--include',
f.name, '--manual', __appname__) f.name, '--manual', __appname__)
@ -390,18 +392,18 @@ def install_man_pages(fatal_errors):
print 'Unable to create MAN page for', prog print 'Unable to create MAN page for', prog
continue continue
f2 = open_file(manfile) f2 = open_file(manfile)
manifest.append(f2.name) manifest.append(f2.name)
f2.write(compress(raw)) f2.write(compress(raw))
return manifest return manifest
def post_install(): def post_install():
parser = option_parser() parser = option_parser()
opts = parser.parse_args()[0] opts = parser.parse_args()[0]
if not opts.no_root and os.geteuid() != 0: if not opts.no_root and os.geteuid() != 0:
print >> sys.stderr, 'You must be root to run this command.' print >> sys.stderr, 'You must be root to run this command.'
sys.exit(1) sys.exit(1)
global use_destdir global use_destdir
use_destdir = opts.destdir use_destdir = opts.destdir
manifest = [] manifest = []
@ -409,18 +411,18 @@ def post_install():
manifest += setup_completion(opts.fatal_errors) manifest += setup_completion(opts.fatal_errors)
setup_desktop_integration(opts.fatal_errors) setup_desktop_integration(opts.fatal_errors)
manifest += install_man_pages(opts.fatal_errors) manifest += install_man_pages(opts.fatal_errors)
try: try:
from PyQt4 import Qt from PyQt4 import Qt
if Qt.PYQT_VERSION < int('0x40402', 16): if Qt.PYQT_VERSION < int('0x40402', 16):
print 'WARNING: You need PyQt >= 4.4.2 for the GUI. You have', Qt.PYQT_VERSION_STR, '\nYou may experience crashes or other strange behavior.' print 'WARNING: You need PyQt >= 4.4.2 for the GUI. You have', Qt.PYQT_VERSION_STR, '\nYou may experience crashes or other strange behavior.'
except ImportError: except ImportError:
print 'WARNING: You do not have PyQt4 installed. The GUI will not work.' print 'WARNING: You do not have PyQt4 installed. The GUI will not work.'
if opts.save_manifest_to: if opts.save_manifest_to:
open(opts.save_manifest_to, 'wb').write('\n'.join(manifest)+'\n') open(opts.save_manifest_to, 'wb').write('\n'.join(manifest)+'\n')
VIEWER = '''\ VIEWER = '''\
[Desktop Entry] [Desktop Entry]
Version=%s Version=%s
@ -478,10 +480,10 @@ def setup_desktop_integration(fatal_errors):
from PyQt4.QtCore import QFile from PyQt4.QtCore import QFile
from calibre.gui2 import images_rc # Load images from calibre.gui2 import images_rc # Load images
from tempfile import mkdtemp from tempfile import mkdtemp
print 'Setting up desktop integration...' print 'Setting up desktop integration...'
tdir = mkdtemp() tdir = mkdtemp()
cwd = os.getcwdu() cwd = os.getcwdu()
try: try:
@ -493,7 +495,7 @@ def setup_desktop_integration(fatal_errors):
check_call('xdg-icon-resource install --size 128 calibre-gui.png calibre-gui', shell=True) check_call('xdg-icon-resource install --size 128 calibre-gui.png calibre-gui', shell=True)
render_svg(QFile(':/images/viewer.svg'), os.path.join(tdir, 'calibre-viewer.png')) render_svg(QFile(':/images/viewer.svg'), os.path.join(tdir, 'calibre-viewer.png'))
check_call('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True) check_call('xdg-icon-resource install --size 128 calibre-viewer.png calibre-viewer', shell=True)
f = open('calibre-lrfviewer.desktop', 'wb') f = open('calibre-lrfviewer.desktop', 'wb')
f.write(VIEWER) f.write(VIEWER)
f.close() f.close()
@ -513,11 +515,11 @@ def setup_desktop_integration(fatal_errors):
raise raise
print >>sys.stderr, 'Could not setup desktop integration. Error:' print >>sys.stderr, 'Could not setup desktop integration. Error:'
print err print err
if __name__ == '__main__': if __name__ == '__main__':
post_install() post_install()

View File

@ -142,7 +142,7 @@ If it still wont launch, start a command prompt (press the windows key and R; th
calibre-debug -c "from calibre.gui2.main import main; main()" calibre-debug -c "from calibre.gui2.main import main; main()"
Post any output you see in a help message on the `Forums <http://calibre.kovidgoyal.net/discussion`_. Post any output you see in a help message on the `Forums <http://calibre.kovidgoyal.net/discussion>`_.
I want some feature added to |app|. What can I do? I want some feature added to |app|. What can I do?

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -13,7 +13,7 @@ has the environment variable :envvar:`CALIBRE_WORKER` defined.
The worker control protocol has two modes of operation. In the first mode, the The worker control protocol has two modes of operation. In the first mode, the
worker process listens for commands from the controller process. The controller worker process listens for commands from the controller process. The controller
process can either hand off a job to the worker or tell the worker to die. process can either hand off a job to the worker or tell the worker to die.
Once a job is handed off to the worker, the protocol enters the second mode, where Once a job is handed off to the worker, the protocol enters the second mode, where
the controller listens for messages from the worker. The worker can send progress updates the controller listens for messages from the worker. The worker can send progress updates
as well as console output (i.e. text that would normally have been written to stdout as well as console output (i.e. text that would normally have been written to stdout
@ -22,7 +22,7 @@ returns the result (or exception) to the controller and the protocol reverts to
In the second mode, the controller can also send the worker STOP messages, in which case In the second mode, the controller can also send the worker STOP messages, in which case
the worker interrupts the job and dies. The sending of progress and console output messages the worker interrupts the job and dies. The sending of progress and console output messages
is buffered and asynchronous to prevent the job from being IO bound. is buffered and asynchronous to prevent the job from being IO bound.
''' '''
import sys, os, gc, cPickle, traceback, atexit, cStringIO, time, signal, \ import sys, os, gc, cPickle, traceback, atexit, cStringIO, time, signal, \
subprocess, socket, collections, binascii, re, thread, tempfile subprocess, socket, collections, binascii, re, thread, tempfile
@ -37,20 +37,20 @@ DEBUG = False
#: A mapping from job names to functions that perform the jobs #: A mapping from job names to functions that perform the jobs
PARALLEL_FUNCS = { PARALLEL_FUNCS = {
'any2lrf' : 'any2lrf' :
('calibre.ebooks.lrf.any.convert_from', 'main', dict(gui_mode=True), None), ('calibre.ebooks.lrf.any.convert_from', 'main', dict(gui_mode=True), None),
'lrfviewer' : 'lrfviewer' :
('calibre.gui2.lrf_renderer.main', 'main', {}, None), ('calibre.gui2.lrf_renderer.main', 'main', {}, None),
'feeds2lrf' : 'feeds2lrf' :
('calibre.ebooks.lrf.feeds.convert_from', 'main', {}, 'notification'), ('calibre.ebooks.lrf.feeds.convert_from', 'main', {}, 'notification'),
'render_table' : 'render_table' :
('calibre.ebooks.lrf.html.table_as_image', 'do_render', {}, None), ('calibre.ebooks.lrf.html.table_as_image', 'do_render', {}, None),
'comic2lrf' : 'comic2lrf' :
('calibre.ebooks.lrf.comic.convert_from', 'do_convert', {}, 'notification'), ('calibre.ebooks.lrf.comic.convert_from', 'do_convert', {}, 'notification'),
} }
@ -67,20 +67,20 @@ class WorkerStatus(object):
''' '''
A platform independent class to control child processes. Provides the A platform independent class to control child processes. Provides the
methods: methods:
.. method:: WorkerStatus.is_alive() .. method:: WorkerStatus.is_alive()
Return True is the child process is alive (i.e. it hasn't exited and returned a return code). Return True is the child process is alive (i.e. it hasn't exited and returned a return code).
.. method:: WorkerStatus.returncode() .. method:: WorkerStatus.returncode()
Wait for the child process to exit and return its return code (blocks until child returns). Wait for the child process to exit and return its return code (blocks until child returns).
.. method:: WorkerStatus.kill() .. method:: WorkerStatus.kill()
Forcibly terminates child process using operating system specific semantics. Forcibly terminates child process using operating system specific semantics.
''' '''
def __init__(self, obj): def __init__(self, obj):
''' '''
`obj`: On windows a process handle, on unix a subprocess.Popen object. `obj`: On windows a process handle, on unix a subprocess.Popen object.
@ -92,22 +92,22 @@ class WorkerStatus(object):
ext = 'windows' if iswindows else 'unix' ext = 'windows' if iswindows else 'unix'
for func in ('is_alive', 'returncode', 'kill'): for func in ('is_alive', 'returncode', 'kill'):
setattr(self, func, getattr(self, func+'_'+ext)) setattr(self, func, getattr(self, func+'_'+ext))
def is_alive_unix(self): def is_alive_unix(self):
return self.obj.poll() == None return self.obj.poll() == None
def returncode_unix(self): def returncode_unix(self):
return self.obj.wait() return self.obj.wait()
def kill_unix(self): def kill_unix(self):
os.kill(self.obj.pid, self.signal.SIGKILL) os.kill(self.obj.pid, self.signal.SIGKILL)
def is_alive_windows(self): def is_alive_windows(self):
return win32event.WaitForSingleObject(self.obj, 0) != win32event.WAIT_OBJECT_0 return win32event.WaitForSingleObject(self.obj, 0) != win32event.WAIT_OBJECT_0
def returncode_windows(self): def returncode_windows(self):
return win32process.GetExitCodeProcess(self.obj) return win32process.GetExitCodeProcess(self.obj)
def kill_windows(self, returncode=-1): def kill_windows(self, returncode=-1):
self.win32process.TerminateProcess(self.obj, returncode) self.win32process.TerminateProcess(self.obj, returncode)
@ -115,16 +115,16 @@ class WorkerMother(object):
''' '''
Platform independent object for launching child processes. All processes Platform independent object for launching child processes. All processes
have the environment variable :envvar:`CALIBRE_WORKER` set. have the environment variable :envvar:`CALIBRE_WORKER` set.
..method:: WorkerMother.spawn_free_spirit(arg) ..method:: WorkerMother.spawn_free_spirit(arg)
Launch a non monitored process with argument `arg`. Launch a non monitored process with argument `arg`.
..method:: WorkerMother.spawn_worker(arg) ..method:: WorkerMother.spawn_worker(arg)
Launch a monitored and controllable process with argument `arg`. Launch a monitored and controllable process with argument `arg`.
''' '''
def __init__(self): def __init__(self):
ext = 'windows' if iswindows else 'osx' if isosx else 'linux' ext = 'windows' if iswindows else 'osx' if isosx else 'linux'
self.os = os # Needed incase cleanup called when interpreter is shutting down self.os = os # Needed incase cleanup called when interpreter is shutting down
@ -140,26 +140,28 @@ class WorkerMother(object):
contents = os.path.dirname(fd) contents = os.path.dirname(fd)
resources = os.path.join(contents, 'Resources') resources = os.path.join(contents, 'Resources')
sp = os.path.join(resources, 'lib', 'python'+sys.version[:3], 'site-packages.zip') sp = os.path.join(resources, 'lib', 'python'+sys.version[:3], 'site-packages.zip')
self.prefix += 'import sys; sys.frameworks_dir = "%s"; sys.frozen = "macosx_app"; '%fd self.prefix += 'import sys; sys.frameworks_dir = "%s"; sys.frozen = "macosx_app"; '%fd
self.prefix += 'sys.path.insert(0, %s); '%repr(sp) self.prefix += 'sys.path.insert(0, %s); '%repr(sp)
if fd not in os.environ['PATH']: if fd not in os.environ['PATH']:
self.env['PATH'] = os.environ['PATH']+':'+fd self.env['PATH'] = os.environ['PATH']+':'+fd
self.env['PYTHONHOME'] = resources self.env['PYTHONHOME'] = resources
self.env['MAGICK_HOME'] = os.path.join(getattr(sys, 'frameworks_dir'), 'ImageMagick')
self.env['DYLD_LIBRARY_PATH'] = os.path.join(getattr(sys, 'frameworks_dir'), 'ImageMagick', 'lib')
else: else:
self.executable = os.path.join(getattr(sys, 'frozen_path'), 'calibre-parallel') \ self.executable = os.path.join(getattr(sys, 'frozen_path'), 'calibre-parallel') \
if isfrozen else 'calibre-parallel' if isfrozen else 'calibre-parallel'
if isfrozen: if isfrozen:
self.env['LD_LIBRARY_PATH'] = getattr(sys, 'frozen_path') + ':' + os.environ.get('LD_LIBRARY_PATH', '') self.env['LD_LIBRARY_PATH'] = getattr(sys, 'frozen_path') + ':' + os.environ.get('LD_LIBRARY_PATH', '')
self.spawn_worker_windows = lambda arg : self.spawn_free_spirit_windows(arg, type='worker') self.spawn_worker_windows = lambda arg : self.spawn_free_spirit_windows(arg, type='worker')
self.spawn_worker_linux = lambda arg : self.spawn_free_spirit_linux(arg, type='worker') self.spawn_worker_linux = lambda arg : self.spawn_free_spirit_linux(arg, type='worker')
self.spawn_worker_osx = lambda arg : self.spawn_free_spirit_osx(arg, type='worker') self.spawn_worker_osx = lambda arg : self.spawn_free_spirit_osx(arg, type='worker')
for func in ('spawn_free_spirit', 'spawn_worker'): for func in ('spawn_free_spirit', 'spawn_worker'):
setattr(self, func, getattr(self, func+'_'+ext)) setattr(self, func, getattr(self, func+'_'+ext))
def cleanup_child_windows(self, child, name=None, fd=None): def cleanup_child_windows(self, child, name=None, fd=None):
try: try:
child.kill() child.kill()
@ -175,13 +177,13 @@ class WorkerMother(object):
self.os.unlink(name) self.os.unlink(name)
except: except:
pass pass
def cleanup_child_linux(self, child): def cleanup_child_linux(self, child):
try: try:
child.kill() child.kill()
except: except:
pass pass
def get_env(self): def get_env(self):
env = dict(os.environ) env = dict(os.environ)
env['CALIBRE_WORKER'] = '1' env['CALIBRE_WORKER'] = '1'
@ -189,21 +191,21 @@ class WorkerMother(object):
if hasattr(self, 'env'): if hasattr(self, 'env'):
env.update(self.env) env.update(self.env)
return env return env
def spawn_free_spirit_osx(self, arg, type='free_spirit'): def spawn_free_spirit_osx(self, arg, type='free_spirit'):
script = 'from calibre.parallel import main; main(args=["calibre-parallel", %s]);'%repr(arg) script = 'from calibre.parallel import main; main(args=["calibre-parallel", %s]);'%repr(arg)
cmdline = [self.executable, '-c', self.prefix+script] cmdline = [self.executable, '-c', self.prefix+script]
child = WorkerStatus(subprocess.Popen(cmdline, env=self.get_env())) child = WorkerStatus(subprocess.Popen(cmdline, env=self.get_env()))
atexit.register(self.cleanup_child_linux, child) atexit.register(self.cleanup_child_linux, child)
return child return child
def spawn_free_spirit_linux(self, arg, type='free_spirit'): def spawn_free_spirit_linux(self, arg, type='free_spirit'):
cmdline = [self.executable, arg] cmdline = [self.executable, arg]
child = WorkerStatus(subprocess.Popen(cmdline, child = WorkerStatus(subprocess.Popen(cmdline,
env=self.get_env(), cwd=getattr(sys, 'frozen_path', None))) env=self.get_env(), cwd=getattr(sys, 'frozen_path', None)))
atexit.register(self.cleanup_child_linux, child) atexit.register(self.cleanup_child_linux, child)
return child return child
def spawn_free_spirit_windows(self, arg, type='free_spirit'): def spawn_free_spirit_windows(self, arg, type='free_spirit'):
fd, name = tempfile.mkstemp('.log', 'calibre_'+type+'_') fd, name = tempfile.mkstemp('.log', 'calibre_'+type+'_')
handle = msvcrt.get_osfhandle(fd) handle = msvcrt.get_osfhandle(fd)
@ -226,9 +228,9 @@ class WorkerMother(object):
child = WorkerStatus(hProcess) child = WorkerStatus(hProcess)
atexit.register(self.cleanup_child_windows, child, name, fd) atexit.register(self.cleanup_child_windows, child, name, fd)
return child return child
mother = WorkerMother() mother = WorkerMother()
_comm_lock = RLock() _comm_lock = RLock()
def write(socket, msg, timeout=5): def write(socket, msg, timeout=5):
@ -236,14 +238,14 @@ def write(socket, msg, timeout=5):
Write a message on socket. If `msg` is unicode, it is encoded in utf-8. Write a message on socket. If `msg` is unicode, it is encoded in utf-8.
Raises a `RuntimeError` if the socket is not ready for writing or the writing fails. Raises a `RuntimeError` if the socket is not ready for writing or the writing fails.
`msg` is broken into chunks of size 4096 and sent. The :function:`read` function `msg` is broken into chunks of size 4096 and sent. The :function:`read` function
automatically re-assembles the chunks into whole message. automatically re-assembles the chunks into whole message.
''' '''
if isworker: if isworker:
_comm_lock.acquire() _comm_lock.acquire()
try: try:
if isinstance(msg, unicode): if isinstance(msg, unicode):
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
if DEBUG: if DEBUG:
print >>sys.__stdout__, 'write(%s):'%('worker' if isworker else 'overseer'), repr(msg) print >>sys.__stdout__, 'write(%s):'%('worker' if isworker else 'overseer'), repr(msg)
length = None length = None
while len(msg) > 0: while len(msg) > 0:
@ -260,12 +262,12 @@ def write(socket, msg, timeout=5):
raise RuntimeError('Failed to write chunk to socket') raise RuntimeError('Failed to write chunk to socket')
finally: finally:
if isworker: if isworker:
_comm_lock.release() _comm_lock.release()
def read(socket, timeout=5): def read(socket, timeout=5):
''' '''
Read a message from `socket`. The message must have been sent with the :function:`write` Read a message from `socket`. The message must have been sent with the :function:`write`
function. Raises a `RuntimeError` if the message is corrpted. Can return an function. Raises a `RuntimeError` if the message is corrpted. Can return an
empty string. empty string.
''' '''
if isworker: if isworker:
@ -298,25 +300,25 @@ def read(socket, timeout=5):
class RepeatingTimer(Thread): class RepeatingTimer(Thread):
''' '''
Calls a specified function repeatedly at a specified interval. Runs in a Calls a specified function repeatedly at a specified interval. Runs in a
daemon thread (i.e. the interpreter can exit while it is still running). daemon thread (i.e. the interpreter can exit while it is still running).
Call :meth:`start()` to start it. Call :meth:`start()` to start it.
''' '''
def repeat(self): def repeat(self):
while True: while True:
self.event.wait(self.interval) self.event.wait(self.interval)
if self.event.isSet(): if self.event.isSet():
break break
self.action() self.action()
def __init__(self, interval, func, name): def __init__(self, interval, func, name):
self.event = Event() self.event = Event()
self.interval = interval self.interval = interval
self.action = func self.action = func
Thread.__init__(self, target=self.repeat, name=name) Thread.__init__(self, target=self.repeat, name=name)
self.setDaemon(True) self.setDaemon(True)
class ControlError(Exception): class ControlError(Exception):
pass pass
@ -325,10 +327,10 @@ class Overseer(object):
Responsible for controlling worker processes. The main interface is the Responsible for controlling worker processes. The main interface is the
methods, :meth:`initialize_job`, :meth:`control`. methods, :meth:`initialize_job`, :meth:`control`.
''' '''
KILL_RESULT = 'Server: job killed by user|||#@#$%&*)*(*$#$%#$@&' KILL_RESULT = 'Server: job killed by user|||#@#$%&*)*(*$#$%#$@&'
INTERVAL = 0.1 INTERVAL = 0.1
def __init__(self, server, port, timeout=5): def __init__(self, server, port, timeout=5):
self.worker_status = mother.spawn_worker('127.0.0.1:'+str(port)) self.worker_status = mother.spawn_worker('127.0.0.1:'+str(port))
self.socket = server.accept()[0] self.socket = server.accept()[0]
@ -337,7 +339,7 @@ class Overseer(object):
self.signal = signal self.signal = signal
self.on_probation = False self.on_probation = False
self.terminated = False self.terminated = False
self.working = False self.working = False
self.timeout = timeout self.timeout = timeout
self.last_job_time = time.time() self.last_job_time = time.time()
@ -345,14 +347,14 @@ class Overseer(object):
self._stop = False self._stop = False
if not select([self.socket], [], [], 120)[0]: if not select([self.socket], [], [], 120)[0]:
raise RuntimeError(_('Could not launch worker process.')) raise RuntimeError(_('Could not launch worker process.'))
ID = self.read().split(':') ID = self.read().split(':')
if ID[0] != 'CALIBRE_WORKER': if ID[0] != 'CALIBRE_WORKER':
raise RuntimeError('Impostor') raise RuntimeError('Impostor')
self.worker_pid = int(ID[1]) self.worker_pid = int(ID[1])
self.write('OK') self.write('OK')
if self.read() != 'WAITING': if self.read() != 'WAITING':
raise RuntimeError('Worker sulking') raise RuntimeError('Worker sulking')
def terminate(self): def terminate(self):
'Kill worker process.' 'Kill worker process.'
self.terminated = True self.terminated = True
@ -379,31 +381,31 @@ class Overseer(object):
self.worker_status.kill() self.worker_status.kill()
except: except:
pass pass
def write(self, msg, timeout=None): def write(self, msg, timeout=None):
write(self.socket, msg, timeout=self.timeout if timeout is None else timeout) write(self.socket, msg, timeout=self.timeout if timeout is None else timeout)
def read(self, timeout=None): def read(self, timeout=None):
return read(self.socket, timeout=self.timeout if timeout is None else timeout) return read(self.socket, timeout=self.timeout if timeout is None else timeout)
def __eq__(self, other): def __eq__(self, other):
return hasattr(other, 'process') and hasattr(other, 'worker_pid') and self.worker_pid == other.worker_pid return hasattr(other, 'process') and hasattr(other, 'worker_pid') and self.worker_pid == other.worker_pid
def is_viable(self): def is_viable(self):
if self.terminated: if self.terminated:
return False return False
return self.worker_status.is_alive() return self.worker_status.is_alive()
def select(self, timeout=0): def select(self, timeout=0):
return select([self.socket], [self.socket], [self.socket], timeout) return select([self.socket], [self.socket], [self.socket], timeout)
def initialize_job(self, job): def initialize_job(self, job):
''' '''
Sends `job` to worker process. Can raise `ControlError` if worker process Sends `job` to worker process. Can raise `ControlError` if worker process
does not respond appropriately. In this case, this Overseer is useless does not respond appropriately. In this case, this Overseer is useless
and should be discarded. and should be discarded.
`job`: An instance of :class:`Job`. `job`: An instance of :class:`Job`.
''' '''
self.job_id = job.job_id self.job_id = job.job_id
@ -416,13 +418,13 @@ class Overseer(object):
self.progress = job.progress if callable(job.progress) else None self.progress = job.progress if callable(job.progress) else None
self.job = job self.job = job
self.last_report = time.time() self.last_report = time.time()
def control(self): def control(self):
''' '''
Listens for messages from the worker process and dispatches them Listens for messages from the worker process and dispatches them
appropriately. If the worker process dies unexpectedly, returns a result appropriately. If the worker process dies unexpectedly, returns a result
of None with a ControlError indicating the worker died. of None with a ControlError indicating the worker died.
Returns a :class:`Result` instance or None, if the worker is still working. Returns a :class:`Result` instance or None, if the worker is still working.
''' '''
if select([self.socket],[],[],0)[0]: if select([self.socket],[],[],0)[0]:
@ -468,10 +470,10 @@ class Overseer(object):
if not self.worker_status.is_alive() or time.time() - self.last_report > 180: if not self.worker_status.is_alive() or time.time() - self.last_report > 180:
self.terminate() self.terminate()
return Result(None, ControlError('Worker process died unexpectedly with returncode: %s'%str(self.process.returncode)), '') return Result(None, ControlError('Worker process died unexpectedly with returncode: %s'%str(self.process.returncode)), '')
class Job(object): class Job(object):
def __init__(self, job_id, func, args, kwdargs, output, progress, done): def __init__(self, job_id, func, args, kwdargs, output, progress, done):
self.job_id = job_id self.job_id = job_id
self.func = func self.func = func
@ -480,20 +482,20 @@ class Job(object):
self.output = output self.output = output
self.progress = progress self.progress = progress
self.done = done self.done = done
class Result(object): class Result(object):
def __init__(self, result, exception, traceback): def __init__(self, result, exception, traceback):
self.result = result self.result = result
self.exception = exception self.exception = exception
self.traceback = traceback self.traceback = traceback
def __len__(self): def __len__(self):
return 3 return 3
def __item__(self, i): def __item__(self, i):
return (self.result, self.exception, self.traceback)[i] return (self.result, self.exception, self.traceback)[i]
def __iter__(self): def __iter__(self):
return iter((self.result, self.exception, self.traceback)) return iter((self.result, self.exception, self.traceback))
@ -503,12 +505,12 @@ def remove_ipc_socket(path):
os.unlink(path) os.unlink(path)
class Server(Thread): class Server(Thread):
KILL_RESULT = Overseer.KILL_RESULT KILL_RESULT = Overseer.KILL_RESULT
START_PORT = 10013 START_PORT = 10013
PID = os.getpid() PID = os.getpid()
def __init__(self, number_of_workers=detect_ncpus()): def __init__(self, number_of_workers=detect_ncpus()):
Thread.__init__(self) Thread.__init__(self)
self.setDaemon(True) self.setDaemon(True)
@ -524,7 +526,7 @@ class Server(Thread):
if not iswindows: if not iswindows:
atexit.register(remove_ipc_socket, self.port) atexit.register(remove_ipc_socket, self.port)
self.server_socket.listen(5) self.server_socket.listen(5)
self.number_of_workers = number_of_workers self.number_of_workers = number_of_workers
self.pool, self.jobs, self.working, self.results = [], collections.deque(), [], {} self.pool, self.jobs, self.working, self.results = [], collections.deque(), [], {}
atexit.register(self.killall) atexit.register(self.killall)
atexit.register(self.close) atexit.register(self.close)
@ -534,26 +536,26 @@ class Server(Thread):
self.result_lock = RLock() self.result_lock = RLock()
self.pool_lock = RLock() self.pool_lock = RLock()
self.start() self.start()
def close(self): def close(self):
try: try:
self.server_socket.shutdown(socket.SHUT_RDWR) self.server_socket.shutdown(socket.SHUT_RDWR)
except: except:
pass pass
def add_job(self, job): def add_job(self, job):
with self.job_lock: with self.job_lock:
self.jobs.append(job) self.jobs.append(job)
def store_result(self, result, id=None): def store_result(self, result, id=None):
if id: if id:
with self.job_lock: with self.job_lock:
self.results[id] = result self.results[id] = result
def result(self, id): def result(self, id):
with self.result_lock: with self.result_lock:
return self.results.pop(id, None) return self.results.pop(id, None)
def run(self): def run(self):
while True: while True:
job = None job = None
@ -581,7 +583,7 @@ class Server(Thread):
if o and o.is_viable(): if o and o.is_viable():
with self.working_lock: with self.working_lock:
self.working.append(o) self.working.append(o)
with self.working_lock: with self.working_lock:
done = [] done = []
for o in self.working: for o in self.working:
@ -598,19 +600,19 @@ class Server(Thread):
if o and o.is_viable(): if o and o.is_viable():
with self.pool_lock: with self.pool_lock:
self.pool.append(o) self.pool.append(o)
try: try:
time.sleep(1) time.sleep(1)
except: except:
return return
def killall(self): def killall(self):
with self.pool_lock: with self.pool_lock:
map(lambda x: x.terminate(), self.pool) map(lambda x: x.terminate(), self.pool)
self.pool = [] self.pool = []
def kill(self, job_id): def kill(self, job_id):
with self.working_lock: with self.working_lock:
pop = None pop = None
@ -622,13 +624,13 @@ class Server(Thread):
break break
if pop is not None: if pop is not None:
self.working.remove(pop) self.working.remove(pop)
def run_job(self, job_id, func, args=[], kwdargs={}, def run_job(self, job_id, func, args=[], kwdargs={},
output=None, progress=None, done=None): output=None, progress=None, done=None):
''' '''
Run a job in a separate process. Supports job control, output redirection Run a job in a separate process. Supports job control, output redirection
and progress reporting. and progress reporting.
''' '''
if done is None: if done is None:
@ -636,20 +638,20 @@ class Server(Thread):
job = Job(job_id, func, args, kwdargs, output, progress, done) job = Job(job_id, func, args, kwdargs, output, progress, done)
with self.job_lock: with self.job_lock:
self.jobs.append(job) self.jobs.append(job)
def run_free_job(self, func, args=[], kwdargs={}): def run_free_job(self, func, args=[], kwdargs={}):
pt = PersistentTemporaryFile('.pickle', '_IPC_') pt = PersistentTemporaryFile('.pickle', '_IPC_')
pt.write(cPickle.dumps((func, args, kwdargs))) pt.write(cPickle.dumps((func, args, kwdargs)))
pt.close() pt.close()
mother.spawn_free_spirit(binascii.hexlify(pt.name)) mother.spawn_free_spirit(binascii.hexlify(pt.name))
########################################################################################## ##########################################################################################
##################################### CLIENT CODE ##################################### ##################################### CLIENT CODE #####################################
########################################################################################## ##########################################################################################
class BufferedSender(object): class BufferedSender(object):
def __init__(self, socket): def __init__(self, socket):
self.socket = socket self.socket = socket
self.wbuf, self.pbuf = [], [] self.wbuf, self.pbuf = [], []
@ -657,14 +659,14 @@ class BufferedSender(object):
self.last_report = None self.last_report = None
self.timer = RepeatingTimer(0.5, self.send, 'BufferedSender') self.timer = RepeatingTimer(0.5, self.send, 'BufferedSender')
self.timer.start() self.timer.start()
def write(self, msg): def write(self, msg):
if not isinstance(msg, basestring): if not isinstance(msg, basestring):
msg = unicode(msg) msg = unicode(msg)
with self.wlock: with self.wlock:
self.wbuf.append(msg) self.wbuf.append(msg)
def send(self): def send(self):
if callable(select) and select([self.socket], [], [], 0)[0]: if callable(select) and select([self.socket], [], [], 0)[0]:
msg = read(self.socket) msg = read(self.socket)
@ -687,7 +689,7 @@ class BufferedSender(object):
write(self.socket, 'OUTPUT:'+msg) write(self.socket, 'OUTPUT:'+msg)
read(self.socket, 10) read(self.socket, 10)
reported = True reported = True
with self.plock: with self.plock:
if self.pbuf: if self.pbuf:
msg = cPickle.dumps(self.pbuf, -1) msg = cPickle.dumps(self.pbuf, -1)
@ -703,11 +705,11 @@ class BufferedSender(object):
write(self.socket, 'PING:') write(self.socket, 'PING:')
read(self.socket, 10) read(self.socket, 10)
self.last_report = time.time() self.last_report = time.time()
def notify(self, percent, msg=''): def notify(self, percent, msg=''):
with self.plock: with self.plock:
self.pbuf.append((percent, msg)) self.pbuf.append((percent, msg))
def flush(self): def flush(self):
pass pass
@ -725,13 +727,13 @@ def work(client_socket, func, args, kwdargs):
kargs[notification] = sys.stdout.notify kargs[notification] = sys.stdout.notify
kargs.update(kwdargs) kargs.update(kwdargs)
res = func(*args, **kargs) res = func(*args, **kargs)
if hasattr(sys.stdout, 'send'): if hasattr(sys.stdout, 'send'):
sys.stdout.send() sys.stdout.send()
return res return res
finally: finally:
sys.stdout.last_report = None sys.stdout.last_report = None
time.sleep(5) # Give any in progress BufferedSend time to complete time.sleep(5) # Give any in progress BufferedSend time to complete
def worker(host, port): def worker(host, port):
client_socket = socket.socket(SOCKET_TYPE, socket.SOCK_STREAM) client_socket = socket.socket(SOCKET_TYPE, socket.SOCK_STREAM)
@ -742,10 +744,10 @@ def worker(host, port):
if msg != 'OK': if msg != 'OK':
return 1 return 1
write(client_socket, 'WAITING') write(client_socket, 'WAITING')
sys.stdout = BufferedSender(client_socket) sys.stdout = BufferedSender(client_socket)
sys.stderr = sys.stdout sys.stderr = sys.stdout
while True: while True:
if not select([client_socket], [], [], 60)[0]: if not select([client_socket], [], [], 60)[0]:
time.sleep(1) time.sleep(1)
@ -766,7 +768,7 @@ def worker(host, port):
break break
gc.collect() gc.collect()
elif msg == 'PING:': elif msg == 'PING:':
write(client_socket, 'OK') write(client_socket, 'OK')
elif msg == 'STOP:': elif msg == 'STOP:':
client_socket.shutdown(socket.SHUT_RDWR) client_socket.shutdown(socket.SHUT_RDWR)
return 0 return 0
@ -775,7 +777,7 @@ def worker(host, port):
else: else:
print >>sys.__stderr__, 'Invalid protocols message', msg print >>sys.__stderr__, 'Invalid protocols message', msg
return 1 return 1
def free_spirit(path): def free_spirit(path):
func, args, kwdargs = cPickle.load(open(path, 'rb')) func, args, kwdargs = cPickle.load(open(path, 'rb'))
try: try:
@ -785,7 +787,7 @@ def free_spirit(path):
func, kargs = get_func(func)[:2] func, kargs = get_func(func)[:2]
kargs.update(kwdargs) kargs.update(kwdargs)
func(*args, **kargs) func(*args, **kargs)
def main(args=sys.argv): def main(args=sys.argv):
global isworker global isworker
isworker = True isworker = True
@ -793,9 +795,9 @@ def main(args=sys.argv):
if len(args) == 1: if len(args) == 1:
free_spirit(binascii.unhexlify(re.sub(r'[^a-f0-9A-F]', '', args[0]))) free_spirit(binascii.unhexlify(re.sub(r'[^a-f0-9A-F]', '', args[0])))
else: else:
worker(args[0].replace("'", ''), int(args[1]) if iswindows else args[1]) worker(args[0].replace("'", ''), int(args[1]) if iswindows else args[1])
return 0 return 0
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())

View File

@ -12,7 +12,7 @@ def get_ip_address(ifname):
0x8915, # SIOCGIFADDR 0x8915, # SIOCGIFADDR
struct.pack('256s', ifname[:15]) struct.pack('256s', ifname[:15])
)[20:24]) )[20:24])
HOST=get_ip_address('eth0') HOST=get_ip_address('eth0')
PROJECT=os.path.basename(os.getcwd()) PROJECT=os.path.basename(os.getcwd())
@ -34,7 +34,7 @@ mkdir -p build dist src/calibre/plugins && \
%%s && \ %%s && \
rm -rf build/* && \ rm -rf build/* && \
%%s %%s %%s %%s
'''%dict(host=HOST, project=PROJECT) '''%dict(host=HOST, project=PROJECT)
check_call = partial(_check_call, shell=True) check_call = partial(_check_call, shell=True)
#h = Host(hostType=VIX_SERVICEPROVIDER_VMWARE_WORKSTATION) #h = Host(hostType=VIX_SERVICEPROVIDER_VMWARE_WORKSTATION)
@ -43,7 +43,7 @@ def tag_release():
print 'Tagging release' print 'Tagging release'
check_call('bzr tag '+__version__) check_call('bzr tag '+__version__)
check_call('bzr commit --unchanged -m "IGN:Tag release"') check_call('bzr commit --unchanged -m "IGN:Tag release"')
def installer_name(ext): def installer_name(ext):
if ext in ('exe', 'dmg'): if ext in ('exe', 'dmg'):
return 'dist/%s-%s.%s'%(__appname__, __version__, ext) return 'dist/%s-%s.%s'%(__appname__, __version__, ext)
@ -87,7 +87,7 @@ def build_windows(shutdown=True):
def build_osx(shutdown=True): def build_osx(shutdown=True):
installer = installer_name('dmg') installer = installer_name('dmg')
vm = '/vmware/Mac OSX/Mac OSX.vmx' vm = '/vmware/Mac OSX/Mac OSX.vmx'
python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python' python = '/Library/Frameworks/Python.framework/Versions/Current/bin/python'
start_vm(vm, 'osx', (BUILD_SCRIPT%('sudo %s setup.py develop'%python, python, 'installer/osx/freeze.py')).replace('rm ', 'sudo rm ')) start_vm(vm, 'osx', (BUILD_SCRIPT%('sudo %s setup.py develop'%python, python, 'installer/osx/freeze.py')).replace('rm ', 'sudo rm '))
subprocess.check_call(('scp', 'osx:build/%s/dist/*.dmg'%PROJECT, 'dist')) subprocess.check_call(('scp', 'osx:build/%s/dist/*.dmg'%PROJECT, 'dist'))
if not os.path.exists(installer): if not os.path.exists(installer):
@ -95,7 +95,7 @@ def build_osx(shutdown=True):
if shutdown: if shutdown:
subprocess.Popen(('ssh', 'osx', 'sudo', '/sbin/shutdown', '-h', 'now')) subprocess.Popen(('ssh', 'osx', 'sudo', '/sbin/shutdown', '-h', 'now'))
return os.path.basename(installer) return os.path.basename(installer)
def build_linux(shutdown=True): def build_linux(shutdown=True):
installer = installer_name('tar.bz2') installer = installer_name('tar.bz2')
@ -146,7 +146,7 @@ def curl_delete_file(path, url=MOBILEREAD):
c.setopt(c.QUOTE, ['dele '+ path]) c.setopt(c.QUOTE, ['dele '+ path])
c.perform() c.perform()
c.close() c.close()
def curl_upload_file(stream, url): def curl_upload_file(stream, url):
c = pycurl.Curl() c = pycurl.Curl()
@ -173,9 +173,9 @@ def curl_upload_file(stream, url):
stream.seek(0,2) stream.seek(0,2)
if size != stream.tell(): if size != stream.tell():
raise RuntimeError('curl failed to upload %s correctly'%getattr(stream, 'name', '')) raise RuntimeError('curl failed to upload %s correctly'%getattr(stream, 'name', ''))
def upload_installer(name): def upload_installer(name):
if not os.path.exists(name): if not os.path.exists(name):
return return
@ -189,17 +189,19 @@ def upload_installer(name):
def upload_installers(): def upload_installers():
for i in ('dmg', 'exe', 'tar.bz2'): for i in ('dmg', 'exe', 'tar.bz2'):
upload_installer(installer_name(i)) upload_installer(installer_name(i))
check_call('''ssh divok echo %s \\> %s/latest_version'''%(__version__, DOWNLOADS)) check_call('''ssh divok echo %s \\> %s/latest_version'''%(__version__, DOWNLOADS))
def upload_docs(): def upload_docs():
os.environ['PYTHONPATH'] = os.path.abspath('src')
check_call('''epydoc --config epydoc.conf''') check_call('''epydoc --config epydoc.conf''')
check_call('''scp -r docs/html divok:%s/'''%(DOCS,)) check_call('''scp -r docs/html divok:%s/'''%(DOCS,))
check_call('''epydoc -v --config epydoc-pdf.conf''') check_call('''epydoc -v --config epydoc-pdf.conf''')
check_call('''scp docs/pdf/api.pdf divok:%s/'''%(DOCS,)) check_call('''scp docs/pdf/api.pdf divok:%s/'''%(DOCS,))
def upload_user_manual(): def upload_user_manual():
os.environ['PYTHONPATH'] = os.path.abspath('src')
cwd = os.getcwdu() cwd = os.getcwdu()
os.chdir('src/calibre/manual') os.chdir('src/calibre/manual')
try: try:
@ -208,25 +210,24 @@ def upload_user_manual():
check_call('scp -r .build/html/* divok:%s'%USER_MANUAL) check_call('scp -r .build/html/* divok:%s'%USER_MANUAL)
finally: finally:
os.chdir(cwd) os.chdir(cwd)
def build_src_tarball(): def build_src_tarball():
check_call('bzr export dist/calibre-%s.tar.bz2'%__version__) check_call('bzr export dist/calibre-%s.tar.bz2'%__version__)
def upload_src_tarball(): def upload_src_tarball():
check_call('ssh divok rm -f %s/calibre-\*.tar.bz2'%DOWNLOADS) check_call('ssh divok rm -f %s/calibre-\*.tar.bz2'%DOWNLOADS)
check_call('scp dist/calibre-*.tar.bz2 divok:%s/'%DOWNLOADS) check_call('scp dist/calibre-*.tar.bz2 divok:%s/'%DOWNLOADS)
def stage_one(): def stage_one():
shutil.rmtree('build') check_call('sudo rm -rf build', shell=True)
os.mkdir('build') os.mkdir('build')
shutil.rmtree('docs') shutil.rmtree('docs')
os.mkdir('docs') os.mkdir('docs')
check_call(['python', 'setup.py', 'build']) check_call('python setup.py mydevelop', shell=True)
check_call('sudo rm -f src/%s/gui2/images_rc.pyc'%__appname__, shell=True)
check_call('make', shell=True) check_call('make', shell=True)
tag_release() tag_release()
upload_demo() upload_demo()
def stage_two(): def stage_two():
subprocess.check_call('rm -rf dist/*', shell=True) subprocess.check_call('rm -rf dist/*', shell=True)
build_installers() build_installers()
@ -250,8 +251,8 @@ def main(args=sys.argv):
print 'Starting stage three...' print 'Starting stage three...'
stage_three() stage_three()
print 'Finished' print 'Finished'
return 0 return 0
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())