Browse Source

parametrizējams streams.cfg

Ivars 7 years ago
parent
commit
e97c8699a9
4 changed files with 288 additions and 487 deletions
  1. 8
    7
      ContentSources.py
  2. 270
    468
      project.wpr
  3. 8
    10
      run.py
  4. 2
    2
      sources/config.py

+ 8
- 7
ContentSources.py View File

18
     """Wrapper for content sources plugin"""
18
     """Wrapper for content sources plugin"""
19
 
19
 
20
     #----------------------------------------------------------------------
20
     #----------------------------------------------------------------------
21
-    def __init__(self, plugin_path):
21
+    def __init__(self, plugin_path, cfg_file="streams.cfg"):
22
         self.plugins = {}
22
         self.plugins = {}
23
         self.error_content = [("..atpakaļ", "back", "back.png", "Kļūda, atgriezties atpakaļ")]
23
         self.error_content = [("..atpakaļ", "back", "back.png", "Kļūda, atgriezties atpakaļ")]
24
         sys.path.insert(0, plugin_path)
24
         sys.path.insert(0, plugin_path)
35
                 mod = __import__(fname)
35
                 mod = __import__(fname)
36
                 reload(mod)
36
                 reload(mod)
37
                 if "Source" in dir(mod):
37
                 if "Source" in dir(mod):
38
-                    self.plugins[fname] = mod.Source()
38
+                    if mod.__name__ == "config":
39
+                        self.plugins[fname] = mod.Source(cfg_file=cfg_file)
40
+                    else:
41
+                        self.plugins[fname] = mod.Source()
39
                     print fname+ " imported"
42
                     print fname+ " imported"
40
                 else:
43
                 else:
41
                     pass
44
                     pass
174
 if __name__ == "__main__":
177
 if __name__ == "__main__":
175
     from run import run
178
     from run import run
176
     show_hidden = False
179
     show_hidden = False
177
-    if len(sys.argv)>1:
178
-        data= sys.argv[1]
179
-    else:
180
-        data = "config::home"
181
-    sources = ContentSources("sources")
180
+    data= sys.argv[1] if len(sys.argv) > 1 else "config::home"
181
+    cfg_file = sys.argv[2] if len(sys.argv) > 2 else "streams.cfg"
182
+    sources = ContentSources("sources", cfg_file=cfg_file)
182
     run(sources, data)
183
     run(sources, data)

+ 270
- 468
project.wpr View File

12
                         'watch_for_changes': True}]
12
                         'watch_for_changes': True}]
13
 proj.file-type = 'normal'
13
 proj.file-type = 'normal'
14
 proj.launch-config = {loc('ContentSources.py'): ('project',
14
 proj.launch-config = {loc('ContentSources.py'): ('project',
15
-        (u'ltc::home',
15
+        (u'config::home streams_bernu.cfg',
16
          '')),
16
          '')),
17
                       loc('iub_db.py'): ('project',
17
                       loc('iub_db.py'): ('project',
18
         (u'-d 90   -s -o',
18
         (u'-d 90   -s -o',
28
         '')),
28
         '')),
29
                       loc('iubx2.py'): ('project',
29
                       loc('iubx2.py'): ('project',
30
         (u'-sgr -d 10',
30
         (u'-sgr -d 10',
31
-         ''))}
31
+         '')),
32
+                      loc('run.py'): ('project',
33
+                                      (u'config::home  streams_bernu.cfg',
34
+                                       ''))}
32
 [user attributes]
35
 [user attributes]
33
-debug.breakpoints = {loc('iub.py'): {102: (0,
36
+debug.breakpoints = {loc('ContentSources.py'): {39L: (0,
37
+        None,
38
+        1,
39
+        0)},
40
+                     loc('iub.py'): {102: (0,
34
         None,
41
         None,
35
         1,
42
         1,
36
         0),
43
         0),
103
                     loc('sources/filmix.py'): {},
110
                     loc('sources/filmix.py'): {},
104
                     loc('sources/ltc.py'): {},
111
                     loc('sources/ltc.py'): {},
105
                     loc('test_sources2.py'): {}}
112
                     loc('test_sources2.py'): {}}
106
-debug.recent-run-args = {loc('ContentSources.py'): [u'ltc::home',
113
+debug.recent-run-args = {loc('ContentSources.py'): [u'config::home streams_bernu.cfg',
114
+        u'ltc::home',
107
         u'config::home'],
115
         u'config::home'],
108
                          loc('iub_db.py'): [u'-d 90   -s -o',
116
                          loc('iub_db.py'): [u'-d 90   -s -o',
109
         u'-d 40   -rg -o',
117
         u'-d 40   -rg -o',
144
         u'-sgr',
152
         u'-sgr',
145
         u'--sgr',
153
         u'--sgr',
146
         u'--slud'],
154
         u'--slud'],
147
-                         loc('run.py'): [u'config::home']}
155
+                         loc('run.py'): [u'config::home  streams_bernu.cfg',
156
+        u'config::home ',
157
+        u'config::home streams_bernu.cfg',
158
+        u'config::home']}
148
 debug.run-args = {}
159
 debug.run-args = {}
149
 debug.var-col-widths = [0.41872791519434627,
160
 debug.var-col-widths = [0.41872791519434627,
150
                         0.5812720848056537]
161
                         0.5812720848056537]
163
         'view': {'area': 'tall',
174
         'view': {'area': 'tall',
164
                  'constraint': None,
175
                  'constraint': None,
165
                  'current_pages': [0,
176
                  'current_pages': [0,
166
-                                   1],
177
+                                   0],
167
                  'full-screen': False,
178
                  'full-screen': False,
168
-                 'notebook_display': 'tabs only',
179
+                 'notebook_display': 'normal',
169
                  'notebook_percent': 0.17992831541218635,
180
                  'notebook_percent': 0.17992831541218635,
170
                  'override_title': None,
181
                  'override_title': None,
171
                  'pagelist': [('project',
182
                  'pagelist': [('project',
767
                                        'fRegexFlags': 46,
778
                                        'fRegexFlags': 46,
768
                                        'fReplaceText': '',
779
                                        'fReplaceText': '',
769
                                        'fReverse': False,
780
                                        'fReverse': False,
770
-                                       'fSearchText': u'img',
781
+                                       'fSearchText': u'ConfigSou',
771
                                        'fStartPos': 0,
782
                                        'fStartPos': 0,
772
                                        'fStyle': 'text',
783
                                        'fStyle': 'text',
773
                                        'fWholeWords': False,
784
                                        'fWholeWords': False,
841
         -1,
852
         -1,
842
         -1),
853
         -1),
843
                        'attrib-starts': [],
854
                        'attrib-starts': [],
844
-                       'first-line': 2L,
855
+                       'first-line': 17L,
845
                        'folded-linenos': [],
856
                        'folded-linenos': [],
846
-                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/cinemalive.py': ["m"\
847
-        " = re.search(r\"'https\\|.+?jwplayer'\", r2)\n",
848
-        "m = re.search(r\"'https\\|.+?jwplayer'\", r)\n",
849
-        'm\n',
850
-        'm.start\n',
851
-        'm.string\n',
852
-        'p\n',
853
-        'p0 = m.group(1)\n',
854
-        'p0\n',
855
-        'm.group\n',
856
-        'm.group()\n',
857
-        'm.groupw\n',
858
-        'm[1]\n',
859
-        'm.groups()\n',
860
-        'm.groups(2)\n',
861
-        'm.groups(0)\n',
862
-        'm.group(0)\n',
863
-        'm.groups(1)\n',
864
-        'print url_sub\n',
865
-        'url_sub\n',
866
-        ' https://dl4.sanii.co/files/8/80mbh8zjyuh61n/video.mp4\n',
867
-        'url\n',
868
-        'print url\n',
869
-        'print p0\n',
870
-        'm.group(1)\n',
871
-        's\n',
872
-        'print r\n',
873
-        'clist\n',
874
-        'item\n',
875
-        'data\n'],
876
-                                   u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/filmix.py': ['r'\
877
-        '.text\n',
878
-        'r.cookies\n',
879
-        'data = "scf=fx&story=big+bang&search_start=0&do=search&subaction=se'\
880
-        'arch"\n',
881
-        'ses.post("https://filmix.me/engine/ajax/sphinx_search.php", data=No'\
882
-        'ne, json=None)\n',
883
-        'r2.content\n',
884
-        'clist\n',
885
-        'plist\n',
886
-        'r2 = ses.post("https://filmix.me/engine/ajax/sphinx_search.php", da'\
887
-        'ta=None, json=None)\n',
888
-        'len(plist)\n',
889
-        'r\n',
890
-        'print r.content\n',
891
-        'print desc0\n',
892
-        'print desc\n',
893
-        'r.content\n',
894
-        'title\n',
895
-        'zip(rezult)\n',
896
-        'zip(resultult)\n',
897
-        'zip(result)\n',
898
-        'zip(result)[0]\n',
899
-        'print result\n',
900
-        'print result[0]\n',
901
-        'print result[1]\n',
902
-        '*zip(result)\n',
903
-        'zip(*result)\n',
904
-        'zip(*result)[0]\n',
905
-        '" ".join(zip(*result)[0])\n',
906
-        'print " ".join(zip(*result)[0])\n',
907
-        '"\\n".join(props)\n',
908
-        'print r2\n',
909
-        'result[2]\n',
910
-        'result[1]\n',
911
-        'result[0]\n',
912
-        'result[0][0]\n',
913
-        'result = re.findall("<span>(.+?)(&nbsp;)*</span>", m.group(1))\n',
914
-        'actors = zip(*result)[0])\n',
915
-        'actors = zip(*result)[0]\n',
916
-        're.sub("<.+?>", "", result[0][0])\n',
917
-        'actors\n',
918
-        'result\n',
919
-        'm\n',
920
-        'print m.group(1)\n']},
857
+                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/run.py': ['m'\
858
+        'od\n',
859
+        'dir(mod)\n',
860
+        'mod.__name__\n']},
921
                        'launch-id': None,
861
                        'launch-id': None,
922
-                       'sel-line': 11L,
923
-                       'sel-line-start': 6555L,
924
-                       'selection_end': 6555L,
925
-                       'selection_start': 6555L,
862
+                       'sel-line': 24L,
863
+                       'sel-line-start': 315L,
864
+                       'selection_end': 327L,
865
+                       'selection_start': 315L,
926
                        'zoom': 0L}),
