Changeset 60 for pykoticon

Show
Ignore:
Timestamp:
01/15/05 12:28:54 (20 years ago)
Author:
jerome
Message:

Cleaned the code a bit

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykoticon/trunk/bin/pykoticon

    r59 r60  
    152152        """Retrieves the user account and quota information.""" 
    153153        info = self.getUserInfo(username) 
    154         quotas = self.getUserPQuotas(username) 
    155         return User(username, info, quotas) 
    156      
    157 def getWindowsUserName() :     
    158     """Retrieves the current user's name under MS Windows.""" 
    159     return win32api.GetUserName() 
     154        if info : 
     155            quotas = self.getUserPQuotas(username) 
     156            return User(username, info, quotas) 
    160157     
    161158class PyKotIcon(wxPython.wx.wxFrame): 
     
    255252def test() : 
    256253    """Runs in test mode (console).""" 
    257     username = getWindowsUserName() 
     254    if len(sys.argv) >= 3 : 
     255        username = sys.argv[2]  
     256    else :     
     257        username = win32api.GetUserName() 
    258258    net = CGINetworkInterface(DUMPYKOTA_URL) 
    259259    user = net.getUser(username) 
     
    270270 
    271271if __name__ == '__main__': 
    272     if (len(sys.argv) == 2) and (sys.argv[1] == "--test") : 
     272    if (len(sys.argv) >= 2) and (sys.argv[1] == "--test") : 
    273273        test() 
    274274    else :