From 0d097139d62afa05a2af099ea2e83ddd4bb6344d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Sun, 20 Jan 2013 19:16:21 +0100 Subject: [PATCH] Move common segment imports --- powerline/segments/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powerline/segments/common.py b/powerline/segments/common.py index 85435b06..c8e6e25e 100644 --- a/powerline/segments/common.py +++ b/powerline/segments/common.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- import os -import re -import socket -from powerline.lib.vcs import guess from powerline.lib import memoize # Weather condition code descriptions available at http://developer.yahoo.com/weather/#codes @@ -22,6 +19,7 @@ weather_conditions_codes = { def hostname(): + import socket if not os.environ.get('SSH_CLIENT'): return None return socket.gethostname() @@ -37,6 +35,7 @@ def user(): def branch(): + from powerline.lib.vcs import guess repo = guess(os.path.abspath(os.getcwd())) if repo: return repo.branch() @@ -44,6 +43,7 @@ def branch(): def cwd(dir_shorten_len=None, dir_limit_depth=None): + import re cwd = os.getcwdu() home = os.environ.get('HOME') if home: