Commit facb37d0 by sikang

test

parent d4240271
...@@ -68,12 +68,13 @@ class LayoutGarble: ...@@ -68,12 +68,13 @@ class LayoutGarble:
root_layout = self.__set_values(root_layout).replace("${attributes}", self.__create_attributes()) root_layout = self.__set_values(root_layout).replace("${attributes}", self.__create_attributes())
content = "" content = ""
for i in range(0,random.randint(0,20)): for i in range(0,random.randint(0,20)):
if random.randint(0,50) % random.randint(3,5) == 0: if random.randint(0,10) % random.randint(2,4) == 0:
layout = self.__rand_item(layouts).replace("${attributes}", self.__create_attributes()) layout = self.__rand_item(layouts).replace("${attributes}", self.__create_attributes())
layout.replace("${childs}",self.__create_views()) layout.replace("${childs}",self.__create_views())
content += layout content += layout
else: else:
content += self.__create_views() content += self.__create_views()
root_layout = root_layout.replace("${childs}",content) root_layout = root_layout.replace("${childs}",content)
with open(path,"w+",encoding='utf-8') as fout: with open(path,"w+",encoding='utf-8') as fout:
...@@ -93,7 +94,6 @@ class LayoutGarble: ...@@ -93,7 +94,6 @@ class LayoutGarble:
for root, dirs, files in os.walk("%s/%s" % (config["root"], main_dir)): for root, dirs, files in os.walk("%s/%s" % (config["root"], main_dir)):
if root.endswith("res/layout"): if root.endswith("res/layout"):
path = os.path.join(root, "%s.xml" % self.__gen_rand_str()) path = os.path.join(root, "%s.xml" % self.__gen_rand_str())
print(path)
self.__create_layout(path) self.__create_layout(path)
print("done") print("done")
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