866
                        'zoom': 0L}),
927
                      ('debug-watch',
867
                      ('debug-watch',
928
                       'wide',
868
                       'wide',
958
         -1,
898
         -1,
959
         -1),
899
         -1),
960
                        'attrib-starts': [],
900
                        'attrib-starts': [],
961
-                       'first-line': 20L,
901
+                       'first-line': 0L,
962
                        'folded-linenos': [],
902
                        'folded-linenos': [],
963
-                       'history': {None: ['import base64\n',
964
-        "s = \"'d2luZG93LkNTU1ZpZXdwb3J0UnVsZXMgPSB0cnVlOyhmdW5jdGlvbihkb2N1"\
965
-        "bWVudCwgc2NyaXB0RWxlbWVudCwgZmlyc3RTY3JpcHQpIHtzY3JpcHRFbGVtZW50ID0"\
966
-        "gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc2NyaXB0Jyk7c2NyaXB0Q0ZBU3luYyA9IG"\
967
-        "RvY3VtZW50LmNyZWF0ZUF0dHJpYnV0ZSgiZGF0YS1jZmFzeW5jIik7c2NyaXB0Q0ZBU"\
968
-        "3luYy52YWx1ZSA9IGZhbHNlO3NjcmlwdEVsZW1lbnQuc2V0QXR0cmlidXRlTm9kZShz"\
969
-        "Y3JpcHRDRkFTeW5jKTtzY3JpcHRFbGVtZW50LnNyYyA9ICcvL3BhZ2VhZDIuZ29vZ2x"\
970
-        "lc3luZGljYXRpb24uY29tL3BhZ2VhZC9qcy9hZHNieWdvb2dsZS5qcyc7c2NyaXB0RW"\
971
-        "xlbWVudC5vbmVycm9yID0gZnVuY3Rpb24gKCkgeyB3aW5kb3cuQ1NTVmlld3BvcnRSd"\
972
-        "Wxlcz1mYWxzZTsgfTsgdmFyIGZpcnN0U2NyaXB0O2lmICh0eXBlb2YgZG9jdW1lbnQu"\
973
-        "c2NyaXB0cyAhPT0gJ3VuZGVmaW5lZCcpIHsgZmlyc3RTY3JpcHQgPSBkb2N1bWVudC5"\
974
-        "zY3JpcHRzWzBdOyB9IGlmICh0eXBlb2YgZmlyc3RTY3JpcHQgPT0gJ3VuZGVmaW5lZC"\
975
-        "cpIHsgZmlyc3RTY3JpcHQgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnc"\
976
-        "2NyaXB0JylbMF07IH0gZmlyc3RTY3JpcHQucGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUo"\
977
-        "c2NyaXB0RWxlbWVudCwgZmlyc3RTY3JpcHQpOyB9KGRvY3VtZW50KSk7CihmdW5jdGl"\
978
-        "vbigpeyB2YXIgd2FzX2luaXQgPSBmYWxzZTsgZnVuY3Rpb24gaW5pdF9teXNjcmlwdC"\
979
-        "gpIHsgaWYgKHdhc19pbml0KSByZXR1cm4gOyB3YXNfaW5pdCA9IHRydWU7IHZhciBjP"\
980
-        "WRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpO2MuaW5uZXJIVE1MPSImbmJzcDsi"\
981
-        "O2MuY2xhc3NOYW1lPSJhZHNib3giO2RvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQoYyk"\
982
-        "7d2luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24oKXtpZigwPT09Yy5vZmZzZXRIZWlnaH"\
983
-        "R8fHdpbmRvdy5DU1NWaWV3cG9ydFJ1bGVzPT09ZmFsc2Upe3ZhciBsPTAsZD1uZXcgK"\
984
-        "HdpbmRvdy5SVENQZWVyQ29ubmVjdGlvbnx8d2luZG93Lm1velJUQ1BlZXJDb25uZWN0"\
985
-        "aW9ufHx3aW5kb3cud2Via2l0UlRDUGVlckNvbm5lY3Rpb24pKHtpY2VTZXJ2ZXJzOlt"\
986
-        "7dXJsOiJzdHVuOjE3NTUwMDE4MjY6NDQzIn1dfSx7b3B0aW9uYWw6W3tSdHBEYXRhQ2"\
987
-        "hhbm5lbHM6ITB9XX0pO2Qub25pY2VjYW5kaWRhdGU9ZnVuY3Rpb24oYil7dmFyIGU9I"\
988
-        "iI7IWIuY2FuZGlkYXRlfHwoYi5jYW5kaWRhdGUgJiYgYi5jYW5kaWRhdGUuY2FuZGlk"\
989
-        "YXRlLmluZGV4T2YoJ3NyZmx4JykgPT0gLTEpfHwhKGI9LyhbMC05XXsxLDN9KFwuWzA"\
990
-        "tOV17MSwzfSl7M318W2EtZjAtOV17MSw0fSg6W2EtZjAtOV17MSw0fSl7N30pLy5leG"\
991
-        "VjKGIuY2FuZGlkYXRlLmNhbmRpZGF0ZSlbMV0pfHwKbXx8Yi5tYXRjaCgvXigxOTJcL"\
992
-        "jE2OFwufDE2OVwuMjU0XC58MTBcLnwxNzJcLigxWzYtOV18MlxkfDNbMDFdKSkvKXx8"\
993
-        "Yi5tYXRjaCgvXlthLWYwLTldezEsNH0oOlthLWYwLTldezEsNH0pezd9JC8pfHwobT0"\
994
-        "hMCxlPWIsZG9jdW1lbnQub25jbGljaz1mdW5jdGlvbigpe2N1cnJlbnRfY291bnQ9cG"\
995
-        "Fyc2VJbnQoKGRvY3VtZW50LmNvb2tpZS5tYXRjaCgibm9wcnB5dXd6Y3BnZG9sbXNjb"\
996
-        "nQ9KFteO10uKz8pKDt8JCkiKXx8W10pWzFdfHwwKTtpZighbCYmMjE0NzQ4MzY0Nj5j"\
997
-        "dXJyZW50X2NvdW50KXtsPTE7dmFyIGE9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiYSI"\
998
-        "pLGI9TWF0aC5mbG9vcigxRTEyKk1hdGgucmFuZG9tKCkpLGY9TWF0aC5yYW5kb20oKS"\
999
-        "50b1N0cmluZygzNikucmVwbGFjZSgvW15hLXpBLVowLTldKy9nLCIiKS5zdWJzdHIoM"\
1000
-        "CwxMCk7YS5ocmVmPSJodHRwOi8vIitlKyIvIituLmVuY29kZShiKyIvIisoMTYyNDc0"\
1001
-        "OStiKSsiLyIrZik7YS50YXJnZXQ9Il9ibGFuayI7ZG9jdW1lbnQuYm9keS5hcHBlbmR"\
1002
-        "DaGlsZChhKTsKYj1uZXcgTW91c2VFdmVudCgiY2xpY2siLHt2aWV3OndpbmRvdyxidW"\
1003
-        "JibGVzOiExLGNhbmNlbGFibGU6ITF9KTthLmRpc3BhdGNoRXZlbnQoYik7YS5wYXJlb"\
1004
-        "nROb2RlLnJlbW92ZUNoaWxkKGEpO2E9bmV3IERhdGU7YS5zZXRUaW1lKGEuZ2V0VGlt"\
1005
-        "ZSgpKzg2NDAwMDAwKTtiX2RhdGU9KGV4aXN0aW5nX2RhdGU9dW5lc2NhcGUoKGRvY3V"\
1006
-        "tZW50LmNvb2tpZS5tYXRjaCgibm9wcnB5dXd6Y3BnZG9sbXNleHA9KFteO10uKz8pKD"\
1007
-        "t8JCkiKXx8W10pWzFdfHwiIikpP2V4aXN0aW5nX2RhdGU6YS50b0dNVFN0cmluZygpO"\
1008
-        "2E9IjsgZXhwaXJlcz0iK2JfZGF0ZTtkb2N1bWVudC5jb29raWU9Im5vcHJweXV3emNw"\
1009
-        "Z2RvbG1zY250PSIrKGN1cnJlbnRfY291bnQrMSkrYSsiOyBwYXRoPS8iO2RvY3VtZW5"\
1010
-        "0LmNvb2tpZT0ibm9wcnB5dXd6Y3BnZG9sbXNleHA9IitiX2RhdGUrYSsiOyBwYXRoPS"\
1011
-        "8ifX0pfTtkLmNyZWF0ZURhdGFDaGFubmVsKCIiKTtkLmNyZWF0ZU9mZmVyKGZ1bmN0a"\
1012
-        "W9uKGIpe2Quc2V0TG9jYWxEZXNjcmlwdGlvbihiLGZ1bmN0aW9uKCl7fSxmdW5jdGlv"\
1013
-        "bigpe30pfSwKZnVuY3Rpb24oKXt9KX1NYXRoLnJhbmRvbSgpLnRvU3RyaW5nKDM2KS5"\
1014
-        "yZXBsYWNlKC9bXmEtekEtWjAtOV0rL2csIiIpLnN1YnN0cigwLDEwKTt2YXIgbT0hMS"\
1015
-        "xuPXtfMDoiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wc"\
1016
-        "XJzdHV2d3h5ejAxMjM0NTY3ODkrLz0iLGVuY29kZTpmdW5jdGlvbihiKXtmb3IodmFy"\
1017
-        "IGU9IiIsYSxjLGYsZCxrLGcsaD0wO2g8Yi5sZW5ndGg7KWE9Yi5jaGFyQ29kZUF0KGg"\
1018
-        "rKyksYz1iLmNoYXJDb2RlQXQoaCsrKSxmPWIuY2hhckNvZGVBdChoKyspLGQ9YT4+Mi"\
1019
-        "xhPShhJjMpPDw0fGM+PjQsaz0oYyYxNSk8PDJ8Zj4+NixnPWYmNjMsaXNOYU4oYyk/a"\
1020
-        "z1nPTY0OmlzTmFOKGYpJiYoZz02NCksZT1lK3RoaXMuXzAuY2hhckF0KGQpK3RoaXMu"\
1021
-        "XzAuY2hhckF0KGEpK3RoaXMuXzAuY2hhckF0KGspK3RoaXMuXzAuY2hhckF0KGcpO3J"\
1022
-        "ldHVybiBlfX19LDQwMCkgfSBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJET01Db2"\
1023
-        "50ZW50TG9hZGVkIiwgZnVuY3Rpb24gKCkgeyBpbml0X215c2NyaXB0KCk7IH0gKTsgd"\
1024
-        "2luZG93LnNldFRpbWVvdXQoaW5pdF9teXNjcmlwdCwgMTIwKSB9KSgpOw=='\"\n",
1025
-        's\n',
1026
-        'base64.decode(s)\n',
1027
-        'base64.decode(s, s2)\n',
1028
-        's = ""\n',
1029
-        "s ='d2luZG93LkNTU1ZpZXdwb3J0UnVsZXMgPSB0cnVlOyhmdW5jdGlvbihkb2N1bWV"\
1030
-        "udCwgc2NyaXB0RWxlbWVudCwgZmlyc3RTY3JpcHQpIHtzY3JpcHRFbGVtZW50ID0gZG"\
1031
-        "9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc2NyaXB0Jyk7c2NyaXB0Q0ZBU3luYyA9IGRvY"\
1032
-        "3VtZW50LmNyZWF0ZUF0dHJpYnV0ZSgiZGF0YS1jZmFzeW5jIik7c2NyaXB0Q0ZBU3lu"\
1033
-        "Yy52YWx1ZSA9IGZhbHNlO3NjcmlwdEVsZW1lbnQuc2V0QXR0cmlidXRlTm9kZShzY3J"\
1034
-        "pcHRDRkFTeW5jKTtzY3JpcHRFbGVtZW50LnNyYyA9ICcvL3BhZ2VhZDIuZ29vZ2xlc3"\
1035
-        "luZGljYXRpb24uY29tL3BhZ2VhZC9qcy9hZHNieWdvb2dsZS5qcyc7c2NyaXB0RWxlb"\
1036
-        "WVudC5vbmVycm9yID0gZnVuY3Rpb24gKCkgeyB3aW5kb3cuQ1NTVmlld3BvcnRSdWxl"\
1037
-        "cz1mYWxzZTsgfTsgdmFyIGZpcnN0U2NyaXB0O2lmICh0eXBlb2YgZG9jdW1lbnQuc2N"\
1038
-        "yaXB0cyAhPT0gJ3VuZGVmaW5lZCcpIHsgZmlyc3RTY3JpcHQgPSBkb2N1bWVudC5zY3"\
1039
-        "JpcHRzWzBdOyB9IGlmICh0eXBlb2YgZmlyc3RTY3JpcHQgPT0gJ3VuZGVmaW5lZCcpI"\
1040
-        "HsgZmlyc3RTY3JpcHQgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnc2Ny"\
1041
-        "aXB0JylbMF07IH0gZmlyc3RTY3JpcHQucGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUoc2N"\
1042
-        "yaXB0RWxlbWVudCwgZmlyc3RTY3JpcHQpOyB9KGRvY3VtZW50KSk7CihmdW5jdGlvbi"\
1043
-        "gpeyB2YXIgd2FzX2luaXQgPSBmYWxzZTsgZnVuY3Rpb24gaW5pdF9teXNjcmlwdCgpI"\
1044
-        "HsgaWYgKHdhc19pbml0KSByZXR1cm4gOyB3YXNfaW5pdCA9IHRydWU7IHZhciBjPWRv"\
1045
-        "Y3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpO2MuaW5uZXJIVE1MPSImbmJzcDsiO2M"\
1046
-        "uY2xhc3NOYW1lPSJhZHNib3giO2RvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQoYyk7d2"\
1047
-        "luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24oKXtpZigwPT09Yy5vZmZzZXRIZWlnaHR8f"\
1048
-        "HdpbmRvdy5DU1NWaWV3cG9ydFJ1bGVzPT09ZmFsc2Upe3ZhciBsPTAsZD1uZXcgKHdp"\
1049
-        "bmRvdy5SVENQZWVyQ29ubmVjdGlvbnx8d2luZG93Lm1velJUQ1BlZXJDb25uZWN0aW9"\
1050
-        "ufHx3aW5kb3cud2Via2l0UlRDUGVlckNvbm5lY3Rpb24pKHtpY2VTZXJ2ZXJzOlt7dX"\
1051
-        "JsOiJzdHVuOjE3NTUwMDE4MjY6NDQzIn1dfSx7b3B0aW9uYWw6W3tSdHBEYXRhQ2hhb"\
1052
-        "m5lbHM6ITB9XX0pO2Qub25pY2VjYW5kaWRhdGU9ZnVuY3Rpb24oYil7dmFyIGU9IiI7"\
1053
-        "IWIuY2FuZGlkYXRlfHwoYi5jYW5kaWRhdGUgJiYgYi5jYW5kaWRhdGUuY2FuZGlkYXR"\
1054
-        "lLmluZGV4T2YoJ3NyZmx4JykgPT0gLTEpfHwhKGI9LyhbMC05XXsxLDN9KFwuWzAtOV"\
1055
-        "17MSwzfSl7M318W2EtZjAtOV17MSw0fSg6W2EtZjAtOV17MSw0fSl7N30pLy5leGVjK"\
1056
-        "GIuY2FuZGlkYXRlLmNhbmRpZGF0ZSlbMV0pfHwKbXx8Yi5tYXRjaCgvXigxOTJcLjE2"\
1057
-        "OFwufDE2OVwuMjU0XC58MTBcLnwxNzJcLigxWzYtOV18MlxkfDNbMDFdKSkvKXx8Yi5"\
1058
-        "tYXRjaCgvXlthLWYwLTldezEsNH0oOlthLWYwLTldezEsNH0pezd9JC8pfHwobT0hMC"\
1059
-        "xlPWIsZG9jdW1lbnQub25jbGljaz1mdW5jdGlvbigpe2N1cnJlbnRfY291bnQ9cGFyc"\
1060
-        "2VJbnQoKGRvY3VtZW50LmNvb2tpZS5tYXRjaCgibm9wcnB5dXd6Y3BnZG9sbXNjbnQ9"\
1061
-        "KFteO10uKz8pKDt8JCkiKXx8W10pWzFdfHwwKTtpZighbCYmMjE0NzQ4MzY0Nj5jdXJ"\
1062
-        "yZW50X2NvdW50KXtsPTE7dmFyIGE9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiYSIpLG"\
1063
-        "I9TWF0aC5mbG9vcigxRTEyKk1hdGgucmFuZG9tKCkpLGY9TWF0aC5yYW5kb20oKS50b"\
1064
-        "1N0cmluZygzNikucmVwbGFjZSgvW15hLXpBLVowLTldKy9nLCIiKS5zdWJzdHIoMCwx"\
1065
-        "MCk7YS5ocmVmPSJodHRwOi8vIitlKyIvIituLmVuY29kZShiKyIvIisoMTYyNDc0OSt"\
1066
-        "iKSsiLyIrZik7YS50YXJnZXQ9Il9ibGFuayI7ZG9jdW1lbnQuYm9keS5hcHBlbmRDaG"\
1067
-        "lsZChhKTsKYj1uZXcgTW91c2VFdmVudCgiY2xpY2siLHt2aWV3OndpbmRvdyxidWJib"\
1068
-        "GVzOiExLGNhbmNlbGFibGU6ITF9KTthLmRpc3BhdGNoRXZlbnQoYik7YS5wYXJlbnRO"\
1069
-        "b2RlLnJlbW92ZUNoaWxkKGEpO2E9bmV3IERhdGU7YS5zZXRUaW1lKGEuZ2V0VGltZSg"\
1070
-        "pKzg2NDAwMDAwKTtiX2RhdGU9KGV4aXN0aW5nX2RhdGU9dW5lc2NhcGUoKGRvY3VtZW"\
1071
-        "50LmNvb2tpZS5tYXRjaCgibm9wcnB5dXd6Y3BnZG9sbXNleHA9KFteO10uKz8pKDt8J"\
1072
-        "CkiKXx8W10pWzFdfHwiIikpP2V4aXN0aW5nX2RhdGU6YS50b0dNVFN0cmluZygpO2E9"\
1073
-        "IjsgZXhwaXJlcz0iK2JfZGF0ZTtkb2N1bWVudC5jb29raWU9Im5vcHJweXV3emNwZ2R"\
1074
-        "vbG1zY250PSIrKGN1cnJlbnRfY291bnQrMSkrYSsiOyBwYXRoPS8iO2RvY3VtZW50Lm"\
1075
-        "Nvb2tpZT0ibm9wcnB5dXd6Y3BnZG9sbXNleHA9IitiX2RhdGUrYSsiOyBwYXRoPS8if"\
1076
-        "X0pfTtkLmNyZWF0ZURhdGFDaGFubmVsKCIiKTtkLmNyZWF0ZU9mZmVyKGZ1bmN0aW9u"\
1077
-        "KGIpe2Quc2V0TG9jYWxEZXNjcmlwdGlvbihiLGZ1bmN0aW9uKCl7fSxmdW5jdGlvbig"\
1078
-        "pe30pfSwKZnVuY3Rpb24oKXt9KX1NYXRoLnJhbmRvbSgpLnRvU3RyaW5nKDM2KS5yZX"\
1079
-        "BsYWNlKC9bXmEtekEtWjAtOV0rL2csIiIpLnN1YnN0cigwLDEwKTt2YXIgbT0hMSxuP"\
1080
-        "XtfMDoiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJz"\
1081
-        "dHV2d3h5ejAxMjM0NTY3ODkrLz0iLGVuY29kZTpmdW5jdGlvbihiKXtmb3IodmFyIGU"\
1082
-        "9IiIsYSxjLGYsZCxrLGcsaD0wO2g8Yi5sZW5ndGg7KWE9Yi5jaGFyQ29kZUF0KGgrKy"\
1083
-        "ksYz1iLmNoYXJDb2RlQXQoaCsrKSxmPWIuY2hhckNvZGVBdChoKyspLGQ9YT4+MixhP"\
1084
-        "ShhJjMpPDw0fGM+PjQsaz0oYyYxNSk8PDJ8Zj4+NixnPWYmNjMsaXNOYU4oYyk/az1n"\
1085
-        "PTY0OmlzTmFOKGYpJiYoZz02NCksZT1lK3RoaXMuXzAuY2hhckF0KGQpK3RoaXMuXzA"\
1086
-        "uY2hhckF0KGEpK3RoaXMuXzAuY2hhckF0KGspK3RoaXMuXzAuY2hhckF0KGcpO3JldH"\
1087
-        "VybiBlfX19LDQwMCkgfSBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJET01Db250Z"\
1088
-        "W50TG9hZGVkIiwgZnVuY3Rpb24gKCkgeyBpbml0X215c2NyaXB0KCk7IH0gKTsgd2lu"\
1089
-        "ZG93LnNldFRpbWVvdXQoaW5pdF9teXNjcmlwdCwgMTIwKSB9KSgpOw=='\n",
1090
-        'base64.decode(input, output)\n',
1091
-        'base64.b64decode(s)\n',
1092
-        'print base64.b64decode(s)\n']},
903
+                       'history': {},
1093
                        'launch-id': None,
