Move with_docstring function to powerline.segments

This commit is contained in:
ZyX 2014-08-24 19:19:12 +04:00
parent f4e49e2ee6
commit 86c3768e4e
3 changed files with 8 additions and 8 deletions

View File

@ -256,8 +256,3 @@ class KwThreadedSegment(ThreadedSegment):
@staticmethod
def render_one(update_state, **kwargs):
return update_state
def with_docstring(instance, doc):
instance.__doc__ = doc
return instance

View File

@ -56,3 +56,8 @@ class Segment(object):
'''Returns a list of (additional argument name[, default value]) tuples.
'''
return ()
def with_docstring(instance, doc):
instance.__doc__ = doc
return instance

View File

@ -15,12 +15,12 @@ from powerline.lib import add_divider_highlight_group
from powerline.lib.shell import asrun, run_cmd
from powerline.lib.url import urllib_read, urllib_urlencode
from powerline.lib.vcs import guess, tree_status
from powerline.lib.threaded import ThreadedSegment, KwThreadedSegment, with_docstring
from powerline.lib.threaded import ThreadedSegment, KwThreadedSegment
from powerline.lib.monotonic import monotonic
from powerline.lib.humanize_bytes import humanize_bytes
from powerline.lib.unicode import u
from powerline.theme import requires_segment_info, requires_filesystem_watcher
from powerline.segments import Segment
from powerline.segments import Segment, with_docstring
from collections import namedtuple