Changeset 10289


Ignore:
Timestamp:
11 Jun 2013, 09:46:34 (12 years ago)
Author:
Henrik Bettermann
Message:

This should be now a generic solution for all kinds of student ids.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/tools/reload_portraits.py

    r10288 r10289  
    7070
    7171def final_subfolder(stud_id):
    72     # compute new folder name from stud_id (old stud_ids or new stud_ids)
     72    # compute new folder name from stud_id
    7373    try:
    7474        num = int(stud_id[1:])
     75        if len(stud_id) == 7:
     76            # old stud_id
     77            num = num / 10000 * 10
     78        if len(stud_id) == 8:
     79            # new stud_id
     80            num = num / 1000
    7581    except ValueError:
    7682        # new old stud_ids
    7783        num = int(stud_id[2:])
    78     num = num / 10000 * 10
     84        num = num / 10000 * 10
    7985    return '%05d' % num
    8086
Note: See TracChangeset for help on using the changeset viewer.