904
                        'launch-id': None,
1094
-                       'sel-line': 23L,
1095
-                       'sel-line-start': 12851L,
1096
-                       'selection_end': 12870L,
1097
-                       'selection_start': 12870L,
905
+                       'sel-line': 2L,
906
+                       'sel-line-start': 174L,
907
+                       'selection_end': 174L,
908
+                       'selection_start': 174L,
1098
                        'zoom': 0L})],
909
                        'zoom': 0L})],
1099
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('../../../../../Python27/Lib/site-packages/requests/models.py'),
1100
-        {'attrib-starts': [('Response',
1101
-                            580),
1102
-                           ('Response.content',
1103
-                            803)],
1104
-         'first-line': 808L,
910
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('ContentSources.py'),
911
+        {'attrib-starts': [('ContentSources',
912
+                            16),
913
+                           ('ContentSources.__init__',
914
+                            20)],
915
+         'first-line': 29L,
1105
          'folded-linenos': [],
916
          'folded-linenos': [],
1106
-         'sel-line': 820L,
1107
-         'sel-line-start': 29656L,
1108
-         'selection_end': 29656L,
1109
-         'selection_start': 29656L,
917
+         'sel-line': 38L,
918
+         'sel-line-start': 1556L,
919
+         'selection_end': 1556L,
920
+         'selection_start': 1556L,
1110
          'zoom': 0L},
921
          'zoom': 0L},
