mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 23:20:23 +00:00
model
This commit is contained in:
parent
f660e5dbef
commit
40abab1b49
5 changed files with 25 additions and 15 deletions
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||
pass
|
||||
|
||||
|
||||
|
|
15
cli/model.py
15
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')
|
||||
print(password)
|
18
cli/test.py
18
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)
|
||||
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)
|
Loading…
Reference in a new issue