Merge branch 'master' of https://github.com/The-Compiler/qutebrowser into toggletab
This commit is contained in:
commit
dffa7ccf46
@ -130,8 +130,8 @@ Contributors, sorted by the number of commits in descending order:
|
||||
// QUTE_AUTHORS_START
|
||||
* Florian Bruhin
|
||||
* Claude
|
||||
* John ShaggyTwoDope Jenkins
|
||||
* Peter Vilim
|
||||
* John ShaggyTwoDope Jenkins
|
||||
* rikn00
|
||||
* Martin Zimmermann
|
||||
* Joel Torstensson
|
||||
@ -145,6 +145,7 @@ Contributors, sorted by the number of commits in descending order:
|
||||
* Matthias Lisin
|
||||
* Helen Sherwood-Taylor
|
||||
* HalosGhost
|
||||
* Eivind Uggedal
|
||||
* Andreas Fischer
|
||||
// QUTE_AUTHORS_END
|
||||
|
||||
|
@ -80,6 +80,16 @@ in your `PYTHON_TARGETS` (`/etc/portage/make.conf`) and rebuild your system
|
||||
# emerge -av qutebrowser
|
||||
----
|
||||
|
||||
On Void Linux
|
||||
-------------
|
||||
|
||||
qutebrowser is available in the official repositories and can be installed
|
||||
with:
|
||||
|
||||
----
|
||||
# xbps-install qutebrowser
|
||||
----
|
||||
|
||||
On Windows
|
||||
----------
|
||||
|
||||
|
@ -116,8 +116,10 @@ class SettingValueCompletionModel(base.BaseCompletionModel):
|
||||
value = '""'
|
||||
self.cur_item, _descitem, _miscitem = self.new_item(cur_cat, value,
|
||||
"Current value")
|
||||
self.new_item(cur_cat, configdata.DATA[section][option].default(),
|
||||
"Default value")
|
||||
default_value = configdata.DATA[section][option].default()
|
||||
if not default_value:
|
||||
default_value = '""'
|
||||
self.new_item(cur_cat, default_value, "Default value")
|
||||
if hasattr(configdata.DATA[section], 'valtype'):
|
||||
# Same type for all values (ValueList)
|
||||
vals = configdata.DATA[section].valtype.complete()
|
||||
|
@ -78,20 +78,32 @@ def _adjusted_pythonpath(name):
|
||||
del os.environ['PYTHONPATH']
|
||||
|
||||
|
||||
def run(name, target=None):
|
||||
def run(name, target=None, print_version=False):
|
||||
"""Run a checker via distutils with optional args.
|
||||
|
||||
Arguments:
|
||||
name: Name of the checker/binary
|
||||
target: The package to check
|
||||
print_version: Whether to print the checker version.
|
||||
"""
|
||||
# pylint: disable=too-many-branches
|
||||
args = _get_args(name)
|
||||
if target is not None:
|
||||
args.append(target)
|
||||
with _adjusted_pythonpath(name):
|
||||
if os.name == 'nt':
|
||||
exename = name + '.exe'
|
||||
else:
|
||||
exename = name
|
||||
# for virtualenvs
|
||||
executable = os.path.join(os.path.dirname(sys.executable), exename)
|
||||
if not os.path.exists(executable):
|
||||
# in $PATH
|
||||
executable = name
|
||||
if print_version:
|
||||
subprocess.call([executable, '--version'])
|
||||
try:
|
||||
status = subprocess.call([name] + args)
|
||||
status = subprocess.call([executable] + args)
|
||||
except OSError:
|
||||
traceback.print_exc()
|
||||
status = None
|
||||
@ -99,9 +111,15 @@ def run(name, target=None):
|
||||
return status
|
||||
|
||||
|
||||
def check_pep257(target):
|
||||
"""Run pep257 checker with args passed."""
|
||||
def check_pep257(target, print_version=False):
|
||||
"""Run pep257 checker with args passed.
|
||||
|
||||
We use this rather than run() because on some systems (e.g. Windows) no
|
||||
pep257 binary is available.
|
||||
"""
|
||||
# pylint: disable=assignment-from-no-return,no-member
|
||||
if print_version:
|
||||
print(pep257.__version__)
|
||||
args = _get_args('pep257')
|
||||
sys.argv = ['pep257', target]
|
||||
if args is not None:
|
||||
@ -232,7 +250,7 @@ def _get_args(checker):
|
||||
return args
|
||||
|
||||
|
||||
def _get_checkers():
|
||||
def _get_checkers(args):
|
||||
"""Get a dict of checkers we need to execute."""
|
||||
# "Static" checkers
|
||||
checkers = collections.OrderedDict([
|
||||
@ -241,17 +259,18 @@ def _get_checkers():
|
||||
('git', check_git),
|
||||
])),
|
||||
('setup', collections.OrderedDict([
|
||||
('pyroma', functools.partial(run, 'pyroma')),
|
||||
('check-manifest', functools.partial(run, 'check-manifest')),
|
||||
('pyroma', functools.partial(run, 'pyroma', args.version)),
|
||||
('check-manifest', functools.partial(run, 'check-manifest',
|
||||
args.version)),
|
||||
])),
|
||||
])
|
||||
# "Dynamic" checkers which exist once for each target.
|
||||
for target in config.get('DEFAULT', 'targets').split(','):
|
||||
checkers[target] = collections.OrderedDict([
|
||||
('pep257', functools.partial(check_pep257, target)),
|
||||
('flake8', functools.partial(run, 'flake8', target)),
|
||||
('pep257', functools.partial(check_pep257, target, args.version)),
|
||||
('flake8', functools.partial(run, 'flake8', target, args.version)),
|
||||
('vcs', functools.partial(check_vcs_conflict, target)),
|
||||
('pylint', functools.partial(run, 'pylint', target)),
|
||||
('pylint', functools.partial(run, 'pylint', target, args.version)),
|
||||
])
|
||||
return checkers
|
||||
|
||||
@ -275,6 +294,8 @@ def _parse_args():
|
||||
parser.add_argument('-q', '--quiet',
|
||||
help="Don't print unnecessary headers.",
|
||||
action='store_true')
|
||||
parser.add_argument('-V', '--version',
|
||||
help="Print checker versions.", action='store_true')
|
||||
parser.add_argument('checkers', help="Checkers to run (or 'all')",
|
||||
default='all', nargs='?')
|
||||
return parser.parse_args()
|
||||
@ -290,7 +311,7 @@ def main():
|
||||
exit_status_bool = {}
|
||||
|
||||
args = _parse_args()
|
||||
checkers = _get_checkers()
|
||||
checkers = _get_checkers(args)
|
||||
|
||||
groups = ['global']
|
||||
groups += config.get('DEFAULT', 'targets').split(',')
|
||||
|
@ -389,7 +389,7 @@ def regenerate_manpage(filename):
|
||||
options = '\n'.join(groups)
|
||||
# epilog
|
||||
if parser.epilog is not None:
|
||||
options.append(parser.epilog)
|
||||
options += parser.epilog
|
||||
_format_block(filename, 'options', options)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user