Skip to content

Commit

Permalink
Merge "formatter.py: remove unused 'inspect'"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed May 30, 2017
2 parents 70c9b22 + 760025f commit aab4688
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pywikibot/tools/formatter.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
"""Module containing various formatting related utilities."""
#
# (C) Pywikibot team, 2015-2016
# (C) Pywikibot team, 2015-2017
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals

__version__ = '$Id$'

import inspect
import math

from string import Formatter
Expand Down Expand Up @@ -72,11 +71,6 @@ class _ColorFormatter(Formatter):
# and background colors.
colors |= set('%s;%s' % (c1, c2) for c1 in colors for c2 in colors)

def __init__(self):
"""Create new instance and store the stack depth."""
super(_ColorFormatter, self).__init__()
self._depth = len(inspect.stack())

def get_value(self, key, args, kwargs):
"""Get value, filling in 'color' when it is a valid color."""
if key == 'color' and kwargs.get('color') in self.colors:
Expand Down

0 comments on commit aab4688

Please sign in to comment.