Esempio n. 1
0
def create_dev_settings(settings, args):
    """
    Creates a settings file at the currect working directory for development use.
    """
    settings = os.path.join(os.getcwd(), 'settings.py')
    if not os.path.exists(settings):
        context = get_user_data_path_values_with_path(os.getcwd())
        context['debug'] = 'True'
        write_settings(settings, **context)
        print('Settings file at %s successfully created.' % settings)
        return_value = 0
    else:
        print('Error: Settings file %s already exists.' % settings)
        return_value = 1
    return return_value
Esempio n. 2
0
def create_dev_settings(settings, args):
    """
    Creates a settings file at the currect working directory for development use.
    """
    settings = os.path.join(os.getcwd(), "settings.py")
    if not os.path.exists(settings):
        context = {}
        context["openslides_user_data_path"] = repr(os.getcwd())
        context["import_function"] = ""
        context["debug"] = "True"
        write_settings(settings, **context)
        print("Settings file at %s successfully created." % settings)
        return_value = 0
    else:
        print("Error: Settings file %s already exists." % settings)
        return_value = 1
    return return_value
Esempio n. 3
0
def create_dev_settings(settings, args):
    """
    Creates a settings file at the currect working directory for development use.
    """
    settings = os.path.join(os.getcwd(), 'settings.py')
    if not os.path.exists(settings):
        context = {}
        context['openslides_user_data_path'] = repr(os.getcwd())
        context['import_function'] = ''
        context['debug'] = 'True'
        write_settings(settings, **context)
        print('Settings file at %s successfully created.' % settings)
        return_value = 0
    else:
        print('Error: Settings file %s already exists.' % settings)
        return_value = 1
    return return_value
Esempio n. 4
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_dir = args.settings_dir
    local_installation = is_local_installation()
    context = {}  # type: Dict[str, str]

    if local_installation:
        if settings_dir is None:
            settings_dir = get_local_settings_dir()
        context = {
            'openslides_user_data_dir': repr(os.path.join(os.getcwd(), 'personal_data', 'var')),
            'debug': 'True'}

    settings_path = write_settings(settings_dir, args.settings_filename, **context)
    print('Settings created at %s' % settings_path)
Esempio n. 5
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_path = args.settings_path
    local_installation = is_local_installation()
    context = {}

    if local_installation:
        if settings_path is None:
            settings_path = get_local_settings_path()
        context = {
            'openslides_user_data_path': repr(os.path.join(os.getcwd(), 'personal_data', 'var')),
            'debug': 'True'}

    settings_path = write_settings(settings_path, **context)
    print('Settings created at %s' % settings_path)
Esempio n. 6
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_path = args.settings_path
    development = is_development()
    context = {}

    if development:
        if settings_path is None:
            settings_path = get_development_settings_path()
        context = {
            'openslides_user_data_path': repr(os.path.join(os.getcwd(), 'development', 'var')),
            'debug': 'True'}

    settings_path = write_settings(settings_path, **context)
    print('Settings created at %s' % settings_path)
Esempio n. 7
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_path = args.settings_path
    local_installation = is_local_installation()
    context = {}  # type: Dict[str, str]

    if local_installation:
        if settings_path is None:
            settings_path = get_local_settings_path()
        context = {
            'openslides_user_data_path': repr(os.path.join(os.getcwd(), 'personal_data', 'var')),
            'debug': 'True'}

    settings_path = write_settings(settings_path, **context)
    print('Settings created at %s' % settings_path)
Esempio n. 8
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_path = args.settings_path
    development = is_development()
    context = {}

    if development:
        if settings_path is None:
            settings_path = get_development_settings_path()
        context = {
            'openslides_user_data_path':
            repr(os.path.join(os.getcwd(), 'development')),
            'debug':
            'True'
        }

    settings_path = write_settings(settings_path, **context)
    print('Settings created at %s' % settings_path)
Esempio n. 9
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_dir = args.settings_dir
    local_installation = is_local_installation()
    context: Dict[str, str] = {}

    if local_installation:
        if settings_dir is None:
            settings_dir = get_local_settings_dir()
        context = {
            "openslides_user_data_dir": repr(
                os.path.join(os.getcwd(), "personal_data", "var")
            ),
            "debug": "True",
        }

    settings_path = write_settings(settings_dir, args.settings_filename, **context)
    print(f"Settings created at {settings_path}")
Esempio n. 10
0
def createsettings(args):
    """
    Creates settings for OpenSlides.
    """
    settings_dir = args.settings_dir
    local_installation = is_local_installation()
    context: Dict[str, str] = {}

    if local_installation:
        if settings_dir is None:
            settings_dir = get_local_settings_dir()
        context = {
            "openslides_user_data_dir":
            repr(os.path.join(os.getcwd(), "personal_data", "var")),
            "debug":
            "True",
        }

    settings_path = write_settings(settings_dir, args.settings_filename,
                                   **context)
    print(f"Settings created at {settings_path}")