diff --git a/powerline/config_files/themes/ascii.json b/powerline/config_files/themes/ascii.json index 7875f219..7b49da21 100644 --- a/powerline/config_files/themes/ascii.json +++ b/powerline/config_files/themes/ascii.json @@ -29,13 +29,16 @@ "before": "" }, - "powerline.segments.common.network_load": { + "powerline.segments.common.net.network_load": { "args": { "recv_format": "DL {value:>8}", "sent_format": "UL {value:>8}" } }, - "powerline.segments.common.now_playing": { + "powerline.segments.common.net.hostname": { + "before": "H " + }, + "powerline.segments.common.players.now_playing": { "args": { "state_symbols": { "fallback": "", @@ -45,25 +48,22 @@ } } }, - "powerline.segments.common.battery": { + "powerline.segments.common.bat.battery": { "args": { "full_heart": "O", "empty_heart": "O" } }, - "powerline.segments.common.uptime": { + "powerline.segments.common.sys.uptime": { "before": "UP " }, - "powerline.segments.common.email_imap_alert": { + "powerline.segments.common.mail.email_imap_alert": { "before": "MAIL " }, - "powerline.segments.common.virtualenv": { + "powerline.segments.common.env.virtualenv": { "before": "(e) " }, - "powerline.segments.common.hostname": { - "before": "H " - }, - "powerline.segments.common.weather": { + "powerline.segments.common.wthr.weather": { "args": { "icons": { "day": "DAY", @@ -82,7 +82,7 @@ "temp_format": "{temp:.0f} C" } }, - "powerline.segments.common.fuzzy_time": { + "powerline.segments.common.time.fuzzy_time": { "args": { "unicode_text": false } diff --git a/powerline/config_files/themes/ipython/in.json b/powerline/config_files/themes/ipython/in.json index 6218b3ab..b8957753 100644 --- a/powerline/config_files/themes/ipython/in.json +++ b/powerline/config_files/themes/ipython/in.json @@ -1,9 +1,8 @@ { - "default_module": "powerline.segments.common", "segments": { "left": [ { - "function": "virtualenv", + "function": "powerline.segments.common.env.virtualenv", "priority": 10 }, { diff --git a/powerline/config_files/themes/ipython/in2.json b/powerline/config_files/themes/ipython/in2.json index 601fc9e5..ce54e1bb 100644 --- a/powerline/config_files/themes/ipython/in2.json +++ b/powerline/config_files/themes/ipython/in2.json @@ -1,5 +1,4 @@ { - "default_module": "powerline.segments.common", "segments": { "left": [ { diff --git a/powerline/config_files/themes/powerline.json b/powerline/config_files/themes/powerline.json index 859d8341..bba3b541 100644 --- a/powerline/config_files/themes/powerline.json +++ b/powerline/config_files/themes/powerline.json @@ -28,13 +28,16 @@ "before": "⌚ " }, - "powerline.segments.common.network_load": { + "powerline.segments.common.net.network_load": { "args": { "recv_format": "⬇ {value:>8}", "sent_format": "⬆ {value:>8}" } }, - "powerline.segments.common.now_playing": { + "powerline.segments.common.net.hostname": { + "before": " " + }, + "powerline.segments.common.players.now_playing": { "args": { "state_symbols": { "fallback": "♫", @@ -44,25 +47,22 @@ } } }, - "powerline.segments.common.battery": { + "powerline.segments.common.bat.battery": { "args": { "full_heart": "♥", "empty_heart": "♥" } }, - "powerline.segments.common.uptime": { + "powerline.segments.common.sys.uptime": { "before": "⇑ " }, - "powerline.segments.common.email_imap_alert": { + "powerline.segments.common.mail.email_imap_alert": { "before": "✉ " }, - "powerline.segments.common.virtualenv": { + "powerline.segments.common.env.virtualenv": { "before": "ⓔ " }, - "powerline.segments.common.hostname": { - "before": " " - }, - "powerline.segments.common.weather": { + "powerline.segments.common.wthr.weather": { "args": { "icons": { "day": "〇", @@ -80,7 +80,7 @@ } } }, - "powerline.segments.common.fuzzy_time": { + "powerline.segments.common.time.fuzzy_time": { "args": { "unicode_text": true } diff --git a/powerline/config_files/themes/shell/default.json b/powerline/config_files/themes/shell/default.json index 6ba1ba6d..480da5c9 100644 --- a/powerline/config_files/themes/shell/default.json +++ b/powerline/config_files/themes/shell/default.json @@ -1,20 +1,19 @@ { - "default_module": "powerline.segments.common", "segments": { "left": [ { "function": "powerline.segments.shell.mode" }, { - "function": "hostname", + "function": "powerline.segments.common.net.hostname", "priority": 10 }, { - "function": "user", + "function": "powerline.segments.common.env.user", "priority": 30 }, { - "function": "virtualenv", + "function": "powerline.segments.common.env.virtualenv", "priority": 50 }, { @@ -32,7 +31,7 @@ "priority": 10 }, { - "function": "branch", + "function": "powerline.segments.common.vcs.branch", "priority": 40 } ] diff --git a/powerline/config_files/themes/shell/default_leftonly.json b/powerline/config_files/themes/shell/default_leftonly.json index 018847ba..61e59f81 100644 --- a/powerline/config_files/themes/shell/default_leftonly.json +++ b/powerline/config_files/themes/shell/default_leftonly.json @@ -1,21 +1,20 @@ { - "default_module": "powerline.segments.common", "segments": { "left": [ { - "function": "hostname", + "function": "powerline.segments.common.net.hostname", "priority": 10 }, { - "function": "user", + "function": "powerline.segments.common.env.user", "priority": 30 }, { - "function": "virtualenv", + "function": "powerline.segments.common.env.virtualenv", "priority": 50 }, { - "function": "branch", + "function": "powerline.segments.common.vcs.branch", "priority": 40 }, { diff --git a/powerline/config_files/themes/tmux/default.json b/powerline/config_files/themes/tmux/default.json index 780f34f2..4532cedc 100644 --- a/powerline/config_files/themes/tmux/default.json +++ b/powerline/config_files/themes/tmux/default.json @@ -1,20 +1,19 @@ { - "default_module": "powerline.segments.common", "segments": { "right": [ { - "function": "uptime", + "function": "powerline.segments.common.sys.uptime", "priority": 50 }, { - "function": "system_load", + "function": "powerline.segments.common.sys.system_load", "priority": 50 }, { - "function": "date" + "function": "powerline.segments.common.time.date" }, { - "function": "date", + "function": "powerline.segments.common.time.date", "name": "time", "args": { "format": "%H:%M", @@ -22,7 +21,7 @@ } }, { - "function": "hostname" + "function": "powerline.segments.common.net.hostname" } ] } diff --git a/powerline/config_files/themes/unicode.json b/powerline/config_files/themes/unicode.json index a3b5a365..de74c23b 100644 --- a/powerline/config_files/themes/unicode.json +++ b/powerline/config_files/themes/unicode.json @@ -28,13 +28,16 @@ "before": "⌚ " }, - "powerline.segments.common.network_load": { + "powerline.segments.common.net.network_load": { "args": { "recv_format": "⬇ {value:>8}", "sent_format": "⬆ {value:>8}" } }, - "powerline.segments.common.now_playing": { + "powerline.segments.common.net.hostname": { + "before": "⌂ " + }, + "powerline.segments.common.players.now_playing": { "args": { "state_symbols": { "fallback": "♫", @@ -44,25 +47,22 @@ } } }, - "powerline.segments.common.battery": { + "powerline.segments.common.bat.battery": { "args": { "full_heart": "♥", "empty_heart": "♥" } }, - "powerline.segments.common.uptime": { + "powerline.segments.common.sys.uptime": { "before": "⇑ " }, - "powerline.segments.common.email_imap_alert": { + "powerline.segments.common.mail.email_imap_alert": { "before": "✉ " }, - "powerline.segments.common.virtualenv": { + "powerline.segments.common.env.virtualenv": { "before": "ⓔ " }, - "powerline.segments.common.hostname": { - "before": "⌂ " - }, - "powerline.segments.common.weather": { + "powerline.segments.common.wthr.weather": { "args": { "icons": { "day": "〇", @@ -80,7 +80,7 @@ } } }, - "powerline.segments.common.fuzzy_time": { + "powerline.segments.common.time.fuzzy_time": { "args": { "unicode_text": true } diff --git a/powerline/config_files/themes/unicode_terminus.json b/powerline/config_files/themes/unicode_terminus.json index e435ea93..33a06395 100644 --- a/powerline/config_files/themes/unicode_terminus.json +++ b/powerline/config_files/themes/unicode_terminus.json @@ -28,13 +28,16 @@ "before": "" }, - "powerline.segments.common.network_load": { + "powerline.segments.common.net.network_load": { "args": { "recv_format": "⇓ {value:>8}", "sent_format": "⇑ {value:>8}" } }, - "powerline.segments.common.now_playing": { + "powerline.segments.common.net.hostname": { + "before": "⌂ " + }, + "powerline.segments.common.players.now_playing": { "args": { "state_symbols": { "fallback": "♫", @@ -44,25 +47,22 @@ } } }, - "powerline.segments.common.battery": { + "powerline.segments.common.bat.battery": { "args": { "full_heart": "♥", "empty_heart": "♥" } }, - "powerline.segments.common.uptime": { + "powerline.segments.common.sys.uptime": { "before": "↑ " }, - "powerline.segments.common.email_imap_alert": { + "powerline.segments.common.mail.email_imap_alert": { "before": "MAIL " }, - "powerline.segments.common.virtualenv": { + "powerline.segments.common.env.virtualenv": { "before": "(e) " }, - "powerline.segments.common.hostname": { - "before": "⌂ " - }, - "powerline.segments.common.weather": { + "powerline.segments.common.wthr.weather": { "args": { "icons": { "day": "DAY", @@ -80,7 +80,7 @@ } } }, - "powerline.segments.common.fuzzy_time": { + "powerline.segments.common.time.fuzzy_time": { "args": { "unicode_text": true } diff --git a/powerline/config_files/themes/unicode_terminus_condensed.json b/powerline/config_files/themes/unicode_terminus_condensed.json index c4266ee6..a386c7cd 100644 --- a/powerline/config_files/themes/unicode_terminus_condensed.json +++ b/powerline/config_files/themes/unicode_terminus_condensed.json @@ -29,13 +29,16 @@ "before": "" }, - "powerline.segments.common.network_load": { + "powerline.segments.common.net.network_load": { "args": { "recv_format": "⇓{value:>8}", "sent_format": "⇑{value:>8}" } }, - "powerline.segments.common.now_playing": { + "powerline.segments.common.net.hostname": { + "before": "⌂" + }, + "powerline.segments.common.players.now_playing": { "args": { "state_symbols": { "fallback": "♫", @@ -45,25 +48,22 @@ } } }, - "powerline.segments.common.battery": { + "powerline.segments.common.bat.battery": { "args": { "full_heart": "♥", "empty_heart": "♥" } }, - "powerline.segments.common.uptime": { + "powerline.segments.common.sys.uptime": { "before": "↑" }, - "powerline.segments.common.email_imap_alert": { + "powerline.segments.common.mail.email_imap_alert": { "before": "M " }, - "powerline.segments.common.virtualenv": { + "powerline.segments.common.env.virtualenv": { "before": "E " }, - "powerline.segments.common.hostname": { - "before": "⌂" - }, - "powerline.segments.common.weather": { + "powerline.segments.common.wthr.weather": { "args": { "icons": { "day": "D", @@ -81,7 +81,7 @@ } } }, - "powerline.segments.common.fuzzy_time": { + "powerline.segments.common.time.fuzzy_time": { "args": { "unicode_text": true } diff --git a/powerline/config_files/themes/wm/default.json b/powerline/config_files/themes/wm/default.json index 009c4924..579080d1 100644 --- a/powerline/config_files/themes/wm/default.json +++ b/powerline/config_files/themes/wm/default.json @@ -1,16 +1,15 @@ { - "default_module": "powerline.segments.common", "segments": { "right": [ { - "function": "weather", + "function": "powerline.segments.common.wthr.weather", "priority": 50 }, { - "function": "date" + "function": "powerline.segments.common.time.date" }, { - "function": "date", + "function": "powerline.segments.common.time.date", "name": "time", "args": { "format": "%H:%M", @@ -18,7 +17,7 @@ } }, { - "function": "email_imap_alert", + "function": "powerline.segments.common.mail.email_imap_alert", "priority": 10, "args": { "username": "", diff --git a/powerline/lint/imp.py b/powerline/lint/imp.py index 6e402132..98b7591b 100644 --- a/powerline/lint/imp.py +++ b/powerline/lint/imp.py @@ -21,6 +21,12 @@ class WithPath(object): def import_function(function_type, name, data, context, echoerr, module): havemarks(name, module) + if module == 'powerline.segments.common': + echoerr(context='Warning while checking segments (key {key})'.format(key=context.key), + context_mark=name.mark, + problem='module {0} is deprecated'.format(module), + problem_mark=module.mark) + with WithPath(data['import_paths']): try: func = getattr(__import__(str(module), fromlist=[str(name)]), str(name))