Remove commented out print statements.
This commit is contained in:
parent
402cbed8fa
commit
bc340fbf0d
35 changed files with 0 additions and 103 deletions
|
|
@ -134,10 +134,8 @@ class ANSIParser(object):
|
|||
|
||||
if convert:
|
||||
colval = 16 + (red * 36) + (green * 6) + blue
|
||||
#print "RGB colours:", red, green, blue
|
||||
return "\033[%s8;5;%s%s%sm" % (3 + int(background), colval/100, (colval % 100)/10, colval%10)
|
||||
else:
|
||||
#print "ANSI convert:", red, green, blue
|
||||
# xterm256 not supported, convert the rgb value to ansi instead
|
||||
if red == green and red == blue and red < 2:
|
||||
if background:
|
||||
|
|
|
|||
|
|
@ -245,8 +245,6 @@ class EvForm(object):
|
|||
ix0 = match.end()
|
||||
else:
|
||||
break
|
||||
#print "cell_coords:", cell_coords
|
||||
#print "table_coords:", table_coords
|
||||
|
||||
# get rectangles and assign EvCells
|
||||
for key, (iy, leftix, rightix) in cell_coords.items():
|
||||
|
|
@ -255,7 +253,6 @@ class EvForm(object):
|
|||
dy_up = 0
|
||||
if iy > 0:
|
||||
for i in range(1,iy):
|
||||
#print "dy_up:", [form[iy-i][ix] for ix in range(leftix, rightix)]
|
||||
if all(form[iy-i][ix] == cellchar for ix in range(leftix, rightix)):
|
||||
dy_up += 1
|
||||
else:
|
||||
|
|
@ -264,7 +261,6 @@ class EvForm(object):
|
|||
dy_down = 0
|
||||
if iy < nform-1:
|
||||
for i in range(1,nform-iy-1):
|
||||
#print "dy_down:", [form[iy+i][ix]for ix in range(leftix, rightix)]
|
||||
if all(form[iy+i][ix] == cellchar for ix in range(leftix, rightix)):
|
||||
dy_down += 1
|
||||
else:
|
||||
|
|
@ -279,13 +275,10 @@ class EvForm(object):
|
|||
# we have all the coordinates we need. Create EvCell.
|
||||
data = self.cells_mapping.get(key, "")
|
||||
#if key == "1":
|
||||
# print "creating cell '%s' (%s):" % (key, data)
|
||||
# print "iy=%s, iyup=%s, iydown=%s, leftix=%s, rightix=%s, width=%s, height=%s" % (iy, iyup, iydown, leftix, rightix, width, height)
|
||||
|
||||
options = { "pad_left":0, "pad_right":0, "pad_top":0, "pad_bottom":0, "align":"l", "valign":"t", "enforce_size":True}
|
||||
options.update(custom_options)
|
||||
#if key=="4":
|
||||
#print "options:", options
|
||||
|
||||
mapping[key] = (iyup, leftix, width, height, EvCell(data, width=width, height=height,**options))
|
||||
|
||||
|
|
@ -296,7 +289,6 @@ class EvForm(object):
|
|||
dy_up = 0
|
||||
if iy > 0:
|
||||
for i in range(1,iy):
|
||||
#print "dy_up:", [form[iy-i][ix] for ix in range(leftix, rightix)]
|
||||
if all(form[iy-i][ix] == tablechar for ix in range(leftix, rightix)):
|
||||
dy_up += 1
|
||||
else:
|
||||
|
|
@ -305,7 +297,6 @@ class EvForm(object):
|
|||
dy_down = 0
|
||||
if iy < nform-1:
|
||||
for i in range(1,nform-iy-1):
|
||||
#print "dy_down:", [form[iy+i][ix]for ix in range(leftix, rightix)]
|
||||
if all(form[iy+i][ix] == tablechar for ix in range(leftix, rightix)):
|
||||
dy_down += 1
|
||||
else:
|
||||
|
|
@ -319,13 +310,10 @@ class EvForm(object):
|
|||
|
||||
# we have all the coordinates we need. Create Table.
|
||||
table = self.tables_mapping.get(key, None)
|
||||
#print "creating table '%s' (%s):" % (key, data)
|
||||
#print "iy=%s, iyup=%s, iydown=%s, leftix=%s, rightix=%s, width=%s, height=%s" % (iy, iyup, iydown, leftix, rightix, width, height)
|
||||
|
||||
options = { "pad_left":0, "pad_right":0, "pad_top":0, "pad_bottom":0,
|
||||
"align":"l", "valign":"t", "enforce_size":True}
|
||||
options.update(custom_options)
|
||||
#print "options:", options
|
||||
|
||||
if table:
|
||||
table.reformat(width=width, height=height, **options)
|
||||
|
|
|
|||
|
|
@ -1224,9 +1224,6 @@ class EvTable(object):
|
|||
self._borders()
|
||||
|
||||
# equalize widths within each column
|
||||
#print [col.options for col in self.worktable]
|
||||
#print [[cell.get_width() for cell in col] for col in self.worktable]
|
||||
#print [[cell.get_height() for cell in col] for col in self.worktable]
|
||||
cwidths = [max(cell.get_width() for cell in col) for col in self.worktable]
|
||||
|
||||
if self.width or self.maxwidth and self.maxwidth < sum(cwidths):
|
||||
|
|
@ -1280,7 +1277,6 @@ class EvTable(object):
|
|||
# get minimum possible cell heights for each collumn
|
||||
cheights_min = [max(cell.get_min_height() for cell in (col[iy] for col in self.worktable)) for iy in xrange(nrowmax)]
|
||||
chmin = sum(cheights_min)
|
||||
#print "cheights_min:", cheights_min
|
||||
|
||||
if chmin > self.height:
|
||||
# we cannot shrink any more
|
||||
|
|
@ -1308,7 +1304,6 @@ class EvTable(object):
|
|||
|
||||
# we must tell cells to crop instead of expanding
|
||||
options["enforce_size"] = True
|
||||
#print "cheights2:", cheights
|
||||
|
||||
# reformat table (for vertical align)
|
||||
for ix, col in enumerate(self.worktable):
|
||||
|
|
@ -1322,7 +1317,6 @@ class EvTable(object):
|
|||
# calculate actual table width/height in characters
|
||||
self.cwidth = sum(cwidths)
|
||||
self.cheight = sum(cheights)
|
||||
#print "actual table width, height:", self.cwidth, self.cheight, self.width, self.height
|
||||
|
||||
def _generate_lines(self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -60,12 +60,9 @@ class SharedMemoryModelBase(ModelBase):
|
|||
|
||||
instance_key = cls._get_cache_key(args, kwargs)
|
||||
# depending on the arguments, we might not be able to infer the PK, so in that case we create a new instance
|
||||
#print "SharedMemoryModelBase.__call__ 1: calledby:", calledby(3)
|
||||
#print "SharedMemoryModelBase.__call__ 2: instance_key:", instance_key
|
||||
if instance_key is None:
|
||||
return new_instance()
|
||||
cached_instance = cls.get_cached_instance(instance_key)
|
||||
#print "SharedMemoryModelBase.__call__ 3: cached_instance:", cached_instance
|
||||
if cached_instance is None:
|
||||
cached_instance = new_instance()
|
||||
cls.cache_instance(cached_instance, new=True)
|
||||
|
|
@ -113,7 +110,6 @@ class SharedMemoryModelBase(ModelBase):
|
|||
"Helper method to create property wrappers with unique names (must be in separate call)"
|
||||
def _get(cls, fname):
|
||||
"Wrapper for getting database field"
|
||||
#print "_get:", fieldname, wrappername,_GA(cls,fieldname)
|
||||
if _GA(cls, "_is_deleted"):
|
||||
raise ObjectDoesNotExist("Cannot access %s: Hosting object was already deleted." % fname)
|
||||
return _GA(cls, fieldname)
|
||||
|
|
@ -195,12 +191,9 @@ class SharedMemoryModelBase(ModelBase):
|
|||
for fieldname, field in ((fname, field) for fname, field in attrs.items()
|
||||
if fname.startswith("db_") and type(field).__name__ != "ManyToManyField"):
|
||||
foreignkey = type(field).__name__ == "ForeignKey"
|
||||
#print fieldname, type(field).__name__, field
|
||||
wrappername = "dbid" if fieldname == "id" else fieldname.replace("db_", "", 1)
|
||||
#print fieldname, wrappername
|
||||
if wrappername not in attrs:
|
||||
# makes sure not to overload manually created wrappers on the model
|
||||
#print "wrapping %s -> %s" % (fieldname, wrappername)
|
||||
create_wrapper(cls, fieldname, wrappername, editable=field.editable, foreignkey=foreignkey)
|
||||
|
||||
return super(SharedMemoryModelBase, cls).__new__(cls, name, bases, attrs)
|
||||
|
|
@ -451,9 +444,7 @@ def flush_cache(**kwargs):
|
|||
else:
|
||||
yield cls
|
||||
|
||||
#print "start flush ..."
|
||||
for cls in class_hierarchy([SharedMemoryModel]):
|
||||
#print cls
|
||||
cls.flush_instance_cache()
|
||||
# run the python garbage collector
|
||||
return gc.collect()
|
||||
|
|
|
|||
|
|
@ -1008,8 +1008,6 @@ class PrettyTable(object):
|
|||
if self.rowcount == 0 and (not options["print_empty"] or not options["border"]):
|
||||
return ""
|
||||
|
||||
#print "prettytable:", self._rows
|
||||
|
||||
# Get the rows we need to print, taking into account slicing, sorting, etc.
|
||||
rows = self._get_rows(options)
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,6 @@ class TestCrop(TestCase):
|
|||
|
||||
class TestDedent(TestCase):
|
||||
def test_dedent(self):
|
||||
#print "Did TestDedent run?"
|
||||
# Empty string, return empty string
|
||||
self.assertEqual("", utils.dedent(""))
|
||||
# No leading whitespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue