Test command, readme changes.
parent
a65612ffd3
commit
fe507cce84
12
README.org
12
README.org
|
@ -2,10 +2,16 @@
|
|||
|
||||
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
|
||||
events via mobilizon GraphQL api from yaml or json or whatever. Probably yaml.
|
||||
git clone https://git.kompot.si/lio/mobili_cli
|
||||
cd mobili_cli
|
||||
|
||||
pip3 install -e .
|
||||
|
||||
export PATH=~/.local/bin/:$PATH
|
||||
|
||||
mobili_cli cli --help
|
||||
|
||||
** Functionality
|
||||
|
||||
|
|
|
@ -10,3 +10,4 @@ mobili_cli.egg-info/top_level.txt
|
|||
mobili_cli/commands/__init__.py
|
||||
mobili_cli/commands/cmd_init.py
|
||||
mobili_cli/commands/cmd_status.py
|
||||
mobili_cli/commands/cmd_test.py
|
|
@ -1,3 +1,3 @@
|
|||
click
|
||||
graphql-core
|
||||
requests
|
||||
click>=7.0.0
|
||||
feedparser==6.0.8
|
||||
sgqlc==v14.1
|
||||
|
|
|
@ -27,7 +27,7 @@ class Environment:
|
|||
pass_environment = click.make_pass_decorator(Environment, ensure=True)
|
||||
cmd_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), "commands"))
|
||||
|
||||
print(cmd_folder)
|
||||
# print(cmd_folder)
|
||||
|
||||
class ComplexCLI(click.MultiCommand):
|
||||
def list_commands(self, ctx):
|
||||
|
@ -54,8 +54,10 @@ class ComplexCLI(click.MultiCommand):
|
|||
)
|
||||
@click.option("-v", "--verbose", is_flag=True, help="Enables verbose mode.")
|
||||
@pass_environment
|
||||
|
||||
def cli(ctx, verbose, home):
|
||||
"""A mobilizon command line interface."""
|
||||
ctx.verbose = verbose
|
||||
# click.echo('Hello mobili_cli')
|
||||
if home is not None:
|
||||
ctx.home = home
|
||||
|
|
|
@ -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 + "!")
|
|
@ -1,2 +1,3 @@
|
|||
click>=7.0.0
|
||||
sgqlc==v14.1
|
||||
feedparser==6.0.8
|
||||
|
|
6
setup.py
6
setup.py
|
@ -1,11 +1,15 @@
|
|||
from setuptools import setup
|
||||
import os
|
||||
|
||||
with open('requirements.txt') as f:
|
||||
required = f.read().splitlines()
|
||||
|
||||
setup(
|
||||
name="mobili_cli",
|
||||
version="0.1",
|
||||
packages=["mobili_cli", "mobili_cli.commands"],
|
||||
include_package_data=True,
|
||||
install_requires=["click", "graphql-core", "requests"],
|
||||
install_requires=required,
|
||||
entry_points="""
|
||||
[console_scripts]
|
||||
mobili_cli=mobili_cli.cli:cli
|
||||
|
|
Loading…
Reference in New Issue