rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
("csc", "Small caps"),
("csc", "Small Caps"),
def cm_guess_font_info (filename): """this function fills in sensible values for fontinfo.
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
prefixes = [("bx", "Bold Extended"), ("b", "Bold"), ("dc", "Demi Bold Condensed"),
prefixes = [("b", "Bold"),
def cm_guess_font_info (filename): """this function fills in sensible values for fontinfo.
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
weight = 'medium'
weight = 'Regular'
def cm_guess_font_info (filename): """this function fills in sensible values for fontinfo.
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
fontinfo['FullName'] = '%s %s %s designed at %spt' \ % (family, shape, weight, design_size)
full = '%s %s %s %s %dpt' \ % (family, shape, weight, stretch, design_size) full = re.sub (" +", ' ', full) fontinfo['FullName'] = full fontinfo['FontName'] = derive_font_name (family, full) return fontinfo def ec_guess_font_info (filename, fontinfo): design_size = 12 m = re.search ("([0-9]+)$", filename) if m: des...
def cm_guess_font_info (filename): """this function fills in sensible values for fontinfo.
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
def guess_fontinfo (filename): fi = { 'FontName': filename, 'FamilyName': filename, 'Weight': 'regular', 'ItalicAngle': 0, 'FullName': filename, } if re.search ('^cm', filename): fi.update (cm_guess_font_info (filename)) return fi if read_afm_p: global afmfile if not afmfile: afmfile = find_file (filename + '.afm') ...
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
'Weight': 'regular',
'Weight': 'Regular',
def guess_fontinfo (filename): fi = { 'FontName': filename, 'FamilyName': filename, 'Weight': 'regular', 'ItalicAngle': 0, 'FullName': filename, } if re.search ('^cm', filename): fi.update (cm_guess_font_info (filename)) return fi if read_afm_p: global afmfile if not afmfile: afmfile = find_file (filename + '.afm') ...
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
fi.update (cm_guess_font_info (filename)) return fi if read_afm_p:
fi.update (cm_guess_font_info (filename, fi)) elif re.search ("^ec", filename): fi.update (ec_guess_font_info (filename, fi)) elif read_afm_p:
def guess_fontinfo (filename): fi = { 'FontName': filename, 'FamilyName': filename, 'Weight': 'regular', 'ItalicAngle': 0, 'FullName': filename, } if re.search ('^cm', filename): fi.update (cm_guess_font_info (filename)) return fi if read_afm_p: global afmfile if not afmfile: afmfile = find_file (filename + '.afm') ...
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
magnification)
magnification, fontinfo)
def guess_fontinfo (filename): fi = { 'FontName': filename, 'FamilyName': filename, 'Weight': 'regular', 'ItalicAngle': 0, 'FullName': filename, } if re.search ('^cm', filename): fi.update (cm_guess_font_info (filename)) return fi if read_afm_p: global afmfile if not afmfile: afmfile = find_file (filename + '.afm') ...
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
if os.path.abspath (x) != x:
if x and os.path.abspath (x) != x:
def abs_dir (x, dir): if os.path.abspath (x) != x: return os.path.join (dir, x) return x
2e43ddb02beba56feec192e52826850c7cd84286 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/2e43ddb02beba56feec192e52826850c7cd84286/mftrace.py
""" Extract bitmap from the PK file using `gf2pbm'
""" Extract bitmap from the PK file FILENAME (absolute) using `gf2pbm'.
def make_pbm (filename, outname, char_number): """ Extract bitmap from the PK file using `gf2pbm' Return FALSE if the glyph is not valid. """ status = system ("gf2pbm -n %d -o %s %s" %(char_number, outname, filename), ignore_error = 1) return (status == 0)
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
status = system ("gf2pbm -n %d -o %s %s" %(char_number, outname, filename), ignore_error = 1)
command = "gf2pbm -n %d -o %s %s" %(char_number, outname, filename) status = system (command, ignore_error = 1)
def make_pbm (filename, outname, char_number): """ Extract bitmap from the PK file using `gf2pbm' Return FALSE if the glyph is not valid. """ status = system ("gf2pbm -n %d -o %s %s" %(char_number, outname, filename), ignore_error = 1) return (status == 0)
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf'
def autotrace_font (fontname, gf_file, metric, glyphs, encoding, magnification):
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
valid = make_pbm (gf_fontname, 'char.pbm', a)
valid = make_pbm (gf_file, 'char.pbm', a)
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
(w,h, xo, yo) = read_gf_dims (gf_fontname, a)
(w,h, xo, yo) = read_gf_dims (gf_file, a)
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
success = do_autotrace_one ("char.pbm", '%s-%d' % (fontname, a))
success = do_autotrace_one ("char.pbm", '%s-%d' % (gf_fontname, a))
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
tw = int (round (metric.get_char (a).width / metric.design_size * 1000))
metric_width = metric.get_char (a).width tw = int (round (metric_width / metric.design_size * 1000))
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
to_type1 (t1os, font_bbox, fontname, encoding, magnification, 1)
to_type1 (t1os, font_bbox, fontname, encoding, magnification, 1)
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
to_type1 (t1os, font_bbox, fontname, encoding, magnification, 0)
to_type1 (t1os, font_bbox, fontname, encoding, magnification, 0)
def autotrace_font (fontname, metric, glyphs, encoding, magnification): global gf_fontname if not gf_fontname: base = gen_pixel_font (fontname, metric, magnification) gf_fontname = base + 'gf' t1os = [] font_bbox = (10000,10000,-10000,-10000) progress (_ ("Tracing bitmaps... ")) eps_lines = [] # for single glyph ...
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
autotrace_font (basename, metric, glyph_range, encoding, magnification)
if not gf_fontname: base = gen_pixel_font (basename, metric, magnification) gf_fontname = base + 'gf' autotrace_font (basename, gf_fontname, metric, glyph_range, encoding, magnification)
def __getitem__ (self, key): return self.__dict__[key]
6261a7b0062c0861bc1125b26df3ac4d557024b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/6261a7b0062c0861bc1125b26df3ac4d557024b5/mftrace.py
'TeX text': 'tex256.enc',
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
a28289723ca064f1eaac988a396500eb65b94828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/a28289723ca064f1eaac988a396500eb65b94828/mftrace.py
def make_pbm (filename, outname, char_number): """ Extract bitmap from the PK file FILENAME (absolute) using `gf2pbm'. Return FALSE if the glyph is not valid. """ command = "gf2pbm -n %d -o %s %s" %(char_number, outname, filename) status = system (command, ignore_error = 1) return (status == 0)
a28289723ca064f1eaac988a396500eb65b94828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/a28289723ca064f1eaac988a396500eb65b94828/mftrace.py
name = m.group(1) cod =m.group( 2) cod = re.sub('[ /]+', ' ',cod)
name = m.group (1) cod = m.group (2) cod = re.sub ('[ /]+', ' ',cod)
def read_encoding (file): sys.stderr.write(_("Using encoding file: `%s'\n") % file) str = open (file).read () str = re.sub ("%.*", '', str) str = re.sub ("[\n\t \f]+", ' ', str) m = re.search ('/([^ ]+) \[([^\]]+)\] def', str) if not m: raise 'Encoding file invalid.' name = m.group(1) cod =m.group( 2) cod = re.sub('[...
a28289723ca064f1eaac988a396500eb65b94828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/a28289723ca064f1eaac988a396500eb65b94828/mftrace.py
stat = system ("fontforge -usage > pfv 2>&1", ignore_error = 1) fontforge_cmd = 'fontforge'
global fontforge_cmd stat = system ("fontforge -usage > pfv 2>&1 > /dev/null", ignore_error = 1)
def check_pfaedit_scripting (): stat = system ("fontforge -usage > pfv 2>&1", ignore_error = 1) fontforge_cmd = 'fontforge' if stat <> 0: stat = system ("pfaedit -usage > pfv 2>&1", ignore_error = 1) if stat == 0: fontforge_cmd = 'pfaedit' if stat <> 0: warning ("Command `fontforge -usage' failed. Cannot simplify or c...
a28289723ca064f1eaac988a396500eb65b94828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/a28289723ca064f1eaac988a396500eb65b94828/mftrace.py
def make_pbm (filename, outname, char_number): """ Extract bitmap from the PK file FILENAME (absolute) using `gf2pbm'. Return FALSE if the glyph is not valid. """ command = "%s/gf2pbm -n %d -o %s %s" % (bindir, char_number, outname, filename) status = system (command, ignore_error = 1) return (status == 0)
2d4358eaa8740c4402b50a00e92ac15a97512b2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/2d4358eaa8740c4402b50a00e92ac15a97512b2c/mftrace.py
prefixes = [("cmtt", "CMTypewriter"), ("cmvtt", "CMVariableWidthTypewriter"), ("cmss", "CMSans"), ("cm", "CM")]
prefixes = [("cmtt", "CModernTypewriter"), ("cmvtt", "CModernVariableWidthTypewriter"), ("cmss", "CModernSans"), ("cm", "CModern")]
def cm_guess_font_info (filename, fontinfo): # urg. filename = re.sub ("cm(.*)tt", r"cmtt\1", filename) m = re.search ("([0-9]+)$", filename) design_size = '' if m: design_size = string.atoi (m.group (1)) fontinfo['DesignSize'] = design_size prefixes = [("cmtt", "CMTypewriter"), ("cmvtt", "CMVariableWidthTypewriter"),...
a8cea33247b9993508e7774e366987463fd3114c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/a8cea33247b9993508e7774e366987463fd3114c/mftrace.py
prefixes = [("ecss", "EuropeanCMSans"), ("ectt", "EuropeanCMTypewriter"), ("ec", "EuropeanCM")]
prefixes = [("ecss", "ECModernSans"), ("ectt", "ECModernTypewriter"), ("ec", "ECModern")]
def ec_guess_font_info (filename, fontinfo): design_size = 12 m = re.search ("([0-9]+)$", filename) if m: design_size = string.atoi (m.group (1)) fontinfo['DesignSize'] = design_size prefixes = [("ecss", "EuropeanCMSans"), ("ectt", "EuropeanCMTypewriter"), ("ec", "EuropeanCM")] family = '' for (k, v) in prefixes: if ...
a8cea33247b9993508e7774e366987463fd3114c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/a8cea33247b9993508e7774e366987463fd3114c/mftrace.py
str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str if prefix <> '@' + 'prefix@': exec_prefix = interpolate (exec_prefix) % vars() datadir = os.path.join (interpolate (datadir) % vars() , 'mftrace') libdir = interpolate (libdir) % vars()
str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str if prefix != '@' + 'prefix@': exec_prefix = interpolate (exec_prefix) % vars () datadir = os.path.join (interpolate (datadir) % vars (), 'mftrace') libdir = interpolate (libdir) % vars ()
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
temp_dir = os.path.join (os.getcwd (), program_name + '.dir' )
temp_dir = os.path.join (os.getcwd (), program_name + '.dir')
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
program_version='@VERSION@' origdir= os.getcwd ()
program_version = '@VERSION@' origdir = os.getcwd ()
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'TeX typewriter text' : '09fbbfac.enc',
'TeX typewriter text': '09fbbfac.enc',
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'TeX math italic': 'aae443f0.enc ',
'TeX math italic': 'aae443f0.enc ',
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'TeX text without f-ligatures' : '0ef0afca.enc', 'Extended TeX Font Encoding - Latin' : 'tex256.enc',
'TeX text without f-ligatures': '0ef0afca.enc', 'Extended TeX Font Encoding - Latin': 'tex256.enc',
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'parmesanMusic' : 'parmesan20.enc',
'parmesanMusic': 'parmesan20.enc',
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def interpolate (str): str = string.replace (str, '{', '(') str = string.replace (str, '}', ')s') str = string.replace (str, '$', '%') return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2002'))
sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2004'))
def warranty (): identify (sys.stdout) sys.stdout.write ('\n') sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2002')) sys.stdout.write ('\n') sys.stdout.write (' Han-Wen Nienhuys') sys.stdout.write (' Jan Nieuwenhuizen') sys.stdout.write ('\n') sys.stdout.write (_ (r'''
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
Distributed under terms of the GNU General Public License. It comes with
Distributed under terms of the GNU General Public License. It comes with
def warranty (): identify (sys.stdout) sys.stdout.write ('\n') sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2002')) sys.stdout.write ('\n') sys.stdout.write (' Han-Wen Nienhuys') sys.stdout.write (' Jan Nieuwenhuizen') sys.stdout.write ('\n') sys.stdout.write (_ (r'''
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def warning (s): errorport.write (_ ("warning: ") + s)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'''Report the error S. Exit by raising an exception. Please do not abuse by trying to catch this error. If you do not want
'''Report the error S. Exit by raising an exception. Please do not abuse by trying to catch this error. If you do not want
def error (s): '''Report the error S. Exit by raising an exception. Please do not abuse by trying to catch this error. If you do not want a stack trace, write to the output directly. RETURN VALUE None ''' errorport.write (_ ("error: ") + s + '\n') raise _ ("Exiting ... ")
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def error (s): '''Report the error S. Exit by raising an exception. Please do not abuse by trying to catch this error. If you do not want a stack trace, write to the output directly. RETURN VALUE None ''' errorport.write (_ ("error: ") + s + '\n') raise _ ("Exiting ... ")
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def error (s): '''Report the error S. Exit by raising an exception. Please do not abuse by trying to catch this error. If you do not want a stack trace, write to the output directly. RETURN VALUE None ''' errorport.write (_ ("error: ") + s + '\n') raise _ ("Exiting ... ")
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'''Construct arguments (LONG, SHORT) for getopt from list of options.'''
'''Construct arguments (LONG, SHORT) for getopt from list of options.'''
def getopt_args (opts): '''Construct arguments (LONG, SHORT) for getopt from list of options.''' short = '' long = [] for o in opts: if o[1]: short = short + o[1] if o[0]: short = short + ':' if o[2]: l = o[2] if o[0]: l = l + '=' long.append (l) return (short, long)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
l = o[2]
lst = o[2]
def getopt_args (opts): '''Construct arguments (LONG, SHORT) for getopt from list of options.''' short = '' long = [] for o in opts: if o[1]: short = short + o[1] if o[0]: short = short + ':' if o[2]: l = o[2] if o[0]: l = l + '=' long.append (l) return (short, long)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
l = l + '=' long.append (l)
lst = lst + '=' long.append (lst)
def getopt_args (opts): '''Construct arguments (LONG, SHORT) for getopt from list of options.''' short = '' long = [] for o in opts: if o[1]: short = short + o[1] if o[0]: short = short + ':' if o[2]: l = o[2] if o[0]: l = l + '=' long.append (l) return (short, long)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'''Transform one option description (4-tuple ) into neatly formatted string''' sh = ' '
'''Transform one option description (4-tuple) into neatly formatted string''' sh = ' '
def option_help_str (o): '''Transform one option description (4-tuple ) into neatly formatted string''' sh = ' ' if o[1]: sh = '-%s' % o[1] sep = ' ' if o[1] and o[2]: sep = ',' long = '' if o[2]: long= '--%s' % o[2] arg = '' if o[0]: if o[2]: arg = '=' arg = arg + o[0] return ' ' + sh + sep + long + arg
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def option_help_str (o): '''Transform one option description (4-tuple ) into neatly formatted string''' sh = ' ' if o[1]: sh = '-%s' % o[1] sep = ' ' if o[1] and o[2]: sep = ',' long = '' if o[2]: long= '--%s' % o[2] arg = '' if o[0]: if o[2]: arg = '=' arg = arg + o[0] return ' ' + sh + sep + long + arg
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
long= '--%s' % o[2]
long = '--%s' % o[2]
def option_help_str (o): '''Transform one option description (4-tuple ) into neatly formatted string''' sh = ' ' if o[1]: sh = '-%s' % o[1] sep = ' ' if o[1] and o[2]: sep = ',' long = '' if o[2]: long= '--%s' % o[2] arg = '' if o[0]: if o[2]: arg = '=' arg = arg + o[0] return ' ' + sh + sep + long + arg
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def option_help_str (o): '''Transform one option description (4-tuple ) into neatly formatted string''' sh = ' ' if o[1]: sh = '-%s' % o[1] sep = ' ' if o[1] and o[2]: sep = ',' long = '' if o[2]: long= '--%s' % o[2] arg = '' if o[0]: if o[2]: arg = '=' arg = arg + o[0] return ' ' + sh + sep + long + arg
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
strs =[]
strs = []
def options_help_str (opts): '''Convert a list of options into a neatly formatted string''' w = 0 strs =[] helps = [] for o in opts: s = option_help_str (o) strs.append ((s, o[3])) if len (s) > w: w = len (s) str = '' for s in strs: str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1]) return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1])
str = str + '%s%s%s\n' % (s[0], ' ' * (w - len (s[0]) + 3), s[1])
def options_help_str (opts): '''Convert a list of options into a neatly formatted string''' w = 0 strs =[] helps = [] for o in opts: s = option_help_str (o) strs.append ((s, o[3])) if len (s) > w: w = len (s) str = '' for s in strs: str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0]) + 3), s[1]) return str
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def help (): ls = [(_ ("Usage: %s [OPTION]... FILE...") % program_name), ('\n\n'), (help_summary), ('\n\n'), (_ ("Options:")), ('\n'), (options_help_str (option_definitions)), ('\n\n'), (_ ("Report bugs to %s") % 'hanwen@cs.uu.nl'), ('\n')] map (sys.stdout.write, ls)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
Create a temporary directory, and return its name.
Create a temporary directory, and return its name.
def setup_temp (): """ Create a temporary directory, and return its name. """ global temp_dir if not keep_temp_dir_p: temp_dir = tempfile.mktemp (program_name) try: os.mkdir (temp_dir, 0700) except OSError: pass return temp_dir
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
progress (_ ("Opening pipe `%s\'") % cmd)
progress (_ ("Opening pipe `%s\'") % cmd)
def popen (cmd, mode = 'r', ignore_error = 0): if verbose_p: progress (_ ("Opening pipe `%s\'") % cmd) pipe = os.popen (cmd, mode) if verbose_p: progress ('\n') return pipe
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def system (cmd, ignore_error = 0): """Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero. RETURN VALUE Exit status of CMD """ if verbose_p: progress (_ ("Invoking `%s\'\n") % cmd) st = os.system (cmd) if st: name = re.match ('[ \t]*([^ \t]*)', cmd).group (1) msg = name + ': ' + _ ("command ex...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def system (cmd, ignore_error = 0): """Run CMD. If IGNORE_ERROR is set, don't complain when CMD returns non zero. RETURN VALUE Exit status of CMD """ if verbose_p: progress (_ ("Invoking `%s\'\n") % cmd) st = os.system (cmd) if st: name = re.match ('[ \t]*([^ \t]*)', cmd).group (1) msg = name + ': ' + _ ("command ex...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
('MAG', '', 'magnification', _("Set magnification for MF to MAG (default: 1000).")),
('MAG', '', 'magnification', _ ("Set magnification for MF to MAG (default: 1000).")),
def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: e = '' return p + e
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
('','', 'afm', _("Generate AFM file (implies --simplify)")),
('', '', 'afm', _ ("Generate AFM file (implies --simplify)")),
def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: e = '' return p + e
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
('', '', 'simplify', _("Simplify using fontforge")), ('FILE', '', 'gffile', _("Use gf FILE instead of running Metafont")), ('DIR', 'I', 'include', _("Add to path for searching files")), ('LIST','', 'glyphs', _('Process only these glyphs. LIST is comma separated')), ('FILE', '', 'tfmfile' , _("Use FILE for the TFM file"...
('', '', 'simplify', _ ("Simplify using fontforge")), ('FILE', '', 'gffile', _ ("Use gf FILE instead of running Metafont")), ('DIR', 'I', 'include', _ ("Add to path for searching files")), ('LIST', '', 'glyphs', _ ('Process only these glyphs. LIST is comma separated')), ('FILE', '', 'tfmfile', _ ("Use FILE for the TFM ...
def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: e = '' return p + e
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
('', '', 'noround', _ ("Don't round coordinates of control points to integer values (use with --grid)")),
('', '', 'noround', _ ("Do not round coordinates of control points \n to integer values (use with --grid)")),
def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: e = '' return p + e
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: e = '' return p + e
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def strip_extension (f, ext): (p, e) = os.path.splitext (f) if e == ext: e = '' return p + e
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def find_file (nm): for d in include_dirs: p = os.path.join (d, nm) try: f = open (p) return p except IOError: pass p = popen ('kpsewhich %s' % nm).read ()[:-1] # urg. Did I do this ? if dos_kpath_p: orig = p def func(m): return string.lower (m.group(1)) p = string.lower (p) p = re.sub ('^([a-z]):', '/cygdrive/\\1', ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def find_file (nm): for d in include_dirs: p = os.path.join (d, nm) try: f = open (p) return p except IOError: pass p = popen ('kpsewhich %s' % nm).read ()[:-1] # urg. Did I do this ? if dos_kpath_p: orig = p def func(m): return string.lower (m.group(1)) p = string.lower (p) p = re.sub ('^([a-z]):', '/cygdrive/\\1', ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
orig = p def func(m): return string.lower (m.group(1))
orig = p def func (m): return string.lower (m.group (1))
def find_file (nm): for d in include_dirs: p = os.path.join (d, nm) try: f = open (p) return p except IOError: pass p = popen ('kpsewhich %s' % nm).read ()[:-1] # urg. Did I do this ? if dos_kpath_p: orig = p def func(m): return string.lower (m.group(1)) p = string.lower (p) p = re.sub ('^([a-z]):', '/cygdrive/\\1', ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
return trace_binary + opts + backend_options + " --output-file=char.eps %s " % fn
return trace_binary + opts + backend_options \ + " --output-file=char.eps %s " % fn
def autotrace_command (fn, opts): opts = " " + opts + " --background-color=FFFFFF --output-format=eps --input-format=pbm " return trace_binary + opts + backend_options + " --output-file=char.eps %s " % fn
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
+ ' -u %d ' % potrace_scale \ + backend_options + " -q -c --eps --output=char.eps %s " % (fn)
+ ' -u %d ' % potrace_scale \ + backend_options \ + " -q -c --eps --output=char.eps %s " % (fn)
def potrace_command (fn, opts): return trace_binary + opts \ + ' -u %d ' % potrace_scale \ + backend_options + " -q -c --eps --output=char.eps %s " % (fn)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
trace_binary = ''
trace_binary = ''
def potrace_command (fn, opts): return trace_binary + opts \ + ' -u %d ' % potrace_scale \ + backend_options + " -q -c --eps --output=char.eps %s " % (fn)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def potrace_command (fn, opts): return trace_binary + opts \ + ' -u %d ' % potrace_scale \ + backend_options + " -q -c --eps --output=char.eps %s " % (fn)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
Run tracer, do error handling
Run tracer, do error handling
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
sys.exit(2)
sys.exit (2)
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
if status <> 0:
if status != 0:
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
msg = """Trace failed on bitmap. Bitmap left in `%s\'
msg = """Trace failed on bitmap. Bitmap left in `%s\'
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
Please submit a bugreport to %s development.""" % (error_file, trace_command (error_file, ''), trace_binary)
Please submit a bugreport to %s development.""" \ % (error_file, trace_command (error_file, ''), trace_binary)
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
if status <> 0:
if status != 0:
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def trace_one (pbmfile, id): """ Run tracer, do error handling """ status = system (trace_command (pbmfile, ''), 1) if status == 2: sys.stderr.write ("\nUser interrupt. Exiting\n") sys.exit(2) if status == 0 and keep_temp_dir_p: shutil.copy2 (pbmfile, '%s.pbm' % id) shutil.copy2 ('char.eps', '%s.eps' % id) if statu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
Return FALSE if the glyph is not valid. """ command = "gf2pbm -n %d -o %s %s" %(char_number, outname, filename)
Return FALSE if the glyph is not valid. """ command = "gf2pbm -n %d -o %s %s" % (char_number, outname, filename)
def make_pbm (filename, outname, char_number): """ Extract bitmap from the PK file FILENAME (absolute) using `gf2pbm'. Return FALSE if the glyph is not valid. """ command = "gf2pbm -n %d -o %s %s" %(char_number, outname, filename) status = system (command, ignore_error = 1) return (status == 0)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
return (status == 0)
return (status == 0)
def make_pbm (filename, outname, char_number): """ Extract bitmap from the PK file FILENAME (absolute) using `gf2pbm'. Return FALSE if the glyph is not valid. """ command = "gf2pbm -n %d -o %s %s" %(char_number, outname, filename) status = system (command, ignore_error = 1) return (status == 0)
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
sys.stderr.write(_("Using encoding file: `%s'\n") % file)
sys.stderr.write (_ ("Using encoding file: `%s'\n") % file)
def read_encoding (file): sys.stderr.write(_("Using encoding file: `%s'\n") % file) str = open (file).read () str = re.sub ("%.*", '', str) str = re.sub ("[\n\t \f]+", ' ', str) m = re.search ('/([^ ]+) \[([^\]]+)\] def', str) if not m: raise 'Encoding file invalid.' name = m.group (1) cod = m.group (2) cod = re.sub ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
name = m.group (1)
name = m.group (1)
def read_encoding (file): sys.stderr.write(_("Using encoding file: `%s'\n") % file) str = open (file).read () str = re.sub ("%.*", '', str) str = re.sub ("[\n\t \f]+", ' ', str) m = re.search ('/([^ ]+) \[([^\]]+)\] def', str) if not m: raise 'Encoding file invalid.' name = m.group (1) cod = m.group (2) cod = re.sub ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
cod = re.sub ('[ /]+', ' ',cod)
cod = re.sub ('[ /]+', ' ', cod)
def read_encoding (file): sys.stderr.write(_("Using encoding file: `%s'\n") % file) str = open (file).read () str = re.sub ("%.*", '', str) str = re.sub ("[\n\t \f]+", ' ', str) m = re.search ('/([^ ]+) \[([^\]]+)\] def', str) if not m: raise 'Encoding file invalid.' name = m.group (1) cod = m.group (2) cod = re.sub ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def zip_to_pairs(as):
def zip_to_pairs (as):
def read_encoding (file): sys.stderr.write(_("Using encoding file: `%s'\n") % file) str = open (file).read () str = re.sub ("%.*", '', str) str = re.sub ("[\n\t \f]+", ' ', str) m = re.search ('/([^ ]+) \[([^\]]+)\] def', str) if not m: raise 'Encoding file invalid.' name = m.group (1) cod = m.group (2) cod = re.sub ...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
while as : r.append((as[0], as[1]))
while as: r.append ((as[0], as[1]))
def zip_to_pairs(as): r = [] while as : r.append((as[0], as[1])) as = as[2:] return r
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
l = []
lst = []
def unzip_pairs (tups): l = [] while tups: l = l + list (tups[0]) tups = tups[1:] return l
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
l = l + list (tups[0])
lst = lst + list (tups[0])
def unzip_pairs (tups): l = [] while tups: l = l + list (tups[0]) tups = tups[1:] return l
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
return l
return lst
def unzip_pairs (tups): l = [] while tups: l = l + list (tups[0]) tups = tups[1:] return l
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics)
inv_scale = 1000.0 / magnification (size_y, size_x, off_x, off_y) = map (lambda m, s = inv_scale: m * s, bitmap_metrics)
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n':
bbox = (10000, 10000, -10000, -10000) while ls and ls[0] != '*u\n':
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
while ls[0] <> '*U\n': l = ls[0]
while ls[0] != '*U\n': ell = ls[0]
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
toks = string.split (l) if len(toks) < 1:
toks = string.split (ell) if len (toks) < 1:
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
cmd= toks[-1] args = map (lambda m, s=inv_scale : s * string.atof(m), toks[:-1])
cmd = toks[-1] args = map (lambda m, s = inv_scale: s * string.atof (m), toks[:-1])
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
else :
else:
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
commands.append ((cmd,args))
commands.append ((cmd, args))
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
'f': 'closepath' ,
'f': 'closepath',
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
bbox = (10000,10000,-10000,-10000) for (c,args) in commands:
bbox = (10000, 10000, -10000, -10000) for (c, args) in commands:
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
na.append( (nx -cx, ny -cy) )
na.append ((nx - cx, ny - cy))
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
a = map (lambda x: '%d' % int (round (x)), unzip_pairs (a)) else : a = map (lambda x: '%d %d div' % (int (round (x * potrace_scale/inv_scale)), int( round (potrace_scale/inv_scale))), unzip_pairs (a)) t1_outline = t1_outline + ' %s %s\n' % (string.join (a),c)
a = map (lambda x: '%d' % int (round (x)), unzip_pairs (a)) else: a = map (lambda x: '%d %d div' \ % (int (round (x * potrace_scale/inv_scale)), int (round (potrace_scale/inv_scale))), unzip_pairs (a)) t1_outline = t1_outline + ' %s %s\n' % (string.join (a), c)
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
def autotrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x,off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '*u\n': ls = ls[1:] if ls == []: return (bb...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
inv_scale = 1000.0/magnification (size_y, size_x, off_x, off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics)
inv_scale = 1000.0 / magnification (size_y, size_x, off_x, off_y) = map (lambda m, s = inv_scale: m * s, bitmap_metrics)
def potrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x, off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '0 setgray\n': ls = ls[1:] if ls == []: retu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '0 setgray\n':
bbox = (10000, 10000, -10000, -10000) while ls and ls[0] != '0 setgray\n':
def potrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x, off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '0 setgray\n': ls = ls[1:] if ls == []: retu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py
while ls and ls[0] <> 'grestore\n': l = ls[0]
while ls and ls[0] != 'grestore\n': ell = ls[0]
def potrace_path_to_type1_ops (at_file, bitmap_metrics, tfm_wid): inv_scale = 1000.0/magnification (size_y, size_x, off_x, off_y)= map(lambda m, s=inv_scale : m * s, bitmap_metrics) ls = open (at_file).readlines () bbox = (10000,10000,-10000,-10000) while ls and ls[0] <> '0 setgray\n': ls = ls[1:] if ls == []: retu...
d96cc8339091f674ea0fc313632dcc5c333eeb78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/d96cc8339091f674ea0fc313632dcc5c333eeb78/mftrace.py