Deprecate powerline.segments.common

Makes linter emit a warning
This commit is contained in:
ZyX 2014-09-21 02:10:13 +04:00
parent 26365a9620
commit 3c1d5c615c
12 changed files with 79 additions and 79 deletions

View File

@ -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
}

View File

@ -1,9 +1,8 @@
{
"default_module": "powerline.segments.common",
"segments": {
"left": [
{
"function": "virtualenv",
"function": "powerline.segments.common.env.virtualenv",
"priority": 10
},
{

View File

@ -1,5 +1,4 @@
{
"default_module": "powerline.segments.common",
"segments": {
"left": [
{

View File

@ -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
}

View File

@ -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
}
]

View File

@ -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
},
{

View File

@ -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"
}
]
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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": "",

View File

@ -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))