1111
-        1507108226.063],
1112
-        [loc('sources/filmix.py'),
1113
-         {'attrib-starts': [('Source',
1114
-                             31),
1115
-                            ('Source.get_content',
1116
-                             56)],
1117
-          'first-line': 104L,
922
+        1507139070.901],
923
+        [loc('run.py'),
924
+         {'attrib-starts': [],
925
+          'first-line': 539L,
1118
           'folded-linenos': [],
926
           'folded-linenos': [],
1119
-          'sel-line': 85L,
1120
-          'sel-line-start': 3061L,
1121
-          'selection_end': 3061L,
1122
-          'selection_start': 3061L,
927
+          'sel-line': 547L,
928
+          'sel-line-start': 21031L,
929
+          'selection_end': 21031L,
930
+          'selection_start': 21031L,
1123
           'zoom': 0L},
931
           'zoom': 0L},
1124
-         1507108249.052],
1125
-        [loc('sources/filmix.py'),
1126
-         {'attrib-starts': [('Source',
1127
-                             31),
1128
-                            ('Source.get_content',
1129
-                             56)],
1130
-          'first-line': 67L,
932
+         1507139107.638],
933
+        [loc('ContentSources.py'),
934
+         {'attrib-starts': [('ContentSources',
935
+                             16),
936
+                            ('ContentSources.__init__',
937
+                             20)],
938
+          'first-line': 29L,
1131
           'folded-linenos': [],
939
           'folded-linenos': [],
1132
-          'sel-line': 71L,
1133
-          'sel-line-start': 2324L,
1134
-          'selection_end': 2353L,
1135
-          'selection_start': 2353L,
940
+          'sel-line': 38L,
941
+          'sel-line-start': 1556L,
942
+          'selection_end': 1556L,
943
+          'selection_start': 1556L,
1136
           'zoom': 0L},
944
           'zoom': 0L},
1137
-         1507109867.579],
1138
-        [loc('sources/cinemalive.py'),
1139
-         {'attrib-starts': [('Source',
1140
-                             30),
1141
-                            ('Source.__init__',
1142
-                             32)],
1143
-          'first-line': 32L,
945
+         1507139120.776],
946
+        [loc('run.py'),
947
+         {'attrib-starts': [],
948
+          'first-line': 537L,
1144
           'folded-linenos': [],
949
           'folded-linenos': [],
1145
-          'sel-line': 34L,
1146
-          'sel-line-start': 1057L,
1147
-          'selection_end': 1058L,
1148
-          'selection_start': 1058L,
950
+          'sel-line': 548L,
951
+          'sel-line-start': 21051L,
952
+          'selection_end': 21072L,
953
+          'selection_start': 21072L,
1149
           'zoom': 0L},
954
           'zoom': 0L},
1150
-         1507109876.087],
1151
-        [loc('sources/cinemalive.py'),
1152
-         {'attrib-starts': [('Source',
1153
-                             30),
1154
-                            ('Source.get_streams',
1155
-                             154)],
1156
-          'first-line': 166L,
955
+         1507139183.154],
956
+        [loc('ContentSources.py'),
957
+         {'attrib-starts': [('ContentSources',
958
+                             16),
959
+                            ('ContentSources.__init__',
960
+                             20)],
961
+          'first-line': 29L,
1157
           'folded-linenos': [],
962
           'folded-linenos': [],
1158
-          'sel-line': 174L,
1159
-          'sel-line-start': 8583L,
1160
-          'selection_end': 8583L,
1161
-          'selection_start': 8583L,
963
+          'sel-line': 38L,
964
+          'sel-line-start': 1556L,
965
+          'selection_end': 1556L,
966
+          'selection_start': 1556L,
1162
           'zoom': 0L},
967
           'zoom': 0L},
1163
-         1507112463.984],
1164
-        [loc('../../../../../Python27/Lib/re.py'),
1165
-         {'attrib-starts': [('search',
1166
-                             142)],
1167
-          'first-line': 140L,
968
+         1507139191.654],
969
+        [loc('sources/config.py'),
970
+         {'attrib-starts': [('Source',
971
+                             12),
972
+                            ('Source.__init__',
973
+                             14)],
974
+          'first-line': 10L,
1168
           'folded-linenos': [],
975
           'folded-linenos': [],
1169
-          'sel-line': 145L,
1170
-          'sel-line-start': 6856L,
1171
-          'selection_end': 6856L,
1172
-          'selection_start': 6856L,
976
+          'sel-line': 16L,
977
+          'sel-line-start': 546L,
978
+          'selection_end': 546L,
979
+          'selection_start': 546L,
1173
           'zoom': 0L},
980
           'zoom': 0L},
1174
-         1507112468.291],
1175
-        [loc('sources/cinemalive.py'),
1176
-         {'attrib-starts': [('Source',
1177
-                             30),
1178
-                            ('Source.get_content',
1179
-                             53)],
1180
-          'first-line': 68L,
981
+         1507139201.651],
982
+        [loc('ContentSources.py'),
983
+         {'attrib-starts': [('ContentSources',
984
+                             16),
985
+                            ('ContentSources.__init__',
986
+                             20)],
987
+          'first-line': 29L,
1181
           'folded-linenos': [],
988
           'folded-linenos': [],
1182
-          'sel-line': 76L,
1183
-          'sel-line-start': 3464L,
1184
-          'selection_end': 3496L,
1185
-          'selection_start': 3496L,
989
+          'sel-line': 38L,
990
+          'sel-line-start': 1556L,
991
+          'selection_end': 1630L,
992
+          'selection_start': 1630L,
1186
           'zoom': 0L},
993
           'zoom': 0L},
1187
-         1507120187.618],
994
+         1507139390.596],
1188
         [loc('run.py'),
995
         [loc('run.py'),
1189
-         {'attrib-starts': [('Main',
1190
-                             20),
1191
-                            ('Main.list_action',
1192
-                             103)],
1193
-          'first-line': 106L,
996
+         {'attrib-starts': [],
997
+          'first-line': 537L,
1194
           'folded-linenos': [],
998
           'folded-linenos': [],
1195
-          'sel-line': 118L,
1196
-          'sel-line-start': 4575L,
1197
-          'selection_end': 4575L,
1198
-          'selection_start': 4575L,
999
+          'sel-line': 548L,
1000
+          'sel-line-start': 21051L,
1001
+          'selection_end': 21072L,
1002
+          'selection_start': 21072L,
1199
           'zoom': 0L},
1003
           'zoom': 0L},
1200
-         1507120190.794],
1201
-        [loc('run.py'),
1202
-         {'attrib-starts': [('Main',
1203
-                             20),
1204
-                            ('Main.show_pic',
1205
-                             193)],
1206
-          'first-line': 186L,
1004
+         1507139396.418],
1005
+        [loc('ContentSources.py'),
1006
+         {'attrib-starts': [('ContentSources',
1007
+                             16),
1008
+                            ('ContentSources.__init__',
1009
+                             20)],
1010
+          'first-line': 29L,
1207
           'folded-linenos': [],
1011
           'folded-linenos': [],
1208
-          'sel-line': 195L,
1209
-          'sel-line-start': 7538L,
1210
-          'selection_end': 7549L,
1211
-          'selection_start': 7546L,
1012
+          'sel-line': 38L,
1013
+          'sel-line-start': 1556L,
1014
+          'selection_end': 1556L,
1015
+          'selection_start': 1556L,
1212
           'zoom': 0L},
1016
           'zoom': 0L},
1213
-         1507120193.405],
1214
-        [loc('run.py'),
1215
-         {'attrib-starts': [('Main',
1216
-                             20),
1217
-                            ('Main.show_pic',
1218
-                             193)],
1219
-          'first-line': 186L,
1017
+         1507139404.352],
1018
+        [loc('sources/config.py'),
1019
+         {'attrib-starts': [('Source',
1020
+                             12),
1021
+                            ('Source.__init__',
1022
+                             14)],
1023
+          'first-line': 10L,
1220
           'folded-linenos': [],
1024
           'folded-linenos': [],
1221
-          'sel-line': 197L,
1222
-          'sel-line-start': 7603L,
1223
-          'selection_end': 7621L,
1224
-          'selection_start': 7618L,
1025
+          'sel-line': 20L,
1026
+          'sel-line-start': 756L,
1027
+          'selection_end': 756L,
1028
+          'selection_start': 756L,
1225
           'zoom': 0L},
1029
           'zoom': 0L},
1226
-         1507120193.692],
1030
+         1507139454.935],
1227
         [loc('run.py'),
1031
         [loc('run.py'),
1228
-         {'attrib-starts': [('Main',
1229
-                             20),
1230
-                            ('Main.show_pic',
1231
-                             193)],
1232
-          'first-line': 190L,
1032
+         {'attrib-starts': [],
1033
+          'first-line': 537L,
1233
           'folded-linenos': [],
1034
           'folded-linenos': [],
1234
-          'sel-line': 199L,
1235
-          'sel-line-start': 7644L,
1236
-          'selection_end': 7662L,
1237
-          'selection_start': 7659L,
1035
+          'sel-line': 548L,
1036
+          'sel-line-start': 21051L,
1037
+          'selection_end': 21072L,
1038
+          'selection_start': 21072L,
1238
           'zoom': 0L},
1039
           'zoom': 0L},
1239
-         1507120193.988],
1240
-        [loc('run.py'),
1241
-         {'attrib-starts': [('Main',
1242
-                             20),
1243
-                            ('Main.show_pic',
1244
-                             193)],
1245
-          'first-line': 190L,
1040
+         1507139464.311],
1041
+        [loc('ContentSources.py'),
1042
+         {'attrib-starts': [('ContentSources',
1043
+                             16),
1044
+                            ('ContentSources.__init__',
1045
+                             20)],
1046
+          'first-line': 171L,
1246
           'folded-linenos': [],
1047
           'folded-linenos': [],
1247
-          'sel-line': 200L,
1248
-          'sel-line-start': 7684L,
1249
-          'selection_end': 7699L,
1250
-          'selection_start': 7696L,
1048
+          'sel-line': 35L,
1049
+          'sel-line-start': 1435L,
1050
+          'selection_end': 1462L,
1051
+          'selection_start': 1462L,
1251
           'zoom': 0L},
1052
           'zoom': 0L},
1252
-         1507120194.279],
1053
+         1507139509.009],
1253
         [loc('run.py'),
1054
         [loc('run.py'),
1254
-         {'attrib-starts': [('Main',
1255
-                             20),
1256
-                            ('Main.show_pic',
1257
-                             193)],
1258
-          'first-line': 190L,
1055
+         {'attrib-starts': [],
1056
+          'first-line': 537L,
1259
           'folded-linenos': [],
1057
           'folded-linenos': [],
1260
-          'sel-line': 200L,
1261
-          'sel-line-start': 7684L,
1262
-          'selection_end': 7741L,
1263
-          'selection_start': 7738L,
1058
+          'sel-line': 544L,
1059
+          'sel-line-start': 20857L,
1060
+          'selection_end': 21094L,
1061
+          'selection_start': 20857L,
1264
           'zoom': 0L},
1062
           'zoom': 0L},
1265
-         1507120194.558],
1266
-        [loc('run.py'),
1267
-         {'attrib-starts': [('Main',
1268
-                             20),
1269
-                            ('Main.show_pic',
1270
-                             193)],
1271
-          'first-line': 190L,
1063
+         1507139519.867],
1064
+        [loc('ContentSources.py'),
1065
+         {'attrib-starts': [],
1066
+          'first-line': 171L,
1272
           'folded-linenos': [],
1067
           'folded-linenos': [],
1273
-          'sel-line': 201L,
1274
-          'sel-line-start': 7744L,
1275
-          'selection_end': 7762L,
1276
-          'selection_start': 7759L,
1068
+          'sel-line': 183L,
1069
+          'sel-line-start': 7031L,
1070
+          'selection_end': 7069L,
1071
+          'selection_start': 7069L,
1277
           'zoom': 0L},
1072
           'zoom': 0L},
1278
-         1507120194.782],
1073
+         1507139553.439],
1279
         [loc('run.py'),
1074
         [loc('run.py'),
1280
-         {'attrib-starts': [('Main',
1281
-                             20),
1282
-                            ('Main.show_pic',
1283
-                             193)],
1284
-          'first-line': 190L,
1075
+         {'attrib-starts': [],
1076
+          'first-line': 537L,
1285
           'folded-linenos': [],
1077
           'folded-linenos': [],
1286
-          'sel-line': 201L,
1287
-          'sel-line-start': 7744L,
1288
-          'selection_end': 7785L,
1289
-          'selection_start': 7782L,
1078
+          'sel-line': 544L,
1079
+          'sel-line-start': 20857L,
1080
+          'selection_end': 20989L,
1081
+          'selection_start': 20857L,
1290
           'zoom': 0L},
1082
           'zoom': 0L},
1291
-         1507120194.998],
1292
-        [loc('run.py'),
1293
-         {'attrib-starts': [('Main',
1294
-                             20),
1295
-                            ('Main.show_pic',
1296
-                             193)],
1297
-          'first-line': 190L,
1083
+         1507139565.195],
1084
+        [loc('ContentSources.py'),
1085
+         {'attrib-starts': [('ContentSources',
1086
+                             16),
1087
+                            ('ContentSources.__init__',
1088
+                             20)],
1089
+          'first-line': 33L,
1298
           'folded-linenos': [],
1090
           'folded-linenos': [],
1299
-          'sel-line': 202L,
1300
-          'sel-line-start': 7794L,
1301
-          'selection_end': 7830L,
1302
-          'selection_start': 7827L,
1091
+          'sel-line': 38L,
1092
+          'sel-line-start': 1556L,
1093
+          'selection_end': 1556L,
1094
+          'selection_start': 1556L,
1303
           'zoom': 0L},
1095
           'zoom': 0L},
1304
-         1507120195.302],
1096
+         1507140419.978],
1305
         [loc('run.py'),
1097
         [loc('run.py'),
1306
-         {'attrib-starts': [('Main',
1307
-                             20),
1308
-                            ('Main.show_pic',
1309
-                             193)],
1310
-          'first-line': 196L,
1098
+         {'attrib-starts': [],
1099
+          'first-line': 537L,
1311
           'folded-linenos': [],
1100
           'folded-linenos': [],
1312
-          'sel-line': 205L,
1313
-          'sel-line-start': 7884L,
1314
-          'selection_end': 7928L,
1315
-          'selection_start': 7925L,
1101
+          'sel-line': 544L,
1102
+          'sel-line-start': 20857L,
1103
+          'selection_end': 20989L,
1104
+          'selection_start': 20857L,
1316
           'zoom': 0L},
1105
           'zoom': 0L},
1317
-         1507120195.56],
1318
-        [loc('run.py'),
1319
-         {'attrib-starts': [('Main',
1320
-                             20),
1321
-                            ('Main.show_desc',
1322
-                             184)],
1323
-          'first-line': 179L,
1106
+         1507140426.687],
1107
+        [loc('ContentSources.py'),
1108
+         {'attrib-starts': [('ContentSources',
1109
+                             16),
1110
+                            ('ContentSources.__init__',
1111
+                             20)],
1112
+          'first-line': 33L,
1324
           'folded-linenos': [],
1113
           'folded-linenos': [],
1325
-          'sel-line': 190L,
1326
-          'sel-line-start': 7365L,
1327
-          'selection_end': 7420L,
1328
-          'selection_start': 7420L,
1114
+          'sel-line': 38L,
1115
+          'sel-line-start': 1556L,
1116
+          'selection_end': 1556L,
1117
+          'selection_start': 1556L,
1329
           'zoom': 0L},
1118
           'zoom': 0L},
1330
-         1507120256.436],
1331
-        [loc('sources/cinemalive.py'),
1332
-         {'attrib-starts': [('Source',
1333
-                             30),
1334
-                            ('Source.get_streams',
1335
-                             161)],
1336
-          'first-line': 190L,
1119
+         1507140443.699],
1120
+        [loc('run.py'),
1121
+         {'attrib-starts': [],
1122
+          'first-line': 537L,
1337
           'folded-linenos': [],
1123
           'folded-linenos': [],
1338
-          'sel-line': 201L,
1339
-          'sel-line-start': 9890L,
1340
-          'selection_end': 9890L,
1341
-          'selection_start': 9890L,
1124
+          'sel-line': 544L,
1125
+          'sel-line-start': 20857L,
1126
+          'selection_end': 20989L,
1127
+          'selection_start': 20857L,
1342
           'zoom': 0L},
1128
           'zoom': 0L},
1343
-         1507121667.409],
1344
-        [loc('sources/cinemalive.py'),
1345
-         {'attrib-starts': [('Source',
1346
-                             30)],
1347
-          'first-line': 30L,
1129
+         1507140457.254],
1130
+        [loc('ContentSources.py'),
1131
+         {'attrib-starts': [('ContentSources',
1132
+                             16),
1133
+                            ('ContentSources.__init__',
1134
+                             20)],
1135
+          'first-line': 33L,
1348
           'folded-linenos': [],
1136
           'folded-linenos': [],
1349
-          'sel-line': 33L,
1350
-          'sel-line-start': 990L,
1351
-          'selection_end': 999L,
1352
-          'selection_start': 999L,
1137
+          'sel-line': 43L,
1138
+          'sel-line-start': 1789L,
1139
+          'selection_end': 1813L,
1140
+          'selection_start': 1813L,
1353
           'zoom': 0L},
1141
           'zoom': 0L},
1354
-         1507126994.897]],
1142
+         1507141006.36]],
1355
         20),
