"""Disassembler of Python byte code into mnemonics."""
import sys
-import string
import types
__all__ = ["dis","disassemble","distb","disco","opname","cmp_op",
else: print ' ',
if i in labels: print '>>',
else: print ' ',
- print string.rjust(`i`, 4),
- print string.ljust(opname[op], 20),
+ print `i`.rjust(4),
+ print opname[op].ljust(20),
i = i+1
if op >= HAVE_ARGUMENT:
oparg = ord(code[i]) + ord(code[i+1])*256 + extended_arg
i = i+2
if op == EXTENDED_ARG:
extended_arg = oparg*65536L
- print string.rjust(`oparg`, 5),
+ print `oparg`.rjust(5),
if op in hasconst:
print '(' + `co.co_consts[oparg]` + ')',
elif op in hasname:
"""
-import string
from sgmllib import SGMLParser
from formatter import AS_IS
data = self.savedata
self.savedata = None
if not self.nofill:
- data = string.join(string.split(data))
+ data = ' '.join(data.split())
return data
# --- Hooks for anchors; should probably be overridden
name = ''
type = ''
for attrname, value in attrs:
- value = string.strip(value)
+ value = value.strip()
if attrname == 'href':
href = value
if attrname == 'name':
name = value
if attrname == 'type':
- type = string.lower(value)
+ type = value.lower()
self.anchor_bgn(href, name, type)
def end_a(self):
if attrname == 'src':
src = value
if attrname == 'width':
- try: width = string.atoi(value)
+ try: width = int(value)
except: pass
if attrname == 'height':
- try: height = string.atoi(value)
+ try: height = int(value)
except: pass
self.handle_image(src, alt, ismap, align, width, height)
import os
import time
-import string
import marshal
import re
return self
def print_call_heading(self, name_size, column_title):
- print string.ljust("Function ", name_size) + column_title
+ print "Function ".ljust(name_size) + column_title
def print_call_line(self, name_size, source, call_dict):
- print string.ljust(func_std_string(source), name_size),
+ print func_std_string(source).ljust(name_size),
if not call_dict:
print "--"
return
def print_title(self):
- print string.rjust('ncalls', 9),
- print string.rjust('tottime', 8),
- print string.rjust('percall', 8),
- print string.rjust('cumtime', 8),
- print string.rjust('percall', 8),
+ print 'ncalls'.rjust(9),
+ print 'tottime'.rjust(8),
+ print 'percall'.rjust(8),
+ print 'cumtime'.rjust(8),
+ print 'percall'.rjust(8),
print 'filename:lineno(function)'
c = `nc`
if nc != cc:
c = c + '/' + `cc`
- print string.rjust(c, 9),
+ print c.rjust(9),
print f8(tt),
if nc == 0:
print ' '*8,
#**************************************************************************
def f8(x):
- return string.rjust(fpformat.fix(x, 3), 8)
+ return fpformat.fix(x, 3).rjust(8)