change README.md

pull/1/head
serkus01 3 years ago
parent d06d6c90ba
commit 9426a806c9

@ -17,9 +17,7 @@
<li>Скачайте дистрибутив проекта<li>
<li>Введите в терминале:</li>
<code>
<i style="color: red;">cd web_pоrt &&
git clone https://github.com/brython-dev/brython.git ./view/static/js/ <i>
<b> или скачайте Brython и распакуйте его в ./view/static/js/ </b>
git clone
</code>
<li>Запустите его ./start<li>
<li>Откройте в браузере localhost:8080 ну или IP адресс и порт указаный в файле config.json</li>

@ -50,6 +50,7 @@ def create_db():
all_pkgs.append(AliaseCategory[d])
else:
all_pkgs.append(str(d.split("/")[-2] +"/" + d.split("/")[-1]))
print(all_pkgs[str(d.split("/")[-2] +"/" + d.split("/")[-1])])
if d.split("/")[-2] not in pkg_list.keys():
pkg_list[str(d.split("/")[-2])] = []
@ -72,17 +73,17 @@ def on_find(p_v):
ret_p =""
ret = {}
with open('./pkgs.json', 'r') as fn:
#data = fn.read()
data = fn.read()
pkg_list= fn.read()
"""
pkg_list = data.split("\n")
for i in pkg_list:
if p_v in i and not i in p:
print(i)
p.append(str(i))
#ret_p = ret_p +"\t" + i
ret_p = ret_p +"\t" + i
print("Find in template:\t" + str(len(p)))
"""
#ret = {"Name": ret_p.split("\t")}
#print(ret_p)
print(p)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -45,10 +45,19 @@ class Handler(BaseHTTPRequestHandler):
self.end_headers()
if self.path =="/":
#print("data:\t" + self.get_data())
"""
with open('./views/index.html', 'tr') as f:
self.r_t=f.read()
print(self.client_address)
"""
try:
with open('./pkgs.json', 'tr') as fn:
data = fn.read()
pkg_list = json.loads(data)
print(pkg_list)
except Exception (e):
print(str(e))
self.r_t = json.dumps({"dump_portage": pkg_list})
elif self.path == '/main':
#print(self.rfile.read())
@ -80,8 +89,7 @@ class Handler(BaseHTTPRequestHandler):
try:
with open('./pkgs.json', 'tr') as fn:
data = fn.read()
pkg_list = json.load
s(data)
pkg_list = json.loads(data)
print(pkg_list)
except Exception (e):
print(str(e))
@ -102,20 +110,20 @@ class Handler(BaseHTTPRequestHandler):
print(config)
print(param)
elif self.path == 'find':
elif self.path == '/find':
param = request['params']['name']
pk_list = []
search_result = {}
#if len(param.split('/')) == 2:
# param = param.split('/')[1]
#p_list = on_find(param)
#print(p_list)
#if len(p_list) == 0:
# print("Never Found")
# self.r_t = str(json.dumps({"Package_result": p_list}))
#else:
#for p in p_list:
#print(p)
if len(param.split('/')) == 2:
param = param.split('/')[1]
p_list = on_find(param)
print(p_list)
if len(p_list) == 0:
print("Never Found")
self.r_t = str(json.dumps({"Package_result": p_list}))
else:
for p in p_list:
print(p)
if len(param.split("/")) == 2:
pk_list.append(search(param.split("/")[1]))
else:

Loading…
Cancel
Save