1143
         20),
1356
         'current-loc': loc('run.py'),
1144
         'current-loc': loc('run.py'),
1357
         'editor-state-list': [(loc('ContentSources.py'),
1145
         'editor-state-list': [(loc('ContentSources.py'),
1358
                                {'attrib-starts': [('ContentSources',
1146
                                {'attrib-starts': [('ContentSources',
1359
         16),
1147
         16),
1360
-        ('ContentSources.get_content',
1361
-         61)],
1362
-                                'first-line': 60L,
1148
+        ('ContentSources.__init__',
1149
+         20)],
1150
+                                'first-line': 33L,
1363
                                 'folded-linenos': [],
1151
                                 'folded-linenos': [],
1364
-                                'sel-line': 66L,
1365
-                                'sel-line-start': 2761L,
1366
-                                'selection_end': 2761L,
1367
-                                'selection_start': 2761L,
1152
+                                'sel-line': 43L,
1153
+                                'sel-line-start': 1789L,
1154
+                                'selection_end': 1813L,
1155
+                                'selection_start': 1813L,
1368
                                 'zoom': 0L}),
1156
                                 'zoom': 0L}),
1369
                               (loc('sources/euronews.py'),
1157
                               (loc('sources/euronews.py'),
1370
                                {'attrib-starts': [('Source',
1158
                                {'attrib-starts': [('Source',
1437
                                 'selection_start': 2353L,
1225
                                 'selection_start': 2353L,
1438
                                 'zoom': 0L}),
1226
                                 'zoom': 0L}),
1439
                               (loc('run.py'),
1227
                               (loc('run.py'),
1440
-                               {'attrib-starts': [('Main',
1441
-        20),
1442
-        ('Main.show_desc',
1443
-         184)],
1444
-                                'first-line': 179L,
1228
+                               {'attrib-starts': [],
1229
+                                'first-line': 537L,
1445
                                 'folded-linenos': [],
1230
                                 'folded-linenos': [],
1446
-                                'sel-line': 190L,
1447
-                                'sel-line-start': 7365L,
1448
-                                'selection_end': 7420L,
1449
-                                'selection_start': 7420L,
1231
+                                'sel-line': 544L,
1232
+                                'sel-line-start': 20857L,
1233
+                                'selection_end': 20989L,
1234
+                                'selection_start': 20857L,
1450
                                 'zoom': 0L}),
1235
                                 'zoom': 0L}),
1451
                               (loc('sources/replay.py'),
1236
                               (loc('sources/replay.py'),
1452
                                {'attrib-starts': [('Source',
1237
                                {'attrib-starts': [('Source',
1486
                                 'zoom': 0L}),
1271
                                 'zoom': 0L}),
1487
                               (loc('sources/cinemalive.py'),
1272
                               (loc('sources/cinemalive.py'),
1488
                                {'attrib-starts': [('Source',
1273
                                {'attrib-starts': [('Source',
1489
-        30)],
1490
-                                'first-line': 30L,
1274
+        30),
1275
+        ('Source.get_streams',
1276
+         167)],
1277
+                                'first-line': 197L,
1491
                                 'folded-linenos': [],
1278
                                 'folded-linenos': [],
1492
-                                'sel-line': 33L,
1493
-                                'sel-line-start': 990L,
1494
-                                'selection_end': 999L,
1495
-                                'selection_start': 999L,
1279
+                                'sel-line': 203L,
1280
+                                'sel-line-start': 9883L,
1281
+                                'selection_end': 9941L,
1282
+                                'selection_start': 9941L,
1283
+                                'zoom': 0L}),
1284
+                              (loc('sources/config.py'),
1285
+                               {'attrib-starts': [('Source',
1286
+        12),
1287
+        ('Source.__init__',
1288
+         14)],
1289
+                                'first-line': 10L,
1290
+                                'folded-linenos': [],
1291
+                                'sel-line': 20L,
1292
+                                'sel-line-start': 756L,
1293
+                                'selection_end': 756L,
1294
+                                'selection_start': 756L,
1496
                                 'zoom': 0L})],
1295
                                 'zoom': 0L})],
1497
         'has-focus': True,
1296
         'has-focus': True,
1498
         'locked': False},
1297
         'locked': False},
1507
          loc('sources/replay.py'),
1306
          loc('sources/replay.py'),
1508
          loc('sources/SourceBase.py'),
1307
          loc('sources/SourceBase.py'),
1509
          loc('sources/iplayer.py'),
1308
          loc('sources/iplayer.py'),
1510
-         loc('sources/cinemalive.py')]),
1511
-                               'open_files': [u'ContentSources.py',
1512
-        u'sources/SourceBase.py',
1309
+         loc('sources/cinemalive.py'),
1310
+         loc('sources/config.py')]),
1311
+                               'open_files': [u'sources/SourceBase.py',
1513
         u'sources/euronews.py',
1312
         u'sources/euronews.py',
1313
+        u'sources/filmix.py',
1514
         u'sources/iplayer.py',
1314
         u'sources/iplayer.py',
1515
         u'sources/ltc.py',
1315
         u'sources/ltc.py',
1516
         u'sources/replay.py',
1316
         u'sources/replay.py',
1317
+        u'test_sources2.py',
1517
         u'util.py',
1318
         u'util.py',
1518
         u'../../../../../Python27/Lib/lib-tk/tkSimpleDialog.py',
1319
         u'../../../../../Python27/Lib/lib-tk/tkSimpleDialog.py',
1519
-        u'test_sources2.py',
1520
-        u'sources/filmix.py',
1521
         u'sources/cinemalive.py',
1320
         u'sources/cinemalive.py',
1321
+        u'sources/config.py',
1322
+        u'ContentSources.py',
1522
         u'run.py']},
1323
         u'run.py']},
