diff --git a/cli/__pycache__/controller.cpython-36.pyc b/cli/__pycache__/controller.cpython-36.pyc index 1ebb91a8..99497b29 100644 Binary files a/cli/__pycache__/controller.cpython-36.pyc and b/cli/__pycache__/controller.cpython-36.pyc differ diff --git a/cli/__pycache__/model.cpython-36.pyc b/cli/__pycache__/model.cpython-36.pyc index 07db2f36..28684080 100644 Binary files a/cli/__pycache__/model.cpython-36.pyc and b/cli/__pycache__/model.cpython-36.pyc differ diff --git a/cli/controller.py b/cli/controller.py index 819d6c86..bc3cc77a 100644 --- a/cli/controller.py +++ b/cli/controller.py @@ -41,7 +41,8 @@ class Create: def setEnv(self): '''set the usable port for application''' - + fileop=FileOp() + print(fileop.fileToJson('./joomla/.env_all')) pass def upRepo(self): @@ -53,4 +54,6 @@ class Create: os.system(cmd) def printResult(self): - pass \ No newline at end of file + pass + + diff --git a/cli/model.py b/cli/model.py index 4d5dd679..74896325 100644 --- a/cli/model.py +++ b/cli/model.py @@ -11,7 +11,7 @@ class SmoothUrl: def __init__(self): pass - def res(url_list: Tuple): + def res(self, url_list: Tuple): for item in url_list: try: @@ -58,16 +58,16 @@ class FileOp: dict = {} with open(path) as fh: for line in fh: + if line == "\n": + continue - print(line.find(remark)) if line.find(remark) != 0: item, value = line.strip().split(separate, -1) - item = line.strip() dict[item] = value else: continue fh.close() - print (dict) + return dict class NetOp: @@ -110,9 +110,4 @@ class SecurityOp: and any(c.isupper() for c in password) and sum(c.isdigit() for c in password) >= 3): break - print(password) - - -test=FileOp() -#test.setPort(9001) -test.fileToJson('./joomla/.env_all') \ No newline at end of file + print(password) \ No newline at end of file diff --git a/cli/test.py b/cli/test.py index 6c4e5795..fd4cd5ab 100644 --- a/cli/test.py +++ b/cli/test.py @@ -1,4 +1,16 @@ -import json +class Card: + def __init__(self, rank, suit): + self.suit = suit + self.rank = rank + self.hard, self.soft = self._points() -with open("./joomla/.env_all","r") as file: - jsonData = json.dump(file, tempfile) \ No newline at end of file +class NumberCard( Card ): + def _points(self): + return int(self.rank), int(self.rank) + +class AceCard( Card ): + def _points(self): + return 1, 11 + +nc=NumberCard(11,12) +print(nc) \ No newline at end of file