import click
from os import path
from .dropbox import DropboxContainer


def get_settings(fs_config):
    # for now we simply hardcode the settings
    # TODO: parse the actual .ini file
    return dict(
        fs_dropbox_root='var/drops/',
        fs_pgp_pubkeys='',
        editors=[],
        admins=[],
    )


@click.command(help='Scans dropbox directory for unprocessed drops and processes them')
@click.option(
    '--config',
    '-c',
    default='development.ini',
    help='location of the configuration file')
def main(config):     # pragma: no cover
    settings = get_settings(path.abspath(config))
    drop_root = DropboxContainer(settings=settings)

    for drop in drop_root:
        print(drop)

@@ -516,16 +516,173 @@
  file')%0A
+@click.argument(%0A    'drop_id',%0A    required=False,%0A    default=None,%0A    # help=u'provide an optional drop_id to limit processing the dropbox of that id'%0A)%0A
 def main
@@ -688,16 +688,30 @@
 n(config
+, drop_id=None
 ):     #
@@ -839,29 +839,139 @@
     
+i
 f
-or
  drop
- in drop_root
+_id is not None:%0A        drops = %5Bdrop_root.get_dropbox(drop_id)%5D%0A    else:%0A        drops = drop_root%0A%0A    for drop in drops
 :%0A  

allow worker to be limited to a single drop