Created
July 30, 2008 04:01
-
-
Save qingfeng/3222 to your computer and use it in GitHub Desktop.
Django filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Django filter | |
/ 2026M 11%;/data0 107775M 0%;/tmp 2026M 3%;/usr 12186M 5%;/var 10154M 2%;/data1 138236M 0%;/data2 138236M 0%;/data3 138236M 0% | |
-> | |
/ 2026M 11% | |
''' | |
@register.filte | |
def formatRootFSInfo(text): | |
if text==None:return '' | |
diskinfo=text.split(';') | |
diskinfo=filter(lambda x:x.strip()!='M',diskinfo) | |
if len(diskinfo)>0: | |
rootinfo=diskinfo[0] | |
return rootinfo | |
return " " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment