Remove commented out print statements.

This commit is contained in:
Ahmed Charles 2015-10-18 23:09:42 +00:00 committed by Griatch
parent 402cbed8fa
commit bc340fbf0d
35 changed files with 0 additions and 103 deletions

View file

@ -296,7 +296,6 @@ def get_and_merge_cmdsets(caller, session, player, obj,
tempmergers = {}
for cmdset in cmdsets:
prio = cmdset.priority
#print cmdset.key, prio
if prio in tempmergers:
# merge same-prio cmdset together separately
tempmergers[prio] = yield cmdset + tempmergers[prio]
@ -309,8 +308,6 @@ def get_and_merge_cmdsets(caller, session, player, obj,
# Merge all command sets into one, beginning with the lowest-prio one
cmdset = cmdsets[0]
for merging_cmdset in cmdsets[1:]:
#print "<%s(%s,%s)> onto <%s(%s,%s)>" % (merging_cmdset.key, merging_cmdset.priority, merging_cmdset.mergetype,
# cmdset.key, cmdset.priority, cmdset.mergetype)
cmdset = yield merging_cmdset + cmdset
# store the full sets for diagnosis
cmdset.merged_from = cmdsets
@ -321,7 +318,6 @@ def get_and_merge_cmdsets(caller, session, player, obj,
for cset in (cset for cset in local_obj_cmdsets if cset):
cset.duplicates = cset.old_duplicates
#print "merged set:", cmdset.key
returnValue(cmdset)
except ErrorReported:
raise

View file

@ -490,7 +490,6 @@ class CmdSet(object):
commands.append(cmd)
# extra run to make sure to avoid doublets
self.commands = list(set(commands))
#print "In cmdset.add(cmd):", self.key, cmd
# add system_command to separate list as well,
# for quick look-up
if cmd.key.startswith("__"):

View file

@ -127,7 +127,6 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
try:
# first try to get from cache
#print "importing %s: _CACHED_CMDSETS=%s" % (python_path, _CACHED_CMDSETS)
cmdsetclass = _CACHED_CMDSETS.get(python_path, None)
if not cmdsetclass:
@ -243,7 +242,6 @@ class CmdSetHandler(object):
mergelist = []
if len(self.cmdset_stack) > 1:
# We have more than one cmdset in stack; list them all
#print self.cmdset_stack, self.mergetype_stack
for snum, cmdset in enumerate(self.cmdset_stack):
mergetype = self.mergetype_stack[snum]
permstring = "non-perm"
@ -310,7 +308,6 @@ class CmdSetHandler(object):
if init_mode:
# reimport all permanent cmdsets
storage = self.obj.cmdset_storage
#print "cmdset_storage:", self.obj.cmdset_storage
if storage:
self.cmdset_stack = []
for pos, path in enumerate(storage):

View file

@ -198,7 +198,6 @@ class CmdBan(MuxCommand):
# replace * with regex form and compile it
ipregex = ban.replace('.', '\.')
ipregex = ipregex.replace('*', '[0-9]{1,3}')
#print "regex:",ipregex
ipregex = re.compile(r"%s" % ipregex)
bantup = ("", ban, ipregex, now, reason)
# save updated banlist

View file

@ -2416,7 +2416,6 @@ class CmdTag(MuxCommand):
category = None
if ":" in tag:
tag, category = [part.strip() for part in tag.split(":", 1)]
#print "tag search:", tag, search_category
objs = search.search_tag(tag, category=category)
nobjs = len(objs)
if nobjs > 0:

View file

@ -267,13 +267,11 @@ class CmdChannels(MuxPlayerCommand):
# all channels we have available to listen to
channels = [chan for chan in ChannelDB.objects.get_all_channels()
if chan.access(caller, 'listen')]
#print channels
if not channels:
self.msg("No channels available.")
return
# all channel we are already subscribed to
subs = ChannelDB.objects.get_subscriptions(caller)
#print subs
if self.cmdstring == "comlist":
# just display the subscribed channels with no extra info

View file

@ -233,7 +233,6 @@ class CmdGet(MuxCommand):
if not self.args:
caller.msg("Get what?")
return
#print "general/get:", caller, caller.location, self.args, caller.location.contents
obj = caller.search(self.args, location=caller.location)
if not obj:
return

View file

@ -100,7 +100,6 @@ class MuxCommand(Command):
switches = []
if args and len(args) > 1 and args[0] == "/":
# we have a switch, or a set of switches. These end with a space.
#print "'%s'" % args
switches = args[1:].split(None, 1)
if len(switches) > 1:
switches, args = switches

View file

@ -592,7 +592,6 @@ class CmdColorTest(MuxPlayerCommand):
string = "ANSI colors:"
for row in table:
string += "\n " + " ".join(row)
#print string
self.msg(string)
self.msg("{{X : black. {{/ : return, {{- : tab, {{_ : space, {{* : invert, {{u : underline")
self.msg("To combine background and foreground, add background marker last, e.g. {{r{{[b.")

View file

@ -74,7 +74,6 @@ class CmdOOCLook(default_cmds.CmdLook):
self.character = None
if utils.inherits_from(self.caller, "evennia.objects.objects.Object"):
# An object of some type is calling. Convert to player.
#print self.caller, self.caller.__class__
self.character = self.caller
if hasattr(self.caller, "player"):
self.caller = self.caller.player
@ -151,7 +150,6 @@ class CmdOOCCharacterCreate(Command):
self.character = None
if utils.inherits_from(self.caller, "evennia.objects.objects.Object"):
# An object of some type is calling. Convert to player.
#print self.caller, self.caller.__class__
self.character = self.caller
if hasattr(self.caller, "player"):
self.caller = self.caller.player

View file

@ -335,7 +335,6 @@ def parse_sdescs_and_recogs(sender, candidates, string, search_mode=False):
# we scan backwards so we can replace in-situ without messing
# up later occurrences. Given a marker match, query from
# start index forward for all candidates.
#print "marker_match:", marker_match.re.pattern, marker_match.groups()
# first see if there is a number given (e.g. 1-tall)
num_identifier, _ = marker_match.groups("") # return "" if no match, rather than None

View file

@ -79,7 +79,6 @@ class OpenLidState(DefaultScript):
automatically checked, so we don't need to worry about
adding the cmdset to a closed lid-button.
"""
#print "In Open at_start (should add cmdset)"
self.obj.cmdset.add(cmdsetexamples.LidOpenCmdSet)
def is_valid(self):
@ -215,7 +214,6 @@ class BlinkButtonEvent(DefaultScript):
"""
Button will keep blinking unless it is broken.
"""
#print "self.obj.db.lamp_works:", self.obj.db.lamp_works
return self.obj.db.lamp_works
def at_repeat(self):

View file

@ -585,7 +585,6 @@ class DefaultObject(ObjectDB):
# Perform move
try:
#print "move_to location:", destination
self.location = destination
except Exception:
emit_to_obj.msg(errtxt % "location change")

View file

@ -197,7 +197,6 @@ class ScriptDBManager(TypedObjectManager):
if dbref and self.dbref(dbref, reqhash=False):
scripts = self.get_id(dbref)
elif obj:
#print "calling get_all_scripts_on_obj", obj, key, VALIDATE_ITERATION
scripts = self.get_all_scripts_on_obj(obj, key=key)
else:
scripts = self.get_all_scripts(key=key) #self.model.get_all_cached_instances()
@ -207,12 +206,9 @@ class ScriptDBManager(TypedObjectManager):
VALIDATE_ITERATION -= 1
return None, None
#print "scripts to validate: [%s]" % (", ".join(script.key for script in scripts))
for script in scripts:
#print "validating %s (%i) (init_mode=%s)" % (script.key, id(script), init_mode)
if script.is_valid():
nr_started += script.start(force_restart=init_mode)
#print "back from start. nr_started=", nr_started
else:
script.stop()
nr_stopped += 1

View file

@ -226,7 +226,6 @@ class DefaultScript(ScriptBase):
callcount = self.ndb._task.callcount
maxcount = self.db_repeats
if maxcount > 0 and maxcount <= callcount:
#print "stopping script!"
self.stop()
def _step_task(self):

View file

@ -344,7 +344,6 @@ class TickerHandler(object):
ticker_storage = ServerConfig.objects.conf(key=self.save_name)
if ticker_storage:
self.ticker_storage = dbunserialize(ticker_storage)
#print "restore:", self.ticker_storage
for store_key, (args, kwargs) in self.ticker_storage.items():
obj, interval, idstring = store_key
obj = unpack_dbobj(obj)

View file

@ -101,7 +101,6 @@ class AmpServerFactory(protocol.ServerFactory):
protocol (Protocol): The created protocol.
"""
#print "Evennia Server connected to Portal at %s." % addr
self.server.amp_protocol = AMPProtocol()
self.server.amp_protocol.factory = self
return self.server.amp_protocol
@ -139,7 +138,6 @@ class AmpClientFactory(protocol.ReconnectingClientFactory):
"""
pass
#print 'AMP started to connect:', connector
def buildProtocol(self, addr):
"""
@ -149,7 +147,6 @@ class AmpClientFactory(protocol.ReconnectingClientFactory):
addr (str): Connection address. Not used.
"""
#print "Portal connected to Evennia server at %s." % addr
self.resetDelay()
self.portal.amp_protocol = AMPProtocol()
self.portal.amp_protocol.factory = self
@ -417,7 +414,6 @@ class AMPProtocol(amp.AMP):
"""
sessid, kwargs = loads(packed_data)
#print "msg portal -> server (server side):", sessid, msg, loads(ret["data"])
self.factory.server.sessions.data_in(sessid, **kwargs)
return {}
@ -434,7 +430,6 @@ class AMPProtocol(amp.AMP):
deferred (Deferred): Asynchronous return.
"""
#print "msg portal->server (portal side):", sessid, msg, data
return self.send_data(MsgPortal2Server, sessid, text=text, **kwargs)
# Server -> Portal message
@ -454,7 +449,6 @@ class AMPProtocol(amp.AMP):
packed_data (str): Pickled data (sessid, kwargs) coming over the wire.
"""
sessid, kwargs = loads(packed_data)
#print "msg server->portal (portal side):", sessid, ret["text"], loads(ret["data"])
self.factory.portal.sessions.data_out(sessid, **kwargs)
return {}
@ -470,7 +464,6 @@ class AMPProtocol(amp.AMP):
kwargs (any, optiona): Extra data.
"""
#print "msg server->portal (server side):", sessid, msg, data
return self.send_data(MsgServer2Portal, sessid, text=text, **kwargs)
# Server administration from the Portal side
@ -485,12 +478,10 @@ class AMPProtocol(amp.AMP):
packed_data (str): Incoming, pickled data.
"""
#print "serveradmin (server side):", hashid, ipart, nparts
sessid, kwargs = loads(packed_data)
operation = kwargs.pop("operation", "")
server_sessionhandler = self.factory.server.sessions
#print "serveradmin (server side):", sessid, ord(operation), data
if operation == PCONN: # portal_session_connect
# create a new session and sync it
@ -527,7 +518,6 @@ class AMPProtocol(amp.AMP):
data (str or dict, optional): Data used in the administrative operation.
"""
#print "serveradmin (portal side):", sessid, ord(operation), data
return self.send_data(AdminPortal2Server, sessid, operation=operation, **kwargs)
# Portal administraton from the Server side
@ -543,7 +533,6 @@ class AMPProtocol(amp.AMP):
packed_data (str): Data received, a pickled tuple (sessid, kwargs).
"""
#print "portaladmin (portal side):", sessid, ord(operation), data
sessid, kwargs = loads(packed_data)
operation = kwargs.pop("operation")
portal_sessionhandler = self.factory.portal.sessions

View file

@ -198,14 +198,11 @@ def handle_setup(last_step):
at_initial_setup,
reset_server]
#print " Initial setup: %s steps." % (len(setup_queue))
# step through queue, from last completed function
for num, setup_func in enumerate(setup_queue[last_step:]):
# run the setup function. Note that if there is a
# traceback we let it stop the system so the config
# step is not saved.
#print "%s..." % num
try:
setup_func()

View file

@ -198,7 +198,6 @@ def oob_send(session, *args, **kwargs):
if obj:
for name in (a.upper() for a in args if a):
try:
#print "MSDP SEND inp:", name
value = OOB_SENDABLE.get(name, _NA)(obj)
ret[name] = value
except Exception as e:
@ -257,7 +256,6 @@ def oob_report(session, *args, **kwargs):
else:
OOB_HANDLER.add_attribute_monitor(obj, session.sessid, propname, "return_attribute_report")
ret.append(_GA(obj, "db_value"))
#print "ret:", ret
session.msg(oob=("MSDP_ARRAY", ret))
else:
oob_error(session, "You must log in first.")

View file

@ -448,7 +448,6 @@ class OOBHandler(TickerHandler):
(session, oobfuncname, args, kwargs)
raise RuntimeError(errmsg)
#print "execute_oob:", session, oobfuncname, args, kwargs
try:
oobfunc = _OOB_FUNCS[oobfuncname]
except Exception:

View file

@ -110,7 +110,6 @@ class PortalSessionHandler(SessionHandler):
self.sessions[session.sessid] = session
session.server_connected = True
#print "connecting", session.sessid, " number:", len(self.sessions)
self.portal.amp_protocol.send_AdminPortal2Server(session.sessid,
operation=PCONN,
sessiondata=sessdata)
@ -389,7 +388,6 @@ class PortalSessionHandler(SessionHandler):
# data throttle (anti DoS measure)
now = time()
dT = now - self.command_counter_reset
#print " command rate:", _MAX_COMMAND_RATE / dT, dT, self.command_counter
self.command_counter = 0
self.command_counter_reset = now
self.command_overflow = dT < 1.0
@ -431,9 +429,7 @@ class PortalSessionHandler(SessionHandler):
if session:
# convert oob to the generic format
if "oob" in kwargs:
#print "oobstruct_parser in:", kwargs["oob"]
kwargs["oob"] = self.oobstruct_parser(kwargs["oob"])
#print "oobstruct_parser out:", kwargs["oob"]
session.data_out(text=text, **kwargs)
PORTAL_SESSIONS = PortalSessionHandler()

View file

@ -54,7 +54,6 @@ def verify_SSL_key_and_cert(keyfile, certfile):
# default:
#openssl req -new -x509 -key ssl.key -out ssl.cert -days 7300
exestring = "openssl req -new -x509 -key %s -out %s -days %s" % (keyfile, certfile, CERT_EXPIRE)
#print "exestring:", exestring
try:
#, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
subprocess.call(exestring)

View file

@ -165,7 +165,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
"""
if data and data[0] == IAC or self.iaw_mode:
try:
#print "IAC mode"
super(TelnetProtocol, self).dataReceived(data)
if len(data) == 1:
self.iaw_mode = True
@ -196,12 +195,10 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
# if we get to this point the command should end with a linebreak.
# We make sure to add it, to fix some clients messing this up.
#print "line data in:", repr(data)
StatefulTelnetProtocol.dataReceived(self, data)
def _write(self, data):
"hook overloading the one used in plain telnet"
# print "_write (%s): %s" % (self.state, " ".join(str(ord(c)) for c in data))
data = data.replace('\n', '\r\n').replace('\r\r\n', '\r\n')
#data = data.replace('\n', '\r\n')
super(TelnetProtocol, self)._write(mccp_compress(self, data))
@ -214,7 +211,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
line (str): Line to send.
"""
#print "sendLine (%s):\n%s" % (self.state, line)
#escape IAC in line mode, and correctly add \r\n
line += self.delimiter
line = line.replace(IAC, IAC + IAC).replace('\n', '\r\n')
@ -305,7 +301,6 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
if "oob" in kwargs and "OOB" in self.protocol_flags:
# oob is a list of [(cmdname, arg, kwarg), ...]
for cmdname, args, okwargs in kwargs["oob"]:
#print "telnet oob data_out:", cmdname, args, kwargs
self.oob.data_out(cmdname, *args, **okwargs)
# parse **kwargs, falling back to ttype if nothing is given explicitly
@ -318,15 +313,12 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
echo = kwargs.get("echo", None)
mxp = kwargs.get("mxp", self.protocol_flags.get("MXP", False))
#print "telnet kwargs=%s, message=%s" % (kwargs, text)
#print "xterm256=%s, useansi=%s, raw=%s, nomarkup=%s, init_done=%s" % (xterm256, useansi, raw, nomarkup, ttype.get("init_done"))
if raw:
# no processing whatsoever
self.sendLine(text)
elif text:
# we need to make sure to kill the color at the end in order
# to match the webclient output.
#print "telnet data out:", self.protocol_flags, id(self.protocol_flags), id(self), "nomarkup: %s, xterm256: %s" % (nomarkup, xterm256)
linetosend = ansi.parse_ansi(_RE_N.sub("", text) + "{n", strip_ansi=nomarkup, xterm256=xterm256, mxp=mxp)
if mxp:
linetosend = mxp_parse(linetosend)

View file

@ -160,7 +160,6 @@ class TelnetOOB(object):
else:
msdp_string = "%s%s%s" % (MSDP_VAR. cmdname, "".join(
["%s%s%s%s" % (MSDP_VAR, key, MSDP_VAL, val) for key, val in kwargs.items()]))
#print "encode msdp result:", cmdname, args, kwargs, "->", msdp_string
return force_str(msdp_string)
def encode_gmcp(self, cmdname, *args, **kwargs):
@ -194,7 +193,6 @@ class TelnetOOB(object):
gmcp_string = "%s %s" % (cmdname, json.dumps(args))
elif kwargs:
gmcp_string = "%s %s" % (cmdname, json.dumps(kwargs))
#print "gmcp_encode", cmdname, args, kwargs, "->", gmcp_string
return force_str(gmcp_string).strip()
def decode_msdp(self, data):
@ -233,8 +231,6 @@ class TelnetOOB(object):
parts = msdp_regex_val.split(varval)
variables[parts[0]] = tuple(parts[1:]) if len(parts) > 1 else ("", )
#print "OOB: MSDP decode:", data, "->", variables, arrays, tables
# send to the sessionhandler
if data:
for varname, var in variables.items():
@ -263,7 +259,6 @@ class TelnetOOB(object):
if hasattr(data, "__iter__"):
data = "".join(data)
#print "decode_gmcp:", data
if data:
splits = data.split(None, 1)
cmdname = splits[0]
@ -282,7 +277,6 @@ class TelnetOOB(object):
args = tuple(struct)
else:
args = (struct,)
#print "gmcp decode:", data, "->", cmdname, args, kwargs
self.protocol.data_in(oob=(cmdname, args, kwargs))
# access methods
@ -296,7 +290,6 @@ class TelnetOOB(object):
args, kwargs (any): Arguments to OOB command.
"""
#print "data_out:", encoded_oob
if self.MSDP:
encoded_oob = self.encode_msdp(cmdname, *args, **kwargs)
self.protocol._write(IAC + SB + MSDP + encoded_oob + IAC + SE)

View file

@ -90,8 +90,6 @@ class Ttype(object):
except TypeError:
pass
#print "incoming TTYPE option:", option
if self.ttype_step == 0:
# just start the request chain
self.protocol.requestNegotiation(TTYPE, SEND)
@ -153,7 +151,6 @@ class Ttype(object):
self.protocol.protocol_flags['TTYPE'][option.upper()] = True
self.protocol.protocol_flags['TTYPE']['init_done'] = True
# print "TTYPE final:", self.protocol.protocol_flags['TTYPE']
# we must sync ttype once it'd done
self.protocol.handshake_done()
self.ttype_step += 1

View file

@ -268,7 +268,6 @@ class Evennia(object):
#update eventual changed defaults
self.update_defaults()
#print "run_init_hooks:", ObjectDB.get_all_cached_instances()
[o.at_init() for o in ObjectDB.get_all_cached_instances()]
[p.at_init() for p in PlayerDB.get_all_cached_instances()]

View file

@ -607,7 +607,6 @@ class ServerSessionHandler(SessionHandler):
if not _OOB_HANDLER:
from evennia.server.oobhandler import OOB_HANDLER as _OOB_HANDLER
funcname, args, kwargs = kwargs.pop("oob")
#print "OOB session.data_in:", funcname, args, kwargs
if funcname:
_OOB_HANDLER.execute_cmd(session, funcname, *args, **kwargs)

View file

@ -286,7 +286,6 @@ class AttributeHandler(object):
ret = []
key = [k.strip().lower() for k in make_iter(key) if k]
category = category.strip().lower() if category is not None else None
#print "cache:", self._cache.keys(), key
if not key:
# return all with matching category (or no category)
catkey = "-%s" % category if category is not None else None

View file

@ -455,7 +455,6 @@ class TypedObject(SharedMemoryModel):
if hasattr(self.ndb, nattr):
self.nattributes.remove(nattr)
else:
#print "deleting attrs ..."
self.attributes.clear()
self.nattributes.clear()

View file

@ -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:

View file

@ -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)

View file

@ -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):
"""

View file

@ -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()

View file

@ -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)

View file

@ -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