diff --git a/rigatonibot/cli.py b/rigatonibot/cli.py new file mode 100644 index 0000000..fc8e6f1 --- /dev/null +++ b/rigatonibot/cli.py @@ -0,0 +1,41 @@ +import click +from pathlib import Path +import requests + +@click.command() +@click.argument('filename', type=click.Path(exists=True, readable=True), nargs=1) +def cli(filename): + """Usage: + run `python rigatonibot/cli.py `, + it will create and output via terminal your `paste.rs` link""" + path = Path(filename).as_posix() + + with open(path, 'r') as file: + data = file.read() + web_address = requests.post('http://paste.rs', data=data) + + print(web_address.text) + +if __name__ == '__main__': + cli() + + +# Ta esse eh o unico arquivo que soh eu tenho por enquanto: +""" +Ideias: +1- fazer primeiro via cli, + python rigatoni.py .py --> nao precisa ser py, mas acho que comece assim + --> a nao ser que converter pra txt sempre funcione + a) devolve o link criado no paste + b) abre direto no navegador o negocio criado + +2- depois dar um jeito de fazer isso virar uma ferramenta sh + rigatoni .py + +3- depois (ou antes) ja fazer um bot de telegrao + (eh bom pq dai a galera nao tem que instalar essa pomba no pc) + +4- oferecer outras ferramentas de paste + rigatoni {paste, gist} + (ei, nao precisa ser .py!) +""" \ No newline at end of file diff --git a/setup.py b/setup.py index 52835bc..dd1b734 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,8 @@ name='rigatonibot', version='1.0.0', packages=find_packages(), - install_requires=['python-telegram-bot', 'requests'], + install_requires=['python-telegram-bot', 'requests', 'click', + 'pathlib'], entry_points=''' [console_scripts] rigatonibot=rigatonibot.__main__:main