Ikaguia said:
import sys
sys.dont_write_bytecode = True
def correct_lines (fileName):
file = open(fileName,"r")
lines = file.readlines()
file.close()
file = open(fileName,"w")
print "Processing " + fileName + "..."
level = 0
returnFound = 0
for line in lines:
line = line.strip()
isString = 0
acceptableindex = -1
for i in xrange(len(line)):
if(line[i]=='\"' or line[i]=='\''):
isString = (isString+1)%2
if(line[i]=='#' and isString == 0):
acceptableindex = i
break
#acceptableindex = line.find("#")
if (acceptableindex == -1):
acceptableindex = len(line)
if line.startswith("return "):
returnFound = 1
level -= line.count("try_end", 0, acceptableindex)
level -= line.count("end_try", 0, acceptableindex)
level -= line.count("else_try", 0, acceptableindex)
newlevel = level
level_positive_change = 0
newlevel += line.count("else_try", 0, acceptableindex)
newlevel += line.count("(", 0, acceptableindex)
newlevel += line.count("[", 0, acceptableindex)
newlevel += line.count("try_begin", 0, acceptableindex)
newlevel += line.count("try_for", 0, acceptableindex)
newlevel += line.startswith("def ")
level_positive_change = newlevel - level
newlevel -= line.count(")", 0, acceptableindex)
newlevel -= line.count("]", 0, acceptableindex)
if (level_positive_change == 0):
level = newlevel
for i in xrange(level):
file.write(" ")
level = newlevel
if (returnFound == 1):
level -= 1
returnFound = 0
file.write("%s\n"%line)
file.close()
import glob
for modfile in glob.glob('module_*.py'):
correct_lines(modfile)
raw_input("Press Enter to continue...")
unassigned local variable <l.center_no[@1224979098644774914]> used by operation party_slot_ge in dialog.spouse_leave(#224).condition on line 2
duplicate entity found: ip.dplmc_autosell
duplicate entity found: itm.tutorial_sword
duplicate entity found: itm.tutorial_axe
duplicate entity found: itm.tutorial_spear
duplicate entity found: itm.tutorial_club
duplicate entity found: itm.tutorial_battle_axe
duplicate entity found: itm.tutorial_arrows
duplicate entity found: itm.tutorial_bolts
duplicate entity found: itm.tutorial_short_bow
duplicate entity found: itm.tutorial_crossbow
duplicate entity found: itm.tutorial_throwing_daggers
duplicate entity found: itm.tutorial_saddle_horse
duplicate entity found: itm.tutorial_shield
duplicate entity found: itm.tutorial_staff_no_attack
duplicate entity found: itm.tutorial_staff
duplicate entity found: s.npc2_kingsupport_2
duplicate entity found: s.npc4_turn_against
duplicate entity found: s.comment_you_were_defeated_allied_unfriendly
duplicate entity found: s.comment_you_were_defeated_allied
duplicate entity found: s.score
duplicate entity found: s.routed
duplicate entity found: s.wife
duplicate entity found: s.husband
duplicate entity found: s.father
duplicate entity found: s.mother
duplicate entity found: s.daughter
duplicate entity found: s.son
duplicate entity found: s.sister
duplicate entity found: s.brother
duplicate entity found: s.s15
duplicate entity found: s.he
duplicate entity found: s.she
duplicate entity found: s.s12
duplicate entity found: s._family_
duplicate entity found: s.whereabouts_unknown
duplicate entity found: s.betrothed
local l.prisoner declared but never used in dialog.lord_mission_rescue_prisoner_method_ransom(#2138).result
local l.rand declared but never used in dialog.mercenary_tavern_talk_hire(#3054).condition
local l.player_agent declared but never used in mt.village_raid(#11).ti_on_agent_killed_or_wounded.body
local l.player_agent declared but never used in mt.arena_melee_fight(#24).ti_on_agent_killed_or_wounded.body
local l.unused declared but never used in script.game_get_troop_wage
local l.villager_count declared but never used in script.process_village_raids
local l.unused declared but never used in script.debug_variables
local l.unused_2 declared but never used in script.debug_variables
local l.unused declared but never used in script.party_inflict_attrition
local l.center_no declared but never used in script.calculate_improvement_limit
local l.player_team declared but never used in script.cf_dplmc_battle_continuation
local l.relation:faction declared but never used in mnu.camp_recruit_prisoners(#28).mno_camp_recruit_prisoners_accept.choice
Reapy said:
Illuminati said:
sirinan said: