Ignore:
Timestamp:
Oct 29, 2009, 1:36:42 AM (15 years ago)
Author:
price
Message:

main.py: FieldStorage? is history, so revert to sugared getitem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/main.py

    r2525 r2526  
    205205
    206206    def parseCreate(self, fields):
    207         kws = dict([(kw, fields.get(kw)) for kw in
     207        kws = dict([(kw, fields[kw]) for kw in
    208208         'name description owner memory disksize vmtype cdrom autoinstall'.split()
    209                     if fields.get(kw)])
     209                    if fields[kw]])
    210210        validate = validation.Validate(cherrypy.request.login,
    211211                                       cherrypy.request.state,
     
    235235        d['err'] = err
    236236        if err:
    237             for field in fields.keys():
    238                 setattr(d['defaults'], field, fields.get(field))
     237            for field, value in fields.items():
     238                setattr(d['defaults'], field, value))
    239239        else:
    240240            d['new_machine'] = parsed_fields['name']
     
    300300            info_dict['err'] = err
    301301            if err:
    302                 for field in fields.keys():
    303                     setattr(info_dict['defaults'], field, fields.get(field))
     302                for field, value in fields.items():
     303                    setattr(info_dict['defaults'], field, value)
    304304            info_dict['result'] = result
    305305            return info_dict
     
    582582    session.begin()
    583583    try:
    584         kws = dict([(kw, fields.get(kw)) for kw in
     584        kws = dict([(kw, fields[kw]) for kw in
    585585         'owner admin contact name description memory vmtype disksize'.split()
    586                     if fields.get(kw)])
     586                    if fields[kw]])
    587587        kws['machine_id'] = machine_id
    588588        validate = validation.Validate(username, state, **kws)
Note: See TracChangeset for help on using the changeset viewer.