Test command, readme changes.

master
Lio Novelli 2021-10-01 01:55:09 +02:00
parent a65612ffd3
commit fe507cce84
7 changed files with 37 additions and 9 deletions

View File

@ -2,10 +2,16 @@
File importer into mobilizon graphql api. File importer into mobilizon graphql api.
** Morganize ** Installation and usage
This doesn't really make a lot of sense. I'm working on a script to import git clone https://git.kompot.si/lio/mobili_cli
events via mobilizon GraphQL api from yaml or json or whatever. Probably yaml. cd mobili_cli
pip3 install -e .
export PATH=~/.local/bin/:$PATH
mobili_cli cli --help
** Functionality ** Functionality

View File

@ -9,4 +9,5 @@ mobili_cli.egg-info/requires.txt
mobili_cli.egg-info/top_level.txt mobili_cli.egg-info/top_level.txt
mobili_cli/commands/__init__.py mobili_cli/commands/__init__.py
mobili_cli/commands/cmd_init.py mobili_cli/commands/cmd_init.py
mobili_cli/commands/cmd_status.py mobili_cli/commands/cmd_status.py
mobili_cli/commands/cmd_test.py

View File

@ -1,3 +1,3 @@
click click>=7.0.0
graphql-core feedparser==6.0.8
requests sgqlc==v14.1

View File

@ -27,7 +27,7 @@ class Environment:
pass_environment = click.make_pass_decorator(Environment, ensure=True) pass_environment = click.make_pass_decorator(Environment, ensure=True)
cmd_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "commands")) cmd_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "commands"))
print(cmd_folder) # print(cmd_folder)
class ComplexCLI(click.MultiCommand): class ComplexCLI(click.MultiCommand):
def list_commands(self, ctx): def list_commands(self, ctx):
@ -54,8 +54,10 @@ class ComplexCLI(click.MultiCommand):
) )
@click.option("-v", "--verbose", is_flag=True, help="Enables verbose mode.") @click.option("-v", "--verbose", is_flag=True, help="Enables verbose mode.")
@pass_environment @pass_environment
def cli(ctx, verbose, home): def cli(ctx, verbose, home):
"""A mobilizon command line interface.""" """A mobilizon command line interface."""
ctx.verbose = verbose ctx.verbose = verbose
# click.echo('Hello mobili_cli')
if home is not None: if home is not None:
ctx.home = home ctx.home = home

View File

@ -0,0 +1,14 @@
from mobili_cli.cli import pass_environment
import click
@click.command("test", short_help="Testing mobili cli.")
@click.argument("name", required=False, type=click.STRING)
@pass_environment
def cli(ctx, name):
"""Greeting."""
if name is None:
name = "Mobilizon"
# ctx.log(f"Greeting printed.")
click.echo("Hello " + name + "!")

View File

@ -1,2 +1,3 @@
click>=7.0.0
sgqlc==v14.1 sgqlc==v14.1
feedparser==6.0.8 feedparser==6.0.8

View File

@ -1,11 +1,15 @@
from setuptools import setup from setuptools import setup
import os
with open('requirements.txt') as f:
required = f.read().splitlines()
setup( setup(
name="mobili_cli", name="mobili_cli",
version="0.1", version="0.1",
packages=["mobili_cli", "mobili_cli.commands"], packages=["mobili_cli", "mobili_cli.commands"],
include_package_data=True, include_package_data=True,
install_requires=["click", "graphql-core", "requests"], install_requires=required,
entry_points=""" entry_points="""
[console_scripts] [console_scripts]
mobili_cli=mobili_cli.cli:cli mobili_cli=mobili_cli.cli:cli