コード例 #1
0
     "`-webkit-gradient`, see https://www.webkit.org/blog/175/introducing-"
     "css-gradients/[the WebKit documentation]."),
    'fonts': ("Fonts used for the UI, with optional style/weight/size.\n\n"
              " * Style: `normal`/`italic`/`oblique`\n"
              " * Weight: `normal`, `bold`, `100`..`900`\n"
              " * Size: _number_ `px`/`pt`"),
}

DEFAULT_FONT_SIZE = '10pt' if sys.platform == 'darwin' else '8pt'

DATA = collections.OrderedDict([
    ('general',
     sect.KeyValue(
         ('ignore-case', SettingValue(typ.IgnoreCase(), 'smart'),
          "Whether to find text on a page case-insensitively."),
         ('wrap-search', SettingValue(typ.Bool(), 'true'),
          "Whether to wrap finding text to the top when arriving at the end."),
         ('startpage', SettingValue(typ.List(), 'https://www.duckduckgo.com'),
          "The default page(s) to open at the start, separated by commas."),
         ('auto-search', SettingValue(typ.AutoSearch(), 'naive'),
          "Whether to start a search when something else than a URL is "
          "entered."),
         ('auto-save-config', SettingValue(typ.Bool(), 'true'),
          "Whether to save the config automatically on quit."),
         ('editor',
          SettingValue(typ.ShellCommand(placeholder=True), 'gvim -f "{}"'),
          "The editor (and arguments) to use for the `open-editor` command.\n\n"
          "Use `{}` for the filename. The value gets split like in a shell, so "
          "you can use `\"` or `'` to quote arguments."),
         ('editor-encoding', SettingValue(
             typ.Encoding(), 'utf-8'), "Encoding to use for editor."),
コード例 #2
0
ファイル: test_models.py プロジェクト: melody40/monorepo
def configdata_stub(config_stub, monkeypatch, configdata_init):
    """Patch the configdata module to provide fake data."""
    monkeypatch.setattr(
        configdata, 'DATA',
        collections.OrderedDict([
            ('aliases',
             configdata.Option(name='aliases',
                               description='Aliases for commands.',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Command(),
                               ),
                               default={'q': 'quit'},
                               backends=[
                                   usertypes.Backend.QtWebKit,
                                   usertypes.Backend.QtWebEngine
                               ],
                               raw_backends=None)),
            ('bindings.default',
             configdata.Option(name='bindings.default',
                               description='Default keybindings',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Dict(
                                       keytype=configtypes.Key(),
                                       valtype=configtypes.Command(),
                                   ),
                               ),
                               default={
                                   'normal':
                                   collections.OrderedDict([
                                       ('<Ctrl+q>', 'quit'),
                                       ('d', 'tab-close'),
                                   ])
                               },
                               backends=[],
                               raw_backends=None,
                               no_autoconfig=True)),
            ('bindings.commands',
             configdata.Option(name='bindings.commands',
                               description='Default keybindings',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Dict(
                                       keytype=configtypes.Key(),
                                       valtype=configtypes.Command(),
                                   ),
                               ),
                               default={
                                   'normal':
                                   collections.OrderedDict([
                                       ('<Ctrl+q>', 'quit'),
                                       ('ZQ', 'quit'),
                                       ('I', 'invalid'),
                                       ('d', 'scroll down'),
                                   ])
                               },
                               backends=[],
                               raw_backends=None)),
            ('content.javascript.enabled',
             configdata.Option(name='content.javascript.enabled',
                               description='Enable/Disable JavaScript',
                               typ=configtypes.Bool(),
                               default=True,
                               backends=[],
                               raw_backends=None)),
            ('completion.open_categories',
             configdata.Option(
                 name='completion.open_categories',
                 description=(
                     'Which categories to show (in which order) in the '
                     ':open completion.'),
                 typ=configtypes.FlagList(),
                 default=[
                     "searchengines", "quickmarks", "bookmarks", "history"
                 ],
                 backends=[],
                 raw_backends=None)),
            ('url.searchengines',
             configdata.Option(name='url.searchengines',
                               description='searchengines list',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.String(),
                               ),
                               default={
                                   "DEFAULT": "https://duckduckgo.com/?q={}",
                                   "google": "https://google.com/?q={}"
                               },
                               backends=[],
                               raw_backends=None)),
        ]))
    config_stub._init_values()
コード例 #3
0
def configdata_stub(config_stub, monkeypatch, configdata_init):
    """Patch the configdata module to provide fake data."""
    monkeypatch.setattr(
        configdata, 'DATA',
        collections.OrderedDict([
            ('aliases',
             configdata.Option(name='aliases',
                               description='Aliases for commands.',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Command(),
                               ),
                               default={'q': 'quit'},
                               backends=[
                                   usertypes.Backend.QtWebKit,
                                   usertypes.Backend.QtWebEngine
                               ],
                               raw_backends=None)),
            ('bindings.default',
             configdata.Option(name='bindings.default',
                               description='Default keybindings',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Dict(
                                       keytype=configtypes.Key(),
                                       valtype=configtypes.Command(),
                                   ),
                               ),
                               default={
                                   'normal':
                                   collections.OrderedDict([
                                       ('<Ctrl+q>', 'quit'),
                                       ('d', 'tab-close'),
                                   ])
                               },
                               backends=[],
                               raw_backends=None,
                               no_autoconfig=True)),
            ('bindings.commands',
             configdata.Option(name='bindings.commands',
                               description='Default keybindings',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Dict(
                                       keytype=configtypes.Key(),
                                       valtype=configtypes.Command(),
                                   ),
                               ),
                               default={
                                   'normal':
                                   collections.OrderedDict([
                                       ('<Ctrl+q>', 'quit'),
                                       ('ZQ', 'quit'),
                                       ('I', 'invalid'),
                                       ('d', 'scroll down'),
                                   ])
                               },
                               backends=[],
                               raw_backends=None)),
            ('content.javascript.enabled',
             configdata.Option(name='content.javascript.enabled',
                               description='Enable/Disable JavaScript',
                               typ=configtypes.Bool(),
                               default=True,
                               backends=[],
                               raw_backends=None)),
        ]))
    config_stub._init_values()
コード例 #4
0
        " * Weight: `normal`, `bold`, `100`..`900`\n"
        " * Size: _number_ `px`/`pt`"),
}


DEFAULT_FONT_SIZE = '10pt' if sys.platform == 'darwin' else '8pt'


DATA = collections.OrderedDict([
    ('general', sect.KeyValue(
        ('ignore-case',
         SettingValue(typ.IgnoreCase(), 'smart'),
         "Whether to find text on a page case-insensitively."),

        ('wrap-search',
         SettingValue(typ.Bool(), 'true'),
         "Whether to wrap finding text to the top when arriving at the end."),

        ('startpage',
         SettingValue(typ.List(), 'http://www.duckduckgo.com'),
         "The default page(s) to open at the start, separated by commas."),

        ('auto-search',
         SettingValue(typ.AutoSearch(), 'naive'),
         "Whether to start a search when something else than a URL is "
         "entered."),

        ('auto-save-config',
         SettingValue(typ.Bool(), 'true'),
         "Whether to save the config automatically on quit."),