mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-25 09:00:26 +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):
|
def setEnv(self):
|
||||||
'''set the usable port for application'''
|
'''set the usable port for application'''
|
||||||
|
fileop=FileOp()
|
||||||
|
print(fileop.fileToJson('./joomla/.env_all'))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def upRepo(self):
|
def upRepo(self):
|
||||||
|
@ -54,3 +55,5 @@ class Create:
|
||||||
|
|
||||||
def printResult(self):
|
def printResult(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
13
cli/model.py
13
cli/model.py
|
@ -11,7 +11,7 @@ class SmoothUrl:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def res(url_list: Tuple):
|
def res(self, url_list: Tuple):
|
||||||
|
|
||||||
for item in url_list:
|
for item in url_list:
|
||||||
try:
|
try:
|
||||||
|
@ -58,16 +58,16 @@ class FileOp:
|
||||||
dict = {}
|
dict = {}
|
||||||
with open(path) as fh:
|
with open(path) as fh:
|
||||||
for line in fh:
|
for line in fh:
|
||||||
|
if line == "\n":
|
||||||
|
continue
|
||||||
|
|
||||||
print(line.find(remark))
|
|
||||||
if line.find(remark) != 0:
|
if line.find(remark) != 0:
|
||||||
item, value = line.strip().split(separate, -1)
|
item, value = line.strip().split(separate, -1)
|
||||||
item = line.strip()
|
|
||||||
dict[item] = value
|
dict[item] = value
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
fh.close()
|
fh.close()
|
||||||
print (dict)
|
return dict
|
||||||
|
|
||||||
|
|
||||||
class NetOp:
|
class NetOp:
|
||||||
|
@ -111,8 +111,3 @@ class SecurityOp:
|
||||||
and sum(c.isdigit() for c in password) >= 3):
|
and sum(c.isdigit() for c in password) >= 3):
|
||||||
break
|
break
|
||||||
print(password)
|
print(password)
|
||||||
|
|
||||||
|
|
||||||
test=FileOp()
|
|
||||||
#test.setPort(9001)
|
|
||||||
test.fileToJson('./joomla/.env_all')
|
|
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:
|
class NumberCard( Card ):
|
||||||
jsonData = json.dump(file, tempfile)
|
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