Commit 06672382 by sikang

update

parent b9eca053
...@@ -90,7 +90,7 @@ elif command == 16: ...@@ -90,7 +90,7 @@ elif command == 16:
elif command == 17: elif command == 17:
Garble().str_grable(config) Garble().str_grable(config)
elif command == 17: elif command == 18:
ActivityGarble().activity_garble(config) ActivityGarble().activity_garble(config)
elif command == 21: elif command == 21:
......
...@@ -46,7 +46,7 @@ class ActivityGarble: ...@@ -46,7 +46,7 @@ class ActivityGarble:
#替换文件内容 #替换文件内容
def __process_file_content(self, path, file_name): def __process_file_content(self, path, file_name):
# print("processing content: %s..."%path) # print("processing content: %s..."%path)
with open(path, "rt") as fin: with open(path, "rt", encoding="utf-8") as fin:
file_content = fin.read() file_content = fin.read()
# replace the file content based on mangle settings # replace the file content based on mangle settings
for (src, dst) in self.activity_mapping.items(): for (src, dst) in self.activity_mapping.items():
...@@ -58,7 +58,7 @@ class ActivityGarble: ...@@ -58,7 +58,7 @@ class ActivityGarble:
if ext == '.java': if ext == '.java':
comment = "// machine renamed: %s\n" % file_name comment = "// machine renamed: %s\n" % file_name
file_content = "%s%s" % (comment, file_content) file_content = "%s%s" % (comment, file_content)
with open(path, "wt") as fout: with open(path, "wt", encoding="utf-8") as fout:
fout.write(file_content) fout.write(file_content)
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment