Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.39 KB | None | 0 0
  1.         session.ibscustomer = plugins.ibs.getCustomerBySmartcard(params.card_nr)
  2.  
  3.     if not session.ibscustomer:
  4.         h.redirect('/ibsinput', 'Needs Customer')
  5.  
  6.     boxmap = {
  7.         101: {'label': 'Motorola VIP1510/1710', 'type': '1510'},
  8.         826: {'label': 'Motorola VIP1910',      'type': '1910'},
  9.         791: {'label': 'Amino',                 'type': 'amino'},
  10.         150: {'label': 'Sagem HD-Combo',        'type': 'hdc'},
  11.         828: {'label': 'Sagem HD-Zapper',       'type': 'hdz'},
  12.         897: {'label': 'Sagem HD-Zapper',       'type': 'hdz'},
  13.         160: {'label': 'Kjaerulff',             'type': 'kjaerulff'},
  14.         827: {'label': 'HD-PVR',                'type': 'pvr'},
  15.         794: {'label': 'Force Combo',           'type': 'forcecombo'},
  16.         85:  {'label': 'Handan Combo',          'type': 'handancombo'},
  17.         140: {'label': 'Sagem HD-PVR',          'type': 'dthpvr'},
  18.         130: {'label': 'Sagem HD-Combo',        'type': 'dthhdcombo'},
  19.         111: {'label': 'Grundig PVR',           'type': 'grundigpvr'},
  20.         120: {'label': 'Handan Zapper',         'type': 'handanzapper'},
  21.         70:  {'label': 'Media Highway',         'type': 'mhw'},
  22.         74:  {'label': 'Media Highway',         'type': 'mhw'},
  23.         895: {'label': 'IDTV-CA',               'type': 'idtv'},
  24.         666: {'label': 'Motorola VIP1903',      'type': '1903'}
  25.     }
  26.  
  27.     for box in session.ibscustomer.getBoxes():
  28.         mapent = boxmap.get(box.modelid, {'label':box.model, 'type': box.model})
  29.         box.label = mapent['label']
  30.         box.type = mapent['type']
  31.         box.recognized = box.modelid in boxmap
  32.  
  33.     cardmap = { 345: {'label': 'Smardcard Edge-QAM/IP',   'type': 'ip'},
  34.                 824: {'label': 'Smartcard IP/Edge-QAM',   'type': 'catv'},
  35.                 358: {'label': 'Smardcard QAM',           'type': 'net'},
  36.                 340: {'label': 'Smartcard Media Highway', 'type': 'mhw'},}
  37.  
  38.     for card in session.ibscustomer.getSmartcards():
  39.         mapent = cardmap.get(card.modelid, {'label':card.model, 'type': card.model})
  40.         card.label = mapent['label']
  41.         card.type = mapent['type']
  42.  
  43. except Exception, e:
  44.     print "Got Exception %s" % e
  45.     h.redirect('/ibsinput', 'Error while loading customer')
  46. %>
  47. ~
  48.                                                                                                                       33,1         Bott
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement