Compare commits

..

No commits in common. "4bffbaa71c244c8b5509a09e2c973905c385de6e" and "d756179afc46b7117c8238c1956e74270fa9b84f" have entirely different histories.

4 changed files with 0 additions and 44 deletions

View File

@ -1,37 +0,0 @@
import json
import urllib.request
import os
import shutil
projects = {
'queues': 'tasks.proto'
}
try:
shutil.rmtree('schemas')
except:
pass
try:
os.mkdir('schemas')
except:
pass
for project in projects:
response = urllib.request.urlopen(f'https://platform.sprinthub.ru/schemas/get?project={project}').read()
data = json.loads(response)
os.mkdir(f'schemas/{project}')
for key, value in data.items():
with open(f'schemas/{project}/{key}', 'w+') as fp:
fp.write(value)
for key, value in projects.items():
os.system(f'python -m grpc_tools.protoc --proto_path schemas --python_out=. --pyi_out=. --grpc_python_out=. ./schemas/{key}/{value}')
try:
shutil.rmtree('schemas')
except:
pass

View File

@ -15,5 +15,4 @@ urlpatterns = [
path(*YandexAuthView.as_path()),
path('is_staff', is_staff),
path('fetch', fetch),
path('generator', generator),
]

View File

@ -9,4 +9,3 @@ from .vk_auth import VKAuthView
from .yandex_auth import YandexAuthView
from .is_staff import is_staff
from .fetch import fetch
from .generator import generator

View File

@ -1,5 +0,0 @@
from django.http import HttpResponse
def generator(request):
return HttpResponse(open('generator.py', 'rb').read())