8000 Fix lint related to operator positioning by bz2 · Pull Request #273 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Fix lint related to operator positioning #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions prometheus_client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ def add_sample(self, name, labels, value):
self.samples.append((name, labels, value))

def __eq__(self, other):
return (isinstance(other, Metric)
and self.name == other.name
and self.documentation == other.documentation
and self.type == other.type
and self.samples == other.samples)
return (isinstance(other, Metric) and
self.name == other.name and
self.documentation == other.documentation and
self.type == other.type and
self.samples == other.samples)


class UntypedMetricFamily(Metric):
Expand Down Expand Up @@ -722,10 +722,11 @@ def f():
'''
_type = 'gauge'
_reserved_labelnames = []
_MULTIPROC_MODES = frozenset(('min', 'max', 'livesum', 'liveall', 'all'))

def __init__(self, name, labelnames, labelvalues, multiprocess_mode='all'):
if (_ValueClass._multiprocess
and multiprocess_mode not in ['min', 'max', 'livesum', 'liveall', 'all']):
if (_ValueClass._multiprocess and
multiprocess_mode not in self._MULTIPROC_MODES):
raise ValueError('Invalid multiprocess mode: ' + multiprocess_mode)
self._value = _ValueClass(
self._type, name, name, labelnames, labelvalues,
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,5 @@ ignore =
E741,
F841,
W293,
W503
import-order-style = google
application-import-names = prometheus_client
0