Пример #1
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-

from __future__ import print_function, absolute_import

# keep it at the begin in order to get an accurate startup time
from datetime import datetime
startup_time = datetime.now()

from click_project import monkeypatch  # NOQA: E402
from click_project import log  # NOQA: E402
from click_project.overloads import entry_point  # NOQA: E402

__version__ = '0.1'

monkeypatch.do()

LOGGER = log.get_logger(__name__)
log.basic_config(LOGGER)
LOGGERS = {LOGGER}
Пример #2
0
from click.exceptions import MissingParameter

from click_project.click_helpers import click_get_current_context_safe
from click_project.core import get_ctx, rebuild_path, settings_stores,\
    main_command_arguments_to_dict, main_command_arguments_from_dict,\
    main_command_decoration, cache_disk, run
from click_project.triggers import TriggerMixin
from click_project.commandresolver import CommandResolver
from click_project.config import config, get_settings_for_path, get_settings2, in_project
from click_project.lib import check_output, ParameterType
from click_project.log import get_logger
from click_project.plugins import load_plugins
from click_project.completion import startswith
import click_project.completion

LOGGER = get_logger(__name__)


class CommandNotFound(Exception):
    pass


def list_commands(parent_path):
    parent = get_command(parent_path)
    ctx = get_ctx([])
    return parent.list_commands(ctx)


commands_cache = {}
get_command_handlers = OrderedDict()
Пример #3
0
)
from click_project.completion import startswith
from click_project.config import config
from click_project.core import cache_disk

from konix_time_helper import naive_to_local


def parsetime(time):
    if time == "now":
        return datetime.datetime.now()
    else:
        return _parsetime(time)


LOGGER = get_logger(__name__)
# http://ascii-table.com/ansi-escape-sequences.php
ERASE_LINE="\r\u001b[K\r"
CURSOR_UP="\u001b[A"


class AttrDict(dict):
    def __init__(self, *args, **kwargs):
        super(AttrDict, self).__init__(*args, **kwargs)
        self.__dict__ = self


def extract_vehicle_journey_id(links):
    try:
        return [
            link["id"] for link in links