PEP8: Fix whitespace
[openblackhole/openblackhole-enigma2.git] / tools / host_tools / FormatConverter / main.py
1 #!/usr/bin/python
2 from datasource import genericdatasource
3 from satxml import satxml
4 from lamedb import lamedb
5 from input import *
6 import sys
7 import os
8
9 maindata = genericdatasource()
10
11 sources = [satxml, lamedb]
12
13 datasources = [maindata]
14
15 for source in sources:
16         datasources.append(source())
17
18 for source in datasources:
19         source.setDatasources(datasources)
20
21 while(True):
22         os.system("/usr/bin/clear")
23         list = []
24         for index in range(len(datasources)):
25                 list.append(datasources[index].getName() + (" (%d sats)" % len(datasources[index].transponderlist.keys())))
26         index = inputChoices(list, "q", "quit")
27         if index is None:
28                 break
29
30         while(True):
31                 print datasources[index].getStatus()
32                 list = []
33                 for action in datasources[index].getCapabilities():
34                         list.append(action[0])
35                 action = inputChoices(list)
36                 if action is None:
37                         break
38
39                 datasources[index].getCapabilities()[action][1]()
40                 #except:
41                 #       print sys.exc_info()
42                 #       print "sorry, could not execute that command"