Пример #1
0
def configdata_stub(monkeypatch, configdata_init):
    """Patch the configdata module to provide fake data."""
    return 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=[],
                               raw_backends=None)),
            ('bindings.default',
             configdata.Option(name='bindings.default',
                               description='Default keybindings',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Dict(
                                       keytype=configtypes.String(),
                                       valtype=configtypes.Command(),
                                   ),
                               ),
                               default={
                                   'normal':
                                   collections.OrderedDict([
                                       ('<ctrl+q>', 'quit'),
                                       ('d', 'tab-close'),
                                   ])
                               },
                               backends=[],
                               raw_backends=None)),
            ('bindings.commands',
             configdata.Option(name='bindings.commands',
                               description='Default keybindings',
                               typ=configtypes.Dict(
                                   keytype=configtypes.String(),
                                   valtype=configtypes.Dict(
                                       keytype=configtypes.String(),
                                       valtype=configtypes.Command(),
                                   ),
                               ),
                               default={
                                   'normal':
                                   collections.OrderedDict([
                                       ('<ctrl+q>', 'quit'),
                                       ('ZQ', 'quit'),
                                       ('I', 'invalid'),
                                       ('d', 'scroll down'),
                                   ])
                               },
                               backends=[],
                               raw_backends=None)),
        ]))
Пример #2
0
def opt():
    return configdata.Option(name='example.option',
                             typ=configtypes.String(),
                             default='default value',
                             backends=None,
                             raw_backends=None,
                             description=None,
                             supports_pattern=True)
Пример #3
0
      ('developer-extras', SettingValue(
          typ.Bool(), 'false'), "Enable extra tools for Web developers.\n\n"
       "This needs to be enabled for `:inspector` to work and also adds an "
       "_Inspect_ entry to the context menu."),
      ('print-element-backgrounds', SettingValue(typ.Bool(), 'true'),
       "Whether the background color and images are also drawn when the "
       "page is printed."),
      ('xss-auditing', SettingValue(typ.Bool(), 'false'),
       "Whether load requests should be monitored for cross-site scripting "
       "attempts.\n\n"
       "Suspicious scripts will be blocked and reported in the inspector's "
       "JavaScript console. Enabling this feature might have an impact on "
       "performance."),
      ('site-specific-quirks', SettingValue(
          typ.Bool(), 'true'), "Enable workarounds for broken sites."),
      ('default-encoding', SettingValue(typ.String(none_ok=True), ''),
       "Default encoding to use for websites.\n\n"
       "The encoding must be a string describing an encoding such as "
       '_utf-8_, _iso-8859-1_, etc. If left empty a default value will be '
       "used."),
      ('new-instance-open-target',
       SettingValue(typ.NewInstanceOpenTarget(), 'window'),
       "How to open links in an existing instance if a new one is "
       "launched."),
  )),
 ('ui',
  sect.KeyValue(
      ('zoom-levels',
       SettingValue(
           typ.PercList(minval=0),
           '25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,'
Пример #4
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()
Пример #5
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)),
            ('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()
Пример #6
0
         "page is printed."),

        ('xss-auditing',
         SettingValue(typ.Bool(), 'false'),
         "Whether load requests should be monitored for cross-site scripting "
         "attempts.\n\n"
         "Suspicious scripts will be blocked and reported in the inspector's "
         "JavaScript console. Enabling this feature might have an impact on "
         "performance."),

        ('site-specific-quirks',
         SettingValue(typ.Bool(), 'true'),
         "Enable workarounds for broken sites."),

        ('default-encoding',
         SettingValue(typ.String(none_ok=True), ''),
         "Default encoding to use for websites.\n\n"
         "The encoding must be a string describing an encoding such as "
         '_utf-8_, _iso-8859-1_, etc. If left empty a default value will be '
         "used."),

        ('new-instance-open-target',
         SettingValue(typ.NewInstanceOpenTarget(), 'window'),
         "How to open links in an existing instance if a new one is "
         "launched."),
    )),

    ('ui', sect.KeyValue(
        ('zoom-levels',
         SettingValue(typ.PercList(minval=0),
                      '25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,200%,'