Skip to content

Commit

Permalink
Initial dribdat command
Browse files Browse the repository at this point in the history
  • Loading branch information
loleg committed Nov 16, 2022
1 parent b124b8a commit 2ce0a16
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -8,6 +8,8 @@

`dribdat` is an open source web platform for team collaboration online and offline. Originally designed to promote and support open data expeditions and [awesome hackathons](https://github.com/dribdat/awesome-hackathon), it is a Swiss Army Knife of everything you need for your event: a website, countdown clock and challenge board, project log and progress tracker, integrations with popular chat platforms and code repositories, open data support and APIs.

The philosophy of this project, in a nutshell, is: **live and let live** (no tech religion, use whatever design / dev / doc tools you want), **commit sustainably** (aggregate outputs in standard web formats for optimal search and archiving), **create in safe spaces** (code of conduct, works offline, minimal privacy footprint).

For more background and references, see the [User Handbook](https://docs.dribdat.cc/usage/). If you need help or advice in setting up your event, or would like to contribute to the project: please get in touch via [GitHub Issues](https://github.com/dribdat/dribdat/issues) or [website](https://dribdat.cc).

![Screenshot of dribdat](dribdat/static/img/screenshot_sandbox.png)
Expand Down
35 changes: 35 additions & 0 deletions dribdat.py
@@ -0,0 +1,35 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Shell access to dribdat."""
import os
import click
import datetime as dt
from flask.cli import AppGroup
from dateutil.parser import parse
from dribdat.app import init_app
from dribdat.settings import DevConfig, ProdConfig
from dribdat.user.models import Event
from flask.helpers import get_debug_flag

CONFIG = DevConfig if get_debug_flag() else ProdConfig

app = init_app(CONFIG)

event_cli = AppGroup('event')


@event_cli.command('start')
@click.argument('name', required=True)
@click.argument('start', required=False)
def event_start(name, start=None):
"""Create a new event."""
if start is None:
start = dt.datetime.now() + dt.timedelta(days=1)
else:
start = parse(start)
event = Event(name="test", starts_at=start)
event.save()
print("Created event %d" % event.id)


app.cli.add_command(event_start())

0 comments on commit 2ce0a16

Please sign in to comment.