Skip to content

Commit

Permalink
remove logging in daemons
Browse files Browse the repository at this point in the history
  • Loading branch information
Meowcolm024 committed Jan 10, 2021
1 parent c99525f commit fca8196
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
26 changes: 13 additions & 13 deletions daemon.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
class BB():
def __init__(self):
self.script = [
"from core.Automata import Automata",
"import logging",
"logging.basicConfig(filename='automata.log',filemode='w',level=logging.INFO,format='%(asctime)s %("
"levelname)s %(message)s',datefmt='%y/%m/%d %I:%M:%S %p') "
]
self.script = ["from core.Automata import Automata"]
self.battle = 1

def init_sc(self): # checkpoint, support, shifts
Expand All @@ -16,7 +11,7 @@ def sw(file, old, new):
if old in line:
line = line.replace(old, new)
file_data += line
with open(file,"w") as f:
with open(file, "w") as f:
f.write(file_data)
print("------------------------------------------------------------")
print("Select Game Version")
Expand Down Expand Up @@ -47,12 +42,14 @@ def sw(file, old, new):
ckp = "Qp" + sellv
if selckp == "4":
print("------------------------------------------------------------")
print("Enter the name of the Checkpoint image (PNG in /assets) (WITHOUT extension name)")
print(
"Enter the name of the Checkpoint image (PNG in /assets) (WITHOUT extension name)")
cli = ""
ckp = input("Checkpoint: ")

print("------------------------------------------------------------")
print("Enter the name of the Support image (PNG in /assets) (WITHOUT extension name)")
print(
"Enter the name of the Support image (PNG in /assets) (WITHOUT extension name)")
spt = input("Suppport: ")

print("------------------------------------------------------------")
Expand All @@ -62,11 +59,13 @@ def sw(file, old, new):
print("Enter shifts of Y coordinate (Enter 0 if your res is 1920x1080)")
sft_y = input("Y shift: ")

sc = f"bb = Automata(\"assets/{cli}{ckp}.png\", \"assets/{spt}.png\", ({sft_x}, {sft_y}))" # class name: bb
# class name: bb
sc = f"bb = Automata(\"assets/{cli}{ckp}.png\", \"assets/{spt}.png\", ({sft_x}, {sft_y}))"
self.script.append(sc)
print("------------------------------------------------------------")
print("Auto Recovery AP")
print("1 = No 2 = Gold Apple 3 = Silver Apple 4 = Santa Quartz 5 = Bronze Apple")
print(
"1 = No 2 = Gold Apple 3 = Silver Apple 4 = Santa Quartz 5 = Bronze Apple")
ap = input("Select a number: ")
if ap == "2" or ap == "3" or ap == "4" or ap == "5":
print("------------------------------------------------------------")
Expand Down Expand Up @@ -102,7 +101,7 @@ def menu(self) -> bool:
self.crd_order()
return True
return False

def sv_skill(self):
print("------------------------------------------------------------")
print("Servant skill types:")
Expand Down Expand Up @@ -174,7 +173,7 @@ def setup_battle(self):
# end'
self.script.append("# FINISH")
self.script.append("bb.finish_battle()")

def main(self):
name = self.start()
self.setup_battle()
Expand All @@ -185,6 +184,7 @@ def main(self):
content = '\n'.join(self.script)
file.write(content)


if __name__ == "__main__":
demon = BB()
demon.main()
17 changes: 7 additions & 10 deletions daemoncn.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
class BB():
def __init__(self):
self.script = [
"from core.Automata import Automata",
"import logging",
"logging.basicConfig(filename='automata.log',filemode='w',level=logging.INFO,format='%(asctime)s %("
"levelname)s %(message)s',datefmt='%y/%m/%d %I:%M:%S %p') "
]
self.script = ["from core.Automata import Automata"]
self.battle = 1

def init_sc(self): # checkpoint, support, shifts
Expand All @@ -16,7 +11,7 @@ def sw(file, old, new):
if old in line:
line = line.replace(old, new)
file_data += line
with open(file,"w") as f:
with open(file, "w") as f:
f.write(file_data)
print("------------------------------------------------------------")
print("选择游戏版本")
Expand Down Expand Up @@ -62,7 +57,8 @@ def sw(file, old, new):
print("请设置游戏画面偏移Y坐标 (1920x1080请填写0)")
sft_y = input("Y: ")

sc = f"bb = Automata(\"assets/{cli}{ckp}.png\", \"assets/{spt}.png\", ({sft_x}, {sft_y}))" # class name: bb
# class name: bb
sc = f"bb = Automata(\"assets/{cli}{ckp}.png\", \"assets/{spt}.png\", ({sft_x}, {sft_y}))"
self.script.append(sc)
print("------------------------------------------------------------")
print("是否启用AP恢复")
Expand Down Expand Up @@ -103,7 +99,7 @@ def menu(self) -> bool:
self.crd_order()
return True
return False

def sv_skill(self):
print("------------------------------------------------------------")
print("从者技能类型:")
Expand Down Expand Up @@ -175,7 +171,7 @@ def setup_battle(self):
# end'
self.script.append("# FINISH")
self.script.append("bb.finish_battle()")

def main(self):
name = self.start()
self.setup_battle()
Expand All @@ -186,6 +182,7 @@ def main(self):
content = '\n'.join(self.script)
file.write(content)


if __name__ == "__main__":
demon = BB()
demon.main()

0 comments on commit fca8196

Please sign in to comment.