MCPcopy Index your code
hub / github.com/clips/pattern / _load_data

Method _load_data

pattern/web/pdf/cmapdb.py:239–253  ·  view source on GitHub ↗
(klass, name)

Source from the content-addressed store, hash-verified

237
238 @classmethod
239 def _load_data(klass, name):
240 filename = '%s.pickle.gz' % name
241 if klass.debug:
242 print >>sys.stderr, 'loading:', name
243 default_path = os.environ.get('CMAP_PATH', '/usr/share/pdfminer/')
244 for directory in (os.path.dirname(cmap.__file__), default_path):
245 path = os.path.join(directory, filename)
246 if os.path.exists(path):
247 gzfile = gzip.open(path)
248 try:
249 return type(name, (), pickle.loads(gzfile.read()))
250 finally:
251 gzfile.close()
252 else:
253 raise CMapDB.CMapNotFound(name)
254
255 @classmethod
256 def get_cmap(klass, name):

Callers 2

get_cmapMethod · 0.80
get_unicode_mapMethod · 0.80

Calls 5

existsMethod · 0.80
openMethod · 0.80
getMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected