示例#1
0
            Config.set('graphics', 'rotation', arg)
        elif opt in ('-d', '--debug'):
            level = LOG_LEVELS.get('debug')
            Logger.setLevel(level=level)
        elif opt == '--dpi':
            environ['KIVY_DPI'] = arg

    if need_save and 'KIVY_NO_CONFIG' not in environ:
        try:
            with open(kivy_config_fn, 'w') as fd:
                Config.write(fd)
        except Exception as e:
            Logger.exception('Core: error while saving default'
                             'configuration file:', str(e))
        Logger.info('Core: Kivy configuration saved.')
        sys.exit(0)

    # configure all activated modules
    from kivy.modules import Modules
    Modules.configure()

    # android hooks: force fullscreen and add android touch input provider
    if platform in ('android', 'ios'):
        from kivy.config import Config
        Config.set('graphics', 'fullscreen', 'auto')
        Config.remove_section('input')
        Config.add_section('input')

    if platform == 'android':
        Config.set('input', 'androidtouch', 'android')
示例#2
0
文件: __init__.py 项目: kod3r/kivy
            args = arg.split(':', 1)
            if len(args) == 1:
                args += ['']
            Config.set('modules', args[0], args[1])
        elif opt in ('-s', '--save'):
            need_save = True
        elif opt in ('-r', '--rotation'):
            Config.set('graphics', 'rotation', arg)
        elif opt in ('-d', '--debug'):
            level = LOG_LEVELS.get('debug')
            Logger.setLevel(level=level)

    if need_save and 'KIVY_NO_CONFIG' not in environ:
        try:
            with open(kivy_config_fn, 'w') as fd:
                Config.write(fd)
        except Exception, e:
            Logger.exception(
                'Core: error while saving default'
                'configuration file:', str(e))
        Logger.info('Core: Kivy configuration saved.')
        sys.exit(0)

# android hooks: force fullscreen and add android touch input provider
if platform() == 'android':
    from kivy.config import Config
    Config.set('graphics', 'fullscreen', 'auto')
    Config.remove_section('input')
    Config.add_section('input')
    Config.set('input', 'androidtouch', 'android')
示例#3
0
文件: __init__.py 项目: geojeff/kivy
        elif opt in ("-d", "--debug"):
            level = LOG_LEVELS.get("debug")
            Logger.setLevel(level=level)
        elif opt == "--dpi":
            environ["KIVY_DPI"] = arg

    if need_save and "KIVY_NO_CONFIG" not in environ:
        try:
            with open(kivy_config_fn, "w") as fd:
                Config.write(fd)
        except Exception as e:
            Logger.exception("Core: error while saving default" "configuration file:", str(e))
        Logger.info("Core: Kivy configuration saved.")
        sys.exit(0)

    # configure all activated modules
    from kivy.modules import Modules

    Modules.configure()

    # android hooks: force fullscreen and add android touch input provider
    if platform in ("android", "ios"):
        from kivy.config import Config

        Config.set("graphics", "fullscreen", "auto")
        Config.remove_section("input")
        Config.add_section("input")

    if platform == "android":
        Config.set("input", "androidtouch", "android")