MCPcopy Create free account
hub / github.com/ActiveState/code / extract

Function extract

recipes/Python/456375_File_Extractor/recipe-456375.py:94–114  ·  view source on GitHub ↗
(data, bmp)

Source from the content-addressed store, hash-verified

92 extract(data, False)
93
94def extract(data, bmp):
95 while True:
96 try:
97 size = get_size()
98 if bmp:
99 file_list = search_bmp(data, size)
100 else:
101 file_list = search_jpg(data, size)
102 if len(file_list) == 0:
103 print 'ERROR: Cannot Find File'
104 else:
105 while len(file_list) != 0:
106 print len(file_list), 'files can be extracted.'
107 select = get_select(len(file_list))
108 save_point = get_save_point()
109 save_point.write(file_list[select - 1])
110 save_point.close()
111 del file_list[select - 1]
112 except:
113 print
114 break
115
116def get_size():
117 while True:

Callers 2

extract_bmpFunction · 0.70
extract_jpgFunction · 0.70

Calls 7

get_sizeFunction · 0.70
search_bmpFunction · 0.70
search_jpgFunction · 0.70
get_selectFunction · 0.70
get_save_pointFunction · 0.70
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected