From d0f032623ac66bd9661a0b7169d10c26a56d4d4c Mon Sep 17 00:00:00 2001 From: tchize Date: Thu, 8 Nov 2007 23:36:22 +0000 Subject: [PATCH] Modified all print of script to calls to Crossfire.Log(Crossfire.Log(Debug|Error|Info|Monster),message) git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@7496 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/CFBank.py | 2 +- python/CFDataFile.py | 4 ++-- python/CFGuilds.py | 8 ++++---- python/IPO/receive.py | 2 +- python/events/init/guild_init.py | 3 ++- python/events/python_init.py | 2 +- python/guilds/guild_questpoints_apply.py | 2 +- python/guilds/guildbuy.py | 4 ++-- python/guilds/guildjoin.py | 2 +- python/guilds/guildoracle.py | 2 +- python/misc/CFweardisguise.py | 4 ++-- python/misc/greet_message.py | 2 +- python/monsters/combat_chicken.py | 2 +- 13 files changed, 20 insertions(+), 19 deletions(-) diff --git a/python/CFBank.py b/python/CFBank.py index 82a940fbe..b032c8d7d 100644 --- a/python/CFBank.py +++ b/python/CFBank.py @@ -58,7 +58,7 @@ class CFBank: def remove_account(self,user): if self.bankdb.has_key(user): del self.bankdb[user] - print "%s's bank account removed." %user + Crossfire.Log(Crossfire.LogDebug, "%s's bank account removed." %user) self.bankdb.sync() return 1 else: diff --git a/python/CFDataFile.py b/python/CFDataFile.py index 1041aef8d..736610ea3 100644 --- a/python/CFDataFile.py +++ b/python/CFDataFile.py @@ -42,7 +42,7 @@ class CFDataFile: try: file = open(self.filename,'wb') except: - print "Can't create datafile %s" % self.datafile_name + Crossfire.Log(Crossfire.LogError, "Can't create datafile %s" % self.datafile_name) else: temp = [] for item in header: @@ -50,7 +50,7 @@ class CFDataFile: contents = '#|%s\n' %(string.join(temp,'|')) file.write(contents) file.close() - print "New datafile created: %s" % self.datafile_name + Crossfire.Log(Crossfire.LogInfo, "New datafile created: %s" % self.datafile_name) def getData(self): '''Gets the formatted file as a dictionary diff --git a/python/CFGuilds.py b/python/CFGuilds.py index da81a9a23..e8cf0e0e1 100644 --- a/python/CFGuilds.py +++ b/python/CFGuilds.py @@ -32,13 +32,13 @@ def GuildUpdate(): guildfile.close() guildlisting.pop() except: - print 'No GuidList file. Please check %s' %GuildList + Crossfire.Log(Crossfire.LogError,'No GuidList file. Please check %s' %GuildList) if (guildlisting): - print guildlisting + Crossfire.Log(Crossfire.LogDebug, '%s' %guildlisting) for guild in guildlisting: if not CFGuildHouses().info(guild): if CFGuildHouses().add_guild(guild): - print 'New Guild: %s' %guild + Crossfire.Log(Crossfire.LogInfo,'New Guild: %s' %guild) def SearchGuilds(player): guildlist = CFGuildHouses().list_guilds() @@ -283,7 +283,7 @@ class CFGuild: currentrank = record['Rank'] if currentrank != 'Initiate': ranknum = self.ranks.index(currentrank) - print "ranknum = %d"%ranknum + Crossfire.Log(Crossfire.LogDebug, "ranknum = %d"%ranknum) newrank = ranknum-1 record['Rank'] = self.ranks[newrank] self.guildlist.put_record(record) diff --git a/python/IPO/receive.py b/python/IPO/receive.py index de3dc8fa6..a763e2708 100755 --- a/python/IPO/receive.py +++ b/python/IPO/receive.py @@ -55,7 +55,7 @@ if total > 0: msgob.Message=message msgob.Value=0 else: - print 'ERROR: unknown mailtype\n' + Crossfire.Log(Crossfire.LogError, 'ERROR: unknown mailtype\n') if total == 1: activator.Write('You got 1 mail.') diff --git a/python/events/init/guild_init.py b/python/events/init/guild_init.py index 598a8ba8b..d71e4ceeb 100644 --- a/python/events/init/guild_init.py +++ b/python/events/init/guild_init.py @@ -1,3 +1,4 @@ import CFGuilds -print "Updating Guilds" +import Crossfire +Crossfire.Log(Crossfire.LogDebug, "Updating Guilds") CFGuilds.GuildUpdate() diff --git a/python/events/python_init.py b/python/events/python_init.py index 087c678f9..d7f505449 100644 --- a/python/events/python_init.py +++ b/python/events/python_init.py @@ -2,7 +2,7 @@ import Crossfire import os.path import sys -print "Running python initialize script." +Crossfire.Log(Crossfire.LogDebug, "Running python initialize script.") sys.path.insert(0, os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirectory(), 'python')) path = os.path.join(Crossfire.DataDirectory(), Crossfire.MapDirectory(), 'python/events/init') diff --git a/python/guilds/guild_questpoints_apply.py b/python/guilds/guild_questpoints_apply.py index af6dbfa1c..70b163506 100644 --- a/python/guilds/guild_questpoints_apply.py +++ b/python/guilds/guild_questpoints_apply.py @@ -17,6 +17,6 @@ if points: else: pass else: - print 'Error, no points specified in %s on map %s' %(whoami,mapname) + Crossfire.Log(Crossfire.LogError, 'Error, no points specified in %s on map %s' %(whoami,mapname)) diff --git a/python/guilds/guildbuy.py b/python/guilds/guildbuy.py index adfc48155..dfa0092d2 100644 --- a/python/guilds/guildbuy.py +++ b/python/guilds/guildbuy.py @@ -32,7 +32,7 @@ if (guildname): names.append(player.Name) if len(players) == 3: - print '%s,%s and %s found guild %s' %(names[0], names[1], names[2], guildname) + Crossfire.Log(Crossfire.LogInfo, '%s,%s and %s found guild %s' %(names[0], names[1], names[2], guildname)) CFGuilds.CFGuildHouses().establish(guildname) #Masterize them @@ -50,7 +50,7 @@ if (guildname): else: message = 'To purchase a guild requires two additional persons to stand on the alcoves above.' else: - print 'Guild Purchase Error: %s, %s' %(guildname, activatorname) + Crossfire.Log(Crossfire.LogError, 'Guild Purchase Error: %s, %s' %(guildname, activatorname)) message = 'Guild Purchase Error, please notify a DM' whoami.Say(message) diff --git a/python/guilds/guildjoin.py b/python/guilds/guildjoin.py index 171171089..eef384ede 100644 --- a/python/guilds/guildjoin.py +++ b/python/guilds/guildjoin.py @@ -56,7 +56,7 @@ if (guildname): else: message = 'No one is in the chair!' else: - print 'Guild Join Error: %s' %(guildname) + Crossfire.Log(Crossfire.LogError, 'Guild Join Error: %s' %(guildname)) message = 'Guild Join Error, please notify a DM' whoami.Say(message) diff --git a/python/guilds/guildoracle.py b/python/guilds/guildoracle.py index dca594e82..2d3760921 100644 --- a/python/guilds/guildoracle.py +++ b/python/guilds/guildoracle.py @@ -30,7 +30,7 @@ isDM=activator.DungeonMaster log=CFLog.CFLog() guildname=Crossfire.ScriptParameters() # 6 is say event -print "Activated %s" %guildname +Crossfire.Log(Crossfire.LogDebug, "Activated %s" %guildname) if (guildname): guild = CFGuilds.CFGuild(guildname) diff --git a/python/misc/CFweardisguise.py b/python/misc/CFweardisguise.py index 752d8b5a4..bfc3faeab 100644 --- a/python/misc/CFweardisguise.py +++ b/python/misc/CFweardisguise.py @@ -19,10 +19,10 @@ if option: inv = activator.CheckInventory(option) #Remove any previous disguise if inv: inv.Remove() - #print "removing tag" + #Crossfire.Log(Crossfire.LogDebug, "removing tag") if not whoami.Applied: #is the object is being applied tag = activator.CreateInvisibleObjectInside(option) tag.Name=option - #print "adding tag" + #Crossfire.Log(Crossfire.LogDebug, "adding tag") diff --git a/python/misc/greet_message.py b/python/misc/greet_message.py index 1b327e22e..964816a96 100644 --- a/python/misc/greet_message.py +++ b/python/misc/greet_message.py @@ -44,7 +44,7 @@ def do_enemy(): msg = msg.replace('%e', whoami.Enemy.Name) whoami.Say(msg) said = said + str(whoami.Enemy.Count) + ';' - print 'said = ' + said + Crossfire.Log(Crossfire.LogDebug, 'said = ' + said) whoami.WriteKey('greet_enemy', said, 1) diff --git a/python/monsters/combat_chicken.py b/python/monsters/combat_chicken.py index a2d94a156..38a692512 100644 --- a/python/monsters/combat_chicken.py +++ b/python/monsters/combat_chicken.py @@ -29,7 +29,7 @@ def has_floor(x, y, name): def find_food(chicken, x, y): obj = chicken.Map.ObjectAt(x, y) while obj != None: - #print obj.Name + #Crossfire.Log(Crossfire.LogMonster, obj.Name) if eat.has_key(obj.NamePl): return obj obj = obj.Above