diff --git a/twander.py b/twander.py index 1845359..656b5cc 100755 --- a/twander.py +++ b/twander.py @@ -6,12 +6,12 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 3.227 2009/06/28 07:13:58 tundra Exp $" +RCSID = "$Id: twander.py,v 3.228 2009/06/28 07:21:32 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information -DATE = "2002-2007" +DATE = "2002-2009" CPRT = "(c)" OWNER = "TundraWare Inc." RIGHTS = "All Rights Reserved." @@ -586,8 +586,8 @@ ST_SZMODE = 12 ST_SZNLINK = 5 -ST_SZUNAME = 12 -ST_SZGNAME = 12 +ST_SZUNAME = 18 +ST_SZGNAME = 18 ST_SZLEN = MAX_SZ_FIELD ST_SZMTIME = 18 @@ -1166,25 +1166,17 @@ def PadString(string, width, Rjust=False, Trailing=0): - # Only attempt this if there is room to do it - - if width >= len(string) + Trailing: - s = string[:(width-1)] - if Rjust: - s = s.rjust(width) - else: - s = s.ljust(width) - - # Rotate 'Trailing' number of spaces from left of string to right - - while (Trailing > 0) and (s[0] == ' ') : - s = s[1:] + ' ' - Trailing -= 1 - - # If not, indicate problem - + s = string[:(width-1)] + if Rjust: + s = s.rjust(width) else: - s = "X " + s = s.ljust(width) + + # Rotate 'Trailing' number of spaces from left of string to right + + while (Trailing > 0) and (s[0] == ' ') : + s = s[1:] + ' ' + Trailing -= 1 return s @@ -4660,7 +4652,7 @@ # Convert UID to name, if possible try: - owner = pwd.getpwuid(stinfo[ST_UID])[0] + owner = pwd.getpwuid(stinfo[ST_UID])[0][:ST_SZUNAME-1] # No valid name associated with UID, so use number instead except: @@ -4668,7 +4660,7 @@ # Convert GID to name, if possible try: - group = grp.getgrgid(stinfo[ST_GID])[0] + group = grp.getgrgid(stinfo[ST_GID])[0][:ST_SZGNAME-1] # No valid name associated with GID, so use number instead except: @@ -5453,8 +5445,7 @@ UI.OptionsNumeric = {"AFTERWAIT":AFTERWAIT,"DEBUGLEVEL":DEBUGLEVEL, "FSZ":FSZ, "MFSZ":MFSZ, "HFSZ":HFSZ, "HEIGHT":HEIGHT, "MAXMENU":MAXMENU, "MAXMENUBUF":MAXMENUBUF, "MAXNESTING":MAXNESTING, - "REFRESHINT":REFRESHINT, "SCALEPRECISION":SCALEPRECISION, "STARTX":STARTX, "STARTY":STARTY, - "ST_SZUNAME":ST_SZUNAME, "ST_SZGNAME":ST_SZGNAME, "ST_SZLEN":ST_SZLEN, "WIDTH":WIDTH} + "REFRESHINT":REFRESHINT, "SCALEPRECISION":SCALEPRECISION, "STARTX":STARTX, "STARTY":STARTY, "WIDTH":WIDTH} UI.OptionsString = {"BCOLOR":BCOLOR, "FCOLOR":FCOLOR, "FNAME":FNAME, "FWT":FWT, # Main Font/Colors "MBCOLOR":MBCOLOR, "MFCOLOR":MFCOLOR, "MFNAME":MFNAME, "MFWT":MFWT, # Menu Font/Colors