Lines 924-929
Link Here
|
924 |
|
924 |
|
925 |
def display(self,mylist): |
925 |
def display(self,mylist): |
926 |
changelogs=[] |
926 |
changelogs=[] |
|
|
927 |
totalsize=0 |
928 |
|
927 |
for x in mylist: |
929 |
for x in mylist: |
928 |
if x[0]=="blocks": |
930 |
if x[0]=="blocks": |
929 |
addl=""+red("B")+" " |
931 |
addl=""+red("B")+" " |
Lines 989-994
Link Here
|
989 |
if ebuild_iuse != "": |
991 |
if ebuild_iuse != "": |
990 |
iuse=iuse+blue("-"+ebuild_iuse)+" " |
992 |
iuse=iuse+blue("-"+ebuild_iuse)+" " |
991 |
|
993 |
|
|
|
994 |
|
995 |
|
996 |
|
997 |
mysize = [0] |
998 |
mydigest = portage.db["/"]["porttree"].dbapi.finddigest(x[2]) |
999 |
|
1000 |
|
1001 |
try: |
1002 |
myfile = open(mydigest,"r") |
1003 |
for line in myfile.readlines(): |
1004 |
mysize[0] += int(line.split(" ")[3]) |
1005 |
myfile.close() |
1006 |
totalsize+=mysize[0] |
1007 |
mystr = str(mysize[0]/1024) |
1008 |
mycount=len(mystr) |
1009 |
while (mycount > 3): |
1010 |
mycount-=3 |
1011 |
mystr=mystr[:mycount]+","+mystr[mycount:] |
1012 |
mysize[0]=mystr+" kB" |
1013 |
except Exception, e: |
1014 |
if edebug: |
1015 |
print "!!! Exception:",e |
1016 |
mysize[0]="Size Unavailable" |
1017 |
|
1018 |
|
1019 |
|
992 |
xs=portage.pkgsplit(x[2]) |
1020 |
xs=portage.pkgsplit(x[2]) |
993 |
if xs[2]=="r0": |
1021 |
if xs[2]=="r0": |
994 |
xs[2]="" |
1022 |
xs[2]="" |
Lines 1012-1019
Link Here
|
1012 |
myprint=myprint+" "*(oldlp-len(myprint)) |
1040 |
myprint=myprint+" "*(oldlp-len(myprint)) |
1013 |
myprint=myprint+myoldbest |
1041 |
myprint=myprint+myoldbest |
1014 |
myprint=myprint+darkgreen(" to "+x[1])+" "+iuse |
1042 |
myprint=myprint+darkgreen(" to "+x[1])+" "+iuse |
|
|
1043 |
myprint=myprint+" "+purple(mysize[0]) |
1015 |
else: |
1044 |
else: |
1016 |
myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+iuse |
1045 |
myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+iuse+" "+purple(mysize[0]) |
1017 |
else: |
1046 |
else: |
1018 |
if "--columns" in myopts: |
1047 |
if "--columns" in myopts: |
1019 |
myprint="["+x[0]+" "+addl+"] "+darkgreen(xs[0]) |
1048 |
myprint="["+x[0]+" "+addl+"] "+darkgreen(xs[0]) |
Lines 1023-1032
Link Here
|
1023 |
if (oldlp-len(myprint)) > 0: |
1052 |
if (oldlp-len(myprint)) > 0: |
1024 |
myprint=myprint+(" "*(oldlp-len(myprint))) |
1053 |
myprint=myprint+(" "*(oldlp-len(myprint))) |
1025 |
myprint=myprint+myoldbest+" "+iuse |
1054 |
myprint=myprint+myoldbest+" "+iuse |
|
|
1055 |
myprint=myprint+" "+purple(mysize[0]) |
1026 |
else: |
1056 |
else: |
1027 |
myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+iuse |
1057 |
myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+iuse+" "+purple(mysize[0]) |
1028 |
print myprint |
1058 |
print myprint |
1029 |
|
1059 |
|
|
|
1060 |
|
1030 |
mysplit=portage.pkgsplit(x[2]) |
1061 |
mysplit=portage.pkgsplit(x[2]) |
1031 |
# XXX mysplit _can_ be None.... Why? |
1062 |
# XXX mysplit _can_ be None.... Why? |
1032 |
if mysplit and (len(mysplit)==3): |
1063 |
if mysplit and (len(mysplit)==3): |
Lines 1054-1059
Link Here
|
1054 |
print bold('*'+revision) |
1085 |
print bold('*'+revision) |
1055 |
sys.stdout.write(text) |
1086 |
sys.stdout.write(text) |
1056 |
|
1087 |
|
|
|
1088 |
mystr = str(totalsize/1024) |
1089 |
mycount=len(mystr) |
1090 |
while (mycount > 3): |
1091 |
mycount-=3 |
1092 |
mystr=mystr[:mycount]+","+mystr[mycount:] |
1093 |
print |
1094 |
print "Total size of downloads: "+purple(mystr+" kb") |
1095 |
|
1057 |
def calc_changelog(self,ebuildpath,current,next): |
1096 |
def calc_changelog(self,ebuildpath,current,next): |
1058 |
current = '-'.join(portage.catpkgsplit(current)[1:]) |
1097 |
current = '-'.join(portage.catpkgsplit(current)[1:]) |
1059 |
if current.endswith('-r0'): current = current[:-3] |
1098 |
if current.endswith('-r0'): current = current[:-3] |