1523
         'saved_notebook_display': None,
1324
         'saved_notebook_display': None,
1524
         'split_percents': {0: 0.4352047277332208},
1325
         'split_percents': {0: 0.4352047277332208},
1535
                          2434,
1336
                          2434,
1536
                          1440)}]}
1337
                          1440)}]}
1537
 guimgr.recent-documents = [loc('run.py'),
1338
 guimgr.recent-documents = [loc('run.py'),
1339
+                           loc('ContentSources.py'),
1340
+                           loc('sources/config.py'),
1538
                            loc('sources/cinemalive.py'),
1341
                            loc('sources/cinemalive.py'),
1342
+                           loc('../../../../../Python27/Lib/lib-tk/tkSimpleDialog.py'),
1539
                            loc('sources/filmix.py'),
1343
                            loc('sources/filmix.py'),
1540
                            loc('test_sources2.py'),
1344
                            loc('test_sources2.py'),
1541
-                           loc('../../../../../Python27/Lib/lib-tk/tkSimpleDialog.py'),
1542
-                           loc('ContentSources.py'),
1543
                            loc('sources/replay.py'),
1345
                            loc('sources/replay.py'),
1544
                            loc('sources/ltc.py'),
1346
                            loc('sources/ltc.py'),
1545
                            loc('sources/iplayer.py'),
1347
                            loc('sources/iplayer.py'),
1952
                          None)}
