Example #1
0
def _patch_configdata(monkeypatch, stubs, symbol):
    """Patch the configdata module to provide fake data."""
    data = collections.OrderedDict([
        ('general',
         sections.KeyValue(
             ('time',
              value.SettingValue(
                  stubs.FakeConfigType('fast', 'slow'),
                  default='slow'), 'Is an illusion.\n\nLunchtime doubly so.'),
             ('volume',
              value.SettingValue(stubs.FakeConfigType('0', '11'),
                                 default='11'), 'Goes to 11'))),
        ('ui',
         sections.KeyValue(
             ('gesture',
              value.SettingValue(
                  stubs.FakeConfigType(('on', 'off')),
                  default='off'), 'Waggle your hands to control qutebrowser'),
             ('mind',
              value.SettingValue(
                  stubs.FakeConfigType(('on', 'off')),
                  default='off'), 'Enable mind-control ui (experimental)'),
             ('voice',
              value.SettingValue(
                  stubs.FakeConfigType(('on', 'off')),
                  default='off'), 'Whether to respond to voice commands'))),
        ('searchengines',
         sections.ValueList(
             stubs.FakeConfigType(),
             stubs.FakeConfigType(),
             ('DEFAULT', 'https://duckduckgo.com/?q={}'),
         )),
    ])
    monkeypatch.setattr(symbol, data)
Example #2
0
                    r'\bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b'),
       "A comma-separated list of regexes to use for 'next' links."),
      ('prev-regexes',
       SettingValue(
           typ.RegexList(flags=re.IGNORECASE),
           r'\bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,'
           r'\b(<<|«)\b'),
       "A comma-separated list of regexes to use for 'prev' links."),
  )),
 ('searchengines',
  sect.ValueList(
      typ.SearchEngineName(),
      typ.SearchEngineUrl(),
      ('DEFAULT', '${duckduckgo}'),
      ('duckduckgo', 'https://duckduckgo.com/?q={}'),
      ('ddg', '${duckduckgo}'),
      ('google', 'https://encrypted.google.com/search?q={}'),
      ('g', '${google}'),
      ('wikipedia', 'http://en.wikipedia.org/w/index.php?'
       'title=Special:Search&search={}'),
      ('wiki', '${wikipedia}'),
  )),
 ('aliases', sect.ValueList(
     typ.String(forbidden=' '),
     typ.Command(),
 )),
 ('colors',
  sect.KeyValue(
      ('completion.fg', SettingValue(
          typ.QtColor(), 'white'), "Text color of the completion widget."),
      ('completion.bg', SettingValue(typ.QssColor(), '#333333'),
       "Background color of the completion widget."),