Changeset 3413 for pykota/trunk/tests

Show
Ignore:
Timestamp:
09/27/08 22:02:37 (16 years ago)
Author:
jerome
Message:

Removed unnecessary spaces at EOL.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/tests/filldb.py

    r3411 r3413  
    99# the Free Software Foundation, either version 3 of the License, or 
    1010# (at your option) any later version. 
    11 #  
     11# 
    1212# This program is distributed in the hope that it will be useful, 
    1313# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1414# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1515# GNU General Public License for more details. 
    16 #  
     16# 
    1717# You should have received a copy of the GNU General Public License 
    1818# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
     
    3232    for bname in billingcodes : 
    3333        argsfile.write("%s\n" % bname) 
    34     argsfile.close()     
    35     os.system('pkbcodes --arguments arguments.list')  
     34    argsfile.close() 
     35    os.system('pkbcodes --arguments arguments.list') 
    3636    return billingcodes 
    3737 
     
    4343    for bname in billingcodes : 
    4444        argsfile.write("%s\n" % bname) 
    45     argsfile.close()     
    46     os.system('pkbcodes --arguments arguments.list')  
    47      
     45    argsfile.close() 
     46    os.system('pkbcodes --arguments arguments.list') 
     47 
    4848def createPrinters(number) : 
    4949    """Creates a number of printers.""" 
     
    5454    for pname in printernames : 
    5555        argsfile.write("%s\n" % pname) 
    56     argsfile.close()     
    57     os.system('pkprinters --arguments arguments.list')  
     56    argsfile.close() 
     57    os.system('pkprinters --arguments arguments.list') 
    5858    return printernames 
    5959 
     
    6565    for pname in printernames : 
    6666        argsfile.write("%s\n" % pname) 
    67     argsfile.close()     
    68     os.system('pkprinters --arguments arguments.list')  
    69      
     67    argsfile.close() 
     68    os.system('pkprinters --arguments arguments.list') 
     69 
    7070def createUsers(number) : 
    7171    """Creates a number of users.""" 
     
    7676    for uname in usernames : 
    7777        argsfile.write("%s\n" % uname) 
    78     argsfile.close()     
    79     os.system('pkusers --arguments arguments.list')  
     78    argsfile.close() 
     79    os.system('pkusers --arguments arguments.list') 
    8080    return usernames 
    8181 
     
    8787    for uname in usernames : 
    8888        argsfile.write("%s\n" % uname) 
    89     argsfile.close()     
    90     os.system('pkusers --arguments arguments.list')  
    91      
     89    argsfile.close() 
     90    os.system('pkusers --arguments arguments.list') 
     91 
    9292def createGroups(number) : 
    9393    """Creates a number of groups.""" 
     
    9898    for gname in groupnames : 
    9999        argsfile.write("%s\n" % gname) 
    100     argsfile.close()     
    101     os.system('pkusers --arguments arguments.list')  
     100    argsfile.close() 
     101    os.system('pkusers --arguments arguments.list') 
    102102    return groupnames 
    103103 
     
    109109    for gname in groupnames : 
    110110        argsfile.write("%s\n" % gname) 
    111     argsfile.close()     
    112     os.system('pkusers --arguments arguments.list')  
    113      
     111    argsfile.close() 
     112    os.system('pkusers --arguments arguments.list') 
     113 
    114114def createUserPQuotas(usernames, printernames) : 
    115115    """Creates a number of user print quota entries.""" 
     
    121121    for uname in usernames : 
    122122        argsfile.write("%s\n" % uname) 
    123     argsfile.close()     
    124     os.system('edpykota --arguments arguments.list')  
     123    argsfile.close() 
     124    os.system('edpykota --arguments arguments.list') 
    125125 
    126126def deleteUserPQuotas(usernames, printernames) : 
     
    133133    for uname in usernames : 
    134134        argsfile.write("%s\n" % uname) 
    135     argsfile.close()     
    136     os.system('edpykota --arguments arguments.list')  
    137      
     135    argsfile.close() 
     136    os.system('edpykota --arguments arguments.list') 
     137 
    138138def createGroupPQuotas(groupnames, printernames) : 
    139139    """Creates a number of group print quota entries.""" 
     
    145145    for gname in groupnames : 
    146146        argsfile.write("%s\n" % gname) 
    147     argsfile.close()     
    148     os.system('edpykota --arguments arguments.list')  
     147    argsfile.close() 
     148    os.system('edpykota --arguments arguments.list') 
    149149 
    150150def deleteGroupPQuotas(groupnames, printernames) : 
     
    157157    for gname in groupnames : 
    158158        argsfile.write("%s\n" % gname) 
    159     argsfile.close()     
    160     os.system('edpykota --arguments arguments.list')  
    161      
    162 if __name__ == "__main__" :     
     159    argsfile.close() 
     160    os.system('edpykota --arguments arguments.list') 
     161 
     162if __name__ == "__main__" : 
    163163    if len(sys.argv) == 1 : 
    164164        sys.stderr.write("usage :  %s  [--nodelete]  NbBillingCodes  NbPrinters  NbUsers  NbGroups\n" % sys.argv[0]) 
    165     else :     
     165    else : 
    166166        delete = True 
    167167        args = sys.argv[1:] 
     
    177177        if nbprinters : 
    178178            printers = createPrinters(nbprinters) 
    179         if nbusers :     
     179        if nbusers : 
    180180            users = createUsers(nbusers) 
    181         if nbgroups :     
     181        if nbgroups : 
    182182            groups = createGroups(nbgroups) 
    183              
    184         if nbusers and nbprinters :     
     183 
     184        if nbusers and nbprinters : 
    185185            createUserPQuotas(users, printers) 
    186186            if delete : 
    187187                deleteUserPQuotas(users, printers) 
    188              
    189         if nbgroups and nbprinters :     
     188 
     189        if nbgroups and nbprinters : 
    190190            createGroupPQuotas(groups, printers) 
    191191            if delete : 
    192192                deleteGroupPQuotas(groups, printers) 
    193              
    194         if delete :     
    195             if nbbillingcodes :     
     193 
     194        if delete : 
     195            if nbbillingcodes : 
    196196                deleteBillingCodes(bcodes) 
    197             if nbgroups :     
     197            if nbgroups : 
    198198                deleteGroups(groups) 
    199             if nbusers :     
     199            if nbusers : 
    200200                deleteUsers(users) 
    201             if nbprinters :     
     201            if nbprinters : 
    202202                deletePrinters(printers) 
    203203        os.remove("arguments.list") 
    204          
     204