Browse Source

config delete un move sataisīts

Ivars 6 years ago
parent
commit
dd7d2102cd
3 changed files with 80 additions and 122 deletions
  1. 67
    116
      project.wpr
  2. 12
    6
      sources/config.py
  3. 1
    0
      sources/streams.cfg

+ 67
- 116
project.wpr View File

@@ -275,7 +275,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
275 275
                                {'tree-state': {'file-sort-method': 'by name',
276 276
         'list-files-first': 0,
277 277
         'tree-states': {'deep': {'expanded-nodes': [(2,)],
278
-                                 'selected-nodes': [(18,)],
278
+                                 'selected-nodes': [],
279 279
                                  'top-node': (0,)}},
280 280
         'tree-style': 'deep'}}),
281 281
                               ('snippets',
@@ -425,6 +425,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
425 425
         'top-node': [('generic attribute',
426 426
                       loc('../../../Python27/Lib/site-packages/win32com/client/dynamic.py'),
427 427
                       'ALL_INVOKE_TYPES')]},
428
+        loc('../../SplashData/remdup.py'): {'column-widths': [1.0],
429
+        'expanded-nodes': [],
430
+        'selected-nodes': [],
431
+        'top-node': [('generic attribute',
432
+                      loc('../../SplashData/remdup.py'),
433
+                      'f')]},
428 434
         loc('../$test/test2.py'): {'column-widths': [1.0],
429 435
                                    'expanded-nodes': [],
430 436
                                    'selected-nodes': [],
@@ -753,12 +759,6 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
753 759
                                       'top-node': [('generic attribute',
754 760
         loc('../vietas/vietas2.py'),
755 761
         'd_lat')]},
756
-        loc('../../SplashData/remdup.py'): {'column-widths': [1.0],
757
-        'expanded-nodes': [],
758
-        'selected-nodes': [],
759
-        'top-node': [('generic attribute',
760
-                      loc('../../SplashData/remdup.py'),
761
-                      'f')]},
762 762
         loc('../../../../../Python27/lib/lib-tk/Tkinter.py'): {'expanded-nod'\
763 763
         'es': [],
764 764
         'selected-nodes': [],
@@ -794,18 +794,18 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
794 794
         'top-node': [('generic attribute',
795 795
                       loc('../../../../../Python27/lib/site-packages/PIL/Image.py'),
796 796
                       'ADAPTIVE')]},
797
-        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
797
+        loc('unknown:<untitled> #6'): {'column-widths': [1.0],
798 798
                                        'expanded-nodes': [],
799 799
                                        'selected-nodes': [],
800 800
                                        'top-node': None},
801
-        loc('unknown:<untitled> #6'): {'expanded-nodes': [],
801
+        loc('unknown:<untitled> #3'): {'column-widths': [1.0],
802
+                                       'expanded-nodes': [],
802 803
                                        'selected-nodes': [],
803 804
                                        'top-node': None},
804
-        loc('unknown:<untitled> #5'): {'expanded-nodes': [],
805
+        loc('unknown:<untitled> #4'): {'expanded-nodes': [],
805 806
                                        'selected-nodes': [],
806 807
                                        'top-node': None},
807
-        loc('unknown:<untitled> #4'): {'column-widths': [1.0],
808
-                                       'expanded-nodes': [],
808
+        loc('unknown:<untitled> #5'): {'expanded-nodes': [],
809 809
                                        'selected-nodes': [],
810 810
                                        'top-node': None}},
811 811
                                 'browse_mode': u'Current Module',
@@ -833,7 +833,7 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
833 833
                  'primary_view_state': {'area': 'wide',
834 834
         'constraint': None,
835 835
         'current_pages': [2,
836
-                          0],
836
+                          4],
837 837
         'notebook_display': 'normal',
838 838
         'notebook_percent': 0.4761133603238866,
839 839
         'override_title': None,
@@ -942,51 +942,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
942 942
         -1,
943 943
         -1),
944 944
                        'attrib-starts': [],
945
-                       'first-line': 123L,
945
+                       'first-line': 0L,
946 946
                        'folded-linenos': [],
947
-                       'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/run.py': ['s'\
948
-        'elf.cfg_file\n',
949
-        'self.cfg_file',
950
-        're.search("ftp*://.+", self.cfg_file)\n',
951
-        're.search("(htt*|ftp*://.*", "http://sfsdfsd")\n',
952
-        're.search("(htt*|ftp*)://.*", "http://sfsdfsd")\n',
953
-        're.search("(http*|ftp*)://.*", "http://sfsdfsd")\n',
954
-        're.search("(http*|ftp*)://.*", "https://sfsdfsd")\n',
955
-        're.search("(https*|ftps*)://.*", "https://sfsdfsd")\n',
956
-        're.search("(https*|ftps*)://.*", "http://sfsdfsd")\n',
957
-        're.search("(https*|ftps*)://.*", "ftp://sfsdfsd")\n',
958
-        're.search("(https*|ftps*)://.*", "ftps://sfsdfsd")\n',
959
-        're.search("(https*|ftps*)://.*", "aaa/sfsdfsd")\n',
960
-        'os.path.join(self.cfg_path, "streams.cfg")\n',
961
-        'self.lists\n',
962
-        'if self.lists: print True\n',
963
-        're.search("(https*|ftps*)://.*", self.stream_file)\n'],
964
-                                   u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/config.py': ['e'\
965
-        '\n',
966
-        'open(tmp_file, "r")\n'],
967
-                                   u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/filmix.py': ['p'\
968
-        'ath\n',
969
-        'print translations\n',
970
-        'print translations[0]\n',
971
-        'translations.keys()[0]\n',
972
-        'print translations.keys()[0]\n',
973
-        'print translations.keys()[1]\n',
974
-        'translations[pl]\n',
975
-        'len(translations)\n',
976
-        'data\n',
977
-        'translations[0]\n',
978
-        'translations.keys()\n',
979
-        'translations\n',
980
-        'playlist =js["playlist"]\n',
981
-        'playlist\n',
982
-        'len(playlist)\n',
983
-        's\n',
984
-        'e\n']},
947
+                       'history': {},
985 948
                        'launch-id': None,
986
-                       'sel-line': 134L,
987
-                       'sel-line-start': 9986L,
988
-                       'selection_end': 9994L,
989
-                       'selection_start': 9994L,
949
+                       'sel-line': 0L,
950
+                       'sel-line-start': 0L,
951
+                       'selection_end': 0L,
952
+                       'selection_start': 0L,
990 953
                        'zoom': 0L}),
991 954
                      ('debug-watch',
992 955
                       'wide',
@@ -1023,53 +986,28 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1023 986
         -1,
1024 987
         -1),
1025 988
                        'attrib-starts': [],
1026
-                       'first-line': 30L,
989
+                       'first-line': 0L,
1027 990
                        'folded-linenos': [],
1028
-                       'history': {None: ['import StringIO\n',
1029
-        'a = StringIO.StringIO()\n',
1030
-        'a.write("aaa\\n")\n',
1031
-        'a.close()\n',
1032
-        'a.read()\n',
1033
-        'import urlparse\n',
1034
-        'urlparse.urlparse("ftp://user:Kaskade7@home.blue.lv/hdd/aaa.cfg")\n',
1035
-        'p = urlparse.urlparse("ftp://user:Kaskade7@home.blue.lv/hdd/aaa.cfg'\
1036
-        '")\n',
1037
-        'p\n',
1038
-        'p.password\n',
1039
-        'p.netloc\n',
1040
-        'p.hostname\n',
1041
-        'p.path\n',
1042
-        'p.user\n',
1043
-        'elif \n']},
991
+                       'history': {},
1044 992
                        'launch-id': None,
1045
-                       'sel-line': 42L,
1046
-                       'sel-line-start': 1384L,
1047
-                       'selection_end': 1384L,
1048
-                       'selection_start': 1384L,
993
+                       'sel-line': 2L,
994
+                       'sel-line-start': 174L,
995
+                       'selection_end': 174L,
996
+                       'selection_start': 174L,
1049 997
                        'zoom': 0L})],
1050 998
         'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('run.py'),
1051
-        {'attrib-starts': [],
1052
-         'first-line': 713L,
999
+        {'attrib-starts': [('Main',
1000
+                            22),
1001
+                           ('Main.__init__',
1002
+                            24)],
1003
+         'first-line': 19L,
1053 1004
          'folded-linenos': [],
1054
-         'sel-line': 724L,
1055
-         'sel-line-start': 29166L,
1056
-         'selection_end': 29178L,
1057
-         'selection_start': 29170L,
1005
+         'sel-line': 24L,
1006
+         'sel-line-start': 554L,
1007
+         'selection_end': 594L,
1008
+         'selection_start': 586L,
1058 1009
          'zoom': 0L},
1059
-        1520694091.959],
1060
-        [loc('run.py'),
1061
-         {'attrib-starts': [('Main',
1062
-                             22),
1063
-                            ('Main.__init__',
1064
-                             24)],
1065
-          'first-line': 19L,
1066
-          'folded-linenos': [],
1067
-          'sel-line': 24L,
1068
-          'sel-line-start': 554L,
1069
-          'selection_end': 594L,
1070
-          'selection_start': 586L,
1071
-          'zoom': 0L},
1072
-         1520694093.213],
1010
+        1520694093.213],
1073 1011
         [loc('run.py'),
1074 1012
          {'attrib-starts': [('Main',
1075 1013
                              22),
@@ -1280,7 +1218,20 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1280 1218
           'selection_end': 5003L,
1281 1219
           'selection_start': 5003L,
1282 1220
           'zoom': 0L},
1283
-         1520699141.454]],
1221
+         1520699141.454],
1222
+        [loc('sources/config.py'),
1223
+         {'attrib-starts': [('Source',
1224
+                             12),
1225
+                            ('Source.read_streams',
1226
+                             42)],
1227
+          'first-line': 57L,
1228
+          'folded-linenos': [],
1229
+          'sel-line': 60L,
1230
+          'sel-line-start': 2316L,
1231
+          'selection_end': 2349L,
1232
+          'selection_start': 2349L,
1233
+          'zoom': 0L},
1234
+         1520712354.147]],
1284 1235
         20),
1285 1236
         'current-loc': loc('sources/config.py'),
1286 1237
         'editor-state-list': [(loc('run.py'),
@@ -1296,12 +1247,12 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1296 1247
                                 'selection_start': 1102L,
1297 1248
                                 'zoom': 0L}),
1298 1249
                               (loc('util.py'),
1299
-                               {'attrib-starts': [('unescape',
1300
-        538)],
1250
+                               {'attrib-starts': [('_substitute_entity',
1251
+        506)],
1301 1252
                                 'first-line': 537L,
1302 1253
                                 'folded-linenos': [],
1303
-                                'sel-line': 540L,
1304
-                                'sel-line-start': 16550L,
1254
+                                'sel-line': 522L,
1255
+                                'sel-line-start': 16579L,
1305 1256
                                 'selection_end': 16598L,
1306 1257
                                 'selection_start': 16598L,
1307 1258
                                 'zoom': 0L}),
@@ -1415,14 +1366,14 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1415 1366
                               (loc('sources/config.py'),
1416 1367
                                {'attrib-starts': [('Source',
1417 1368
         12),
1418
-        ('Source.write_streams',
1419
-         73)],
1420
-                                'first-line': 81L,
1369
+        ('Source.move_item',
1370
+         150)],
1371
+                                'first-line': 145L,
1421 1372
                                 'folded-linenos': [],
1422
-                                'sel-line': 86L,
1423
-                                'sel-line-start': 3224L,
1424
-                                'selection_end': 3285L,
1425
-                                'selection_start': 3285L,
1373
+                                'sel-line': 156L,
1374
+                                'sel-line-start': 5473L,
1375
+                                'selection_end': 5473L,
1376
+                                'selection_start': 5473L,
1426 1377
                                 'zoom': 0L}),
1427 1378
                               (loc('../../../../../Python27/Lib/ftplib.py'),
1428 1379
                                {'attrib-starts': [('FTP',
@@ -1452,18 +1403,19 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1452 1403
          loc('resolvers/cloudsany.py'),
1453 1404
          loc('sources/config.py'),
1454 1405
          loc('../../../../../Python27/Lib/ftplib.py')]),
1455
-                               'open_files': [u'Downloader.py',
1406
+                               'open_files': [u'ContentSources.py',
1407
+        u'Downloader.py',
1456 1408
         u'resolver.py',
1457 1409
         u'resolvers/cloudsany.py',
1410
+        u'run.py',
1458 1411
         u'sources/euronews.py',
1459 1412
         u'sources/filmas.py',
1413
+        u'sources/filmix.py',
1460 1414
         u'sources/lmt.py',
1461
-        u'sources/replay.py',
1462 1415
         u'sources/ltc.py',
1463
-        u'sources/filmix.py',
1416
+        u'sources/replay.py',
1417
+        u'../../../../../Python27/Lib/ftplib.py',
1464 1418
         u'util.py',
1465
-        u'ContentSources.py',
1466
-        u'run.py',
1467 1419
         u'sources/config.py']},
1468 1420
         'saved_notebook_display': None,
1469 1421
         'split_percents': {0: 0.42670046472327844},
@@ -1480,10 +1432,9 @@ guimgr.overall-gui-state = {'windowing-policy': 'combined-window',
1480 1432
                          1858,
1481 1433
                          1080)}]}
1482 1434
 guimgr.recent-documents = [loc('sources/config.py'),
1483
-                           loc('../../../../../Python27/Lib/ftplib.py'),
1435
+                           loc('util.py'),
1484 1436
                            loc('run.py'),
1485 1437
                            loc('ContentSources.py'),
1486
-                           loc('util.py'),
1487 1438
                            loc('sources/filmix.py'),
1488 1439
                            loc('sources/ltc.py'),
1489 1440
                            loc('sources/replay.py'),

+ 12
- 6
sources/config.py View File

@@ -46,10 +46,10 @@ class Source(SourceBase):
46 46
             try:
47 47
                 sf = urllib2.urlopen(self.streams_file, "r")
48 48
             except Exception as e:
49
-                #raise Exception("Can not open streams file %s" % self.cfg_file)
50
-                print "Warning: can not open streams file %s, callback to default" % self.streams_file
51
-                self.streams_file = os.path.join(self.cfg_path, "streams.cfg")
52
-                sf = open(self.streams_file, "r")
49
+                raise Exception("Can not open streams file %s" % self.cfg_file)
50
+                #print "Warning: can not open streams file %s, callback to default" % self.streams_file
51
+                #self.streams_file = os.path.join(self.cfg_path, "streams.cfg")
52
+                #sf = open(self.streams_file, "r")
53 53
         else:
54 54
             try:
55 55
                 sf = open(self.streams_file, "r")
@@ -142,12 +142,18 @@ class Source(SourceBase):
142 142
             else:
143 143
                 self.lists[name].insert(pos,item)
144 144
 
145
-    def del_item(self,name,pos):
145
+    def del_item(self, name, pos):
146 146
         self.lists[name].pop(pos)
147 147
 
148
-    def replace_item(self,name,item,pos):
148
+    def replace_item(self, name, item, pos):
149 149
         self.lists[name][pos]=item
150 150
 
151
+    def move_item(self, name, pos, pos2):
152
+        # l.insert(newindex, l.pop(oldindex))
153
+        if pos2 < pos:
154
+            self.lists[name].insert(pos2, self.lists[name].pop(pos))
155
+        elif pos2 > pos:
156
+            self.lists[name].insert(pos2-1, self.lists[name].pop(pos))
151 157
 
152 158
 if __name__ == "__main__":
153 159
 

+ 1
- 0
sources/streams.cfg View File

@@ -62,6 +62,7 @@ My Video
62 62
 ..return|back|back.png|Atgriezties atpakaļ
63 63
 Filmix - Все фильмы|filmix::films|filmix.png|Все фильмы
64 64
 Filmix - Все сериалы|filmix::serialy|filmix.png|Все сериалы
65
+Темные времена/Darkest Hour (2017)|filmix::play/120294|https://filmix.me/uploads/posters/thumbs/w220/temnye-vremena-2017_120294_0.jpg|Темные времена/Darkest Hour (2017)\nСобытия драматического фильма «Темные времена» начинают свое развитие всего за несколько дней до того, как Уинстон Черчилль должен вступить на должность...\n\nWEB-DLRip 720 \nПрофессиональный, многоголосый\n{director}\nЛили Джеймс, Гари Олдман, Бен Мендельсон, Стивен Диллэйн, Кристин Скотт Томас
65 66
 
66 67
 [my_kids]
67 68
 My Kids