src/modules/misc.py
changeset 3032 d4403c135a96
parent 3031 14865bd92db6
child 3041 9846c3f45f79
equal deleted inserted replaced
3031:14865bd92db6 3032:d4403c135a96
  1354                 if type(entry) != tuple:
  1354                 if type(entry) != tuple:
  1355                         continue
  1355                         continue
  1356                 if len(entry) == 2:
  1356                 if len(entry) == 2:
  1357                         opt, default = entry
  1357                         opt, default = entry
  1358                 elif len(entry) == 3:
  1358                 elif len(entry) == 3:
  1359                         opt, default, valid_args = entry
  1359                         opt, default, dummy_valid_args = entry
  1360                 assert opt in opts_mapping
  1360                 assert opt in opts_mapping
  1361                 sopt, lopt = opts_mapping[opt]
  1361                 sopt, lopt = opts_mapping[opt]
  1362                 # make sure an option was specified
  1362                 # make sure an option was specified
  1363                 assert sopt or lopt
  1363                 assert sopt or lopt
  1364                 if lopt != "":
  1364                 if lopt != "":
  1386                         if type(x) != tuple:
  1386                         if type(x) != tuple:
  1387                                 continue
  1387                                 continue
  1388                         if len(x) == 2:
  1388                         if len(x) == 2:
  1389                                 opt, default = x
  1389                                 opt, default = x
  1390                         elif len(x) == 3:
  1390                         elif len(x) == 3:
  1391                                 opt, default, valid_args = x
  1391                                 opt, default, dummy_valid_args = x
  1392                         if option == opt:
  1392                         if option == opt:
  1393                                 return default
  1393                                 return default
  1394 
  1394 
  1395         # Assemble the options dictionary by passing in the right data types and
  1395         # Assemble the options dictionary by passing in the right data types and
  1396         # take care of duplicates.
  1396         # take care of duplicates.