From cbb8d869c7103feba75d4ab94794950027d84ef8 Mon Sep 17 00:00:00 2001 From: Yusuke Shinyama Date: Sun, 31 Jul 2011 18:05:07 +1000 Subject: [PATCH] removed initial cmap/ directory --- Makefile | 13 ++++++++----- pdfminer/cmap/Makefile | 9 --------- pdfminer/cmap/__init__.py | 0 pdfminer/cmapdb.py | 8 +++++--- 4 files changed, 13 insertions(+), 17 deletions(-) delete mode 100644 pdfminer/cmap/Makefile delete mode 100644 pdfminer/cmap/__init__.py diff --git a/Makefile b/Makefile index 8eb6f79..07966bd 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ PYTHON=python2 GIT=git RM=rm -f CP=cp -f +MKDIR=mkdir all: @@ -36,14 +37,16 @@ CMAPDST=pdfminer/cmap cmap: $(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz $(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz \ $(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz $(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz cmap_clean: - cd $(CMAPDST) && make cmap_clean -$(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz: + -$(RM) -r $(CMAPDST) +$(CMAPDST): + $(MKDIR) $(CMAPDST) +$(CMAPDST)/to-unicode-Adobe-CNS1.pickle.gz: $(CMAPDST) $(CONV_CMAP) $(CMAPDST) Adobe-CNS1 $(CMAPSRC)/cid2code_Adobe_CNS1.txt cp950 big5 -$(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz: +$(CMAPDST)/to-unicode-Adobe-GB1.pickle.gz: $(CMAPDST) $(CONV_CMAP) $(CMAPDST) Adobe-GB1 $(CMAPSRC)/cid2code_Adobe_GB1.txt cp936 gb2312 -$(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz: +$(CMAPDST)/to-unicode-Adobe-Japan1.pickle.gz: $(CMAPDST) $(CONV_CMAP) $(CMAPDST) Adobe-Japan1 $(CMAPSRC)/cid2code_Adobe_Japan1.txt cp932 euc-jp -$(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz: +$(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz: $(CMAPDST) $(CONV_CMAP) $(CMAPDST) Adobe-Korea1 $(CMAPSRC)/cid2code_Adobe_Korea1.txt cp949 euc-kr test: cmap diff --git a/pdfminer/cmap/Makefile b/pdfminer/cmap/Makefile deleted file mode 100644 index 117e9f4..0000000 --- a/pdfminer/cmap/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# Makefile for pdfminer.cmap - -all: - -clean: - -rm *.pyc *.pyo - -cmap_clean: - rm -f *.pickle.gz diff --git a/pdfminer/cmap/__init__.py b/pdfminer/cmap/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pdfminer/cmapdb.py b/pdfminer/cmapdb.py index d2b0618..1f7b179 100644 --- a/pdfminer/cmapdb.py +++ b/pdfminer/cmapdb.py @@ -17,7 +17,6 @@ import os import os.path import gzip import cPickle as pickle -import cmap import struct from psparser import PSStackParser from psparser import PSException, PSSyntaxError, PSTypeError, PSEOF @@ -240,8 +239,11 @@ class CMapDB(object): filename = '%s.pickle.gz' % name if klass.debug: print >>sys.stderr, 'loading:', name - default_path = os.environ.get('CMAP_PATH', '/usr/share/pdfminer/') - for directory in (os.path.dirname(cmap.__file__), default_path): + cmap_paths = ( + os.environ.get('CMAP_PATH', '/usr/share/pdfminer/'), + os.path.join(os.path.dirname(__file__), 'cmap'), + ) + for directory in cmap_paths: path = os.path.join(directory, filename) if os.path.exists(path): gzfile = gzip.open(path)