1754
                          None)}
1953
 proj.env-vars = {None: ('default',
1755
 proj.env-vars = {None: ('default',
1954
                         [u''])}
1756
                         [u''])}
1955
-search.search-history = [u'img',
1757
+search.search-history = [u'ConfigSou',
1758
+                         u'contentsour',
1759
+                         u'Source',
1760
+                         u'img',
1956
                          u'decode',
1761
                          u'decode',
1957
                          u'lst.append',
1762
                          u'lst.append',
1958
                          u'icong',
1763
                          u'icong',
1968
                          u'picon_path',
1773
                          u'picon_path',
1969
                          u'search',
1774
                          u'search',
1970
                          u'{0',
1775
                          u'{0',
1971
-                         u'exception',
1972
-                         u'img =',
1973
-                         u'showerror',
1974
-                         u'activate']
1776
+                         u'exception']
1975
 testing.stored-results = (1,
1777
 testing.stored-results = (1,
1976
                           [],
1778
                           [],
1977
                           {})
1779
                           {})

+ 8
- 10
run.py View File

20
 
20
 
21
 class Main(Frame):
21
 class Main(Frame):
22
 
22
 
23
-    def __init__(self, sources):
23
+    def __init__(self, sources, cfg_file="streams.cfg"):
24
         self.root = Tk()
