Compare commits

..

No commits in common. "773f9caed397a1d40720414568df03a52650c8e5" and "eeeded888f8d39cd3a2b989983a11c91a112dd2d" have entirely different histories.

3 changed files with 3 additions and 51 deletions

View File

@ -5,18 +5,6 @@ twvdscli
# Установка # Установка
## С помощью setup.py
Установка:
```sh
python setup.py install
```
Затем управлять пакетом можно как обычно через pip.
## Ручная установка
Потребуются пакеты typer, prettytable, requests. Ставим их из файла: Потребуются пакеты typer, prettytable, requests. Ставим их из файла:
```commandline ```commandline
@ -25,4 +13,4 @@ pip3 install --user -r requirements.txt
# Запуск # Запуск
При первом запуске утилита спросит логин и пароль, после чего запишет их в ~/.config/twvdscli.ini в формате base64 через знак ":". При первом запуске утилита спросит логин и пароль, после чего запишет их в ~/.config/twvdscli.ini в формате base64 через знак ":".

View File

@ -1,33 +0,0 @@
from setuptools import setup
with open("README.md", "r") as long_descr:
long_description = long_descr.read()
setup(
name = 'twvdscli',
version = '1.0',
author = 'L0sted',
description = 'Servers and services manage tool for Timeweb Cloud',
long_description = long_description,
long_description_content_type = "text/markdown",
url = 'https://github.com/L0sted/twvdscli',
classifiers = [
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: The Unlicense (Unlicense)",
"Operating System :: OS Independent",
],
python_requires = '>=3.6',
py_modules = ['twvdscli'],
install_requires = [
'click==7.1.1'
'typer==0.4.0',
'prettytable==3.2.0',
'wcwidth==0.2.5'
],
entry_points = {
'console_scripts': [
'twvdscli = twvdscli:main'
]
}
)

View File

@ -291,7 +291,6 @@ def auth(based):
json=dict(refresh_token="string"), json=dict(refresh_token="string"),
headers=headers headers=headers
) )
if not result.ok: if not result.ok:
return None return None
else: else:
@ -323,13 +322,11 @@ def get_api_key():
result = auth(based) result = auth(based)
return result return result
def main():
if __name__ == '__main__':
apikey = get_api_key() apikey = get_api_key()
if apikey is None: if apikey is None:
print(typer.style("Auth Error", fg=typer.colors.RED)) print(typer.style("Auth Error", fg=typer.colors.RED))
sys.exit(1) sys.exit(1)
reqHeader = {"Authorization": "Bearer " + apikey} reqHeader = {"Authorization": "Bearer " + apikey}
app() app()
if __name__ == '__main__':
main()