This commit is contained in:
chendelin1982 2021-10-07 17:36:09 +08:00
parent f660e5dbef
commit 40abab1b49
5 changed files with 25 additions and 15 deletions

Binary file not shown.

View file

@ -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):
@ -53,4 +54,6 @@ class Create:
os.system(cmd) os.system(cmd)
def printResult(self): def printResult(self):
pass pass

View file

@ -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:
@ -110,9 +110,4 @@ class SecurityOp:
and any(c.isupper() for c in password) and any(c.isupper() for c in password)
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')

View file

@ -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)