24
         self.root = Tk()
25
         self.root.geometry("1050x600")
25
         self.root.geometry("1050x600")
26
         Frame.__init__(self, self.root)
26
         Frame.__init__(self, self.root)
33
         if sources:
33
         if sources:
34
             self.sources = sources
34
             self.sources = sources
35
         else:
35
         else:
36
-            self.sources = ContentSources("sources")
36
+            self.sources = ContentSources("sources", cfg_file)
37
         self.picons_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "picons")
37
         self.picons_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "picons")
38
         self.tmp_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "tmp")
38
         self.tmp_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "tmp")
39
         if not os.path.exists(self.tmp_path):
39
         if not os.path.exists(self.tmp_path):
382
         self.result = self.listbox.curselection()[0]
382
         self.result = self.listbox.curselection()[0]
383
 
383
 
384
 
384
 
385
-def run(sources=None, data="config::home", title="Home"):
386
-    app = Main(sources)
385
+def run(sources=None, data="config::home", title="Home", cfg_file="streams.cfg"):
386
+    app = Main(sources, cfg_file=cfg_file)
387
     app.show_content((title, data, "", ""))
387
     app.show_content((title, data, "", ""))
388
     app.start()
388
     app.start()
389
 
389
 
390
 
390
 
391
 
391
 
392
-def run_cli(sources, data="config::home"):
392
+def run_cli(sources, data="config::home", title="Home", cfg_file="streams.cfg"):
393
 
393
 
394
     #options = sources.options_read("ltc")
394
     #options = sources.options_read("ltc")
395
     #print options
395
     #print options
542
 
542
 
543
 if __name__ == "__main__":
543
 if __name__ == "__main__":
544
     show_hidden = False
544
     show_hidden = False
545
-    if len(sys.argv)>1:
546
-        data= sys.argv[1]
547
-    else:
548
-        data = "config::home"
545
+    data= sys.argv[1] if len(sys.argv) > 1 else "config::home"
546
+    cfg_file = sys.argv[2] if len(sys.argv) > 2 else "streams.cfg"
549
     #sources = ContentSources("sources")
547
     #sources = ContentSources("sources")
550
     sources = None
548
     sources = None
551
-    run(sources, data)
549
+    run(sources, data, cfg_file=cfg_file)

+ 2
- 2
sources/config.py View File

12
 os.path.dirname(os.path.abspath(__file__))
12
 os.path.dirname(os.path.abspath(__file__))
13
 class Source(SourceBase):
13
 class Source(SourceBase):
14
 
14
 
15
-    def __init__(self,country="lv",cfg_path=None):
15
+    def __init__(self,country="lv",cfg_path=None, cfg_file="streams.cfg"):
16
         self.name = "config"
16
         self.name = "config"
17
         self.country=country
17
         self.country=country
18
         cur_directory = os.path.dirname(os.path.abspath(__file__))
18
         cur_directory = os.path.dirname(os.path.abspath(__file__))
19
         if not cfg_path: cfg_path = cur_directory
19
         if not cfg_path: cfg_path = cur_directory
20
-        self.streams_file = os.path.join(cfg_path,"streams.cfg")
20
+        self.streams_file = os.path.join(cfg_path,cfg_file)
21
         self.lists = collections.OrderedDict()
21
         self.lists = collections.OrderedDict()
22
         self.titles = {}
22
         self.titles = {}
23
         self.read_streams()
23
         self.read_streams()