Browse Source

ftp uploads

Ivars 6 years ago
parent
commit
d9270d39bb
2 changed files with 306 additions and 261 deletions
  1. 263
    247
      project.wpr
  2. 43
    14
      sources/config.py

+ 263
- 247
project.wpr View File

114
         None,
114
         None,
115
         1,
115
         1,
116
         0)},
116
         0)},
117
-                     loc('sources/config.py'): {50L: (0,
117
+                     loc('sources/config.py'): {51L: (0,
118
         None,
118
         None,
119
         1,
119
         1,
120
-        0)},
120
+        0),
121
+        106L: (0,
122
+               None,
123
+               1,
124
+               0),
125
+        114L: (0,
126
+               None,
127
+               1,
128
+               0)},
121
                      loc('sources/euronews.py'): {161L: (0,
129
                      loc('sources/euronews.py'): {161L: (0,
122
         None,
130
         None,
123
         1,
131
         1,
256
         'view': {'area': 'tall',
264
         'view': {'area': 'tall',
257
                  'constraint': None,
265
                  'constraint': None,
258
                  'current_pages': [0,
266
                  'current_pages': [0,
259
-                                   0],
267
+                                   2],
260
                  'full-screen': False,
268
                  'full-screen': False,
261
                  'notebook_display': 'normal',
269
                  'notebook_display': 'normal',
262
                  'notebook_percent': 0.17992831541218635,
270
                  'notebook_percent': 0.17992831541218635,
824
                                None)],
832
                                None)],
825
                  'primary_view_state': {'area': 'wide',
833
                  'primary_view_state': {'area': 'wide',
826
         'constraint': None,
834
         'constraint': None,
827
-        'current_pages': [8,
835
+        'current_pages': [2,
828
                           0],
836
                           0],
829
         'notebook_display': 'normal',
837
         'notebook_display': 'normal',
830
         'notebook_percent': 0.4761133603238866,
838
         'notebook_percent': 0.4761133603238866,
860
                                        'fRegexFlags': 46,
868
                                        'fRegexFlags': 46,
861
                                        'fReplaceText': u'streams_file',
869
                                        'fReplaceText': u'streams_file',
862
                                        'fReverse': False,
870
                                        'fReverse': False,
863
-                                       'fSearchText': u'stream_file',
871
+                                       'fSearchText': u'cfg_file',
864
                                        'fStartPos': 0,
872
                                        'fStartPos': 0,
865
                                        'fStyle': 'text',
873
                                        'fStyle': 'text',
866
                                        'fWholeWords': False,
874
                                        'fWholeWords': False,
873
                                       'fReplaceOnDisk': False,
881
                                       'fReplaceOnDisk': False,
874
                                       'fShowFirstMatch': False,
882
                                       'fShowFirstMatch': False,
875
                                       'fShowLineno': True,
883
                                       'fShowLineno': True,
876
-                                      'fShowReplaceWidgets': True}}),
884
+                                      'fShowReplaceWidgets': False}}),
877
                      ('batch-search',
885
                      ('batch-search',
878
                       'wide',
886
                       'wide',
879
                       0,
887
                       0,
934
         -1,
942
         -1,
935
         -1),
943
         -1),
936
                        'attrib-starts': [],
944
                        'attrib-starts': [],
937
-                       'first-line': 116L,
945
+                       'first-line': 123L,
938
                        'folded-linenos': [],
946
                        'folded-linenos': [],
939
                        'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/run.py': ['s'\
947
                        'history': {u'file:C:/Data/Programming/enigma2/PlayStream2/content/run.py': ['s'\
940
         'elf.cfg_file\n',
948
         'elf.cfg_file\n',
953
         'self.lists\n',
961
         'self.lists\n',
954
         'if self.lists: print True\n',
962
         'if self.lists: print True\n',
955
         're.search("(https*|ftps*)://.*", self.stream_file)\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'],
956
                                    u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/filmix.py': ['p'\
967
                                    u'file:C:/Data/Programming/enigma2/PlayStream2/content/sources/filmix.py': ['p'\
957
         'ath\n',
968
         'ath\n',
958
         'print translations\n',
969
         'print translations\n',
972
         's\n',
983
         's\n',
973
         'e\n']},
984
         'e\n']},
974
                        'launch-id': None,
985
                        'launch-id': None,
975
-                       'sel-line': 128L,
976
-                       'sel-line-start': 9757L,
977
-                       'selection_end': 9757L,
978
-                       'selection_start': 9757L,
986
+                       'sel-line': 134L,
987
+                       'sel-line-start': 9986L,
988
+                       'selection_end': 9994L,
989
+                       'selection_start': 9994L,
979
                        'zoom': 0L}),
990
                        'zoom': 0L}),
980
                      ('debug-watch',
991
                      ('debug-watch',
981
                       'wide',
992
                       'wide',
1012
         -1,
1023
         -1,
1013
         -1),
1024
         -1),
1014
                        'attrib-starts': [],
1025
                        'attrib-starts': [],
1015
-                       'first-line': 0L,
1026
+                       'first-line': 30L,
1016
                        'folded-linenos': [],
1027
                        'folded-linenos': [],
1017
-                       'history': {},
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']},
1018
                        'launch-id': None,
1044
                        'launch-id': None,
1019
-                       'sel-line': 2L,
1020
-                       'sel-line-start': 174L,
1021
-                       'selection_end': 174L,
1022
-                       'selection_start': 174L,
1045
+                       'sel-line': 42L,
1046
+                       'sel-line-start': 1384L,
1047
+                       'selection_end': 1384L,
1048
+                       'selection_start': 1384L,
1023
                        'zoom': 0L})],
1049
                        'zoom': 0L})],
1024
-        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('sources/config.py'),
1025
-        {'attrib-starts': [('Source',
1026
-                            12),
1027
-                           ('Source.get_content',
1028
-                            28)],
1029
-         'first-line': 21L,
1050
+        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('run.py'),
1051
+        {'attrib-starts': [],
1052
+         'first-line': 713L,
1030
          'folded-linenos': [],
1053
          'folded-linenos': [],
1031
-         'sel-line': 30L,
1032
-         'sel-line-start': 1138L,
1033
-         'selection_end': 1163L,
1034
-         'selection_start': 1151L,
1054
+         'sel-line': 724L,
1055
+         'sel-line-start': 29166L,
1056
+         'selection_end': 29178L,
1057
+         'selection_start': 29170L,
1035
          'zoom': 0L},
1058
          'zoom': 0L},
1036
-        1520692463.547],
1037
-        [loc('sources/config.py'),
1038
-         {'attrib-starts': [('Source',
1039
-                             12),
1040
-                            ('Source.read_streams',
1041
-                             40)],
1042
-          'first-line': 31L,
1059
+        1520694091.959],
1060
+        [loc('run.py'),
1061
+         {'attrib-starts': [('Main',
1062
+                             22),
1063
+                            ('Main.__init__',
1064
+                             24)],
1065
+          'first-line': 19L,
1043
           'folded-linenos': [],
1066
           'folded-linenos': [],
1044
-          'sel-line': 40L,
1045
-          'sel-line-start': 1381L,
1046
-          'selection_end': 1401L,
1047
-          'selection_start': 1389L,
1067
+          'sel-line': 24L,
1068
+          'sel-line-start': 554L,
1069
+          'selection_end': 594L,
1070
+          'selection_start': 586L,
1048
           'zoom': 0L},
1071
           'zoom': 0L},
1049
-         1520692464.407],
1050
-        [loc('sources/config.py'),
1051
-         {'attrib-starts': [('Source',
1052
-                             12),
1053
-                            ('Source.__init__',
1054
-                             14)],
1055
-          'first-line': 21L,
1072
+         1520694093.213],
1073
+        [loc('run.py'),
1074
+         {'attrib-starts': [('Main',
1075
+                             22),
1076
+                            ('Main.__init__',
1077
+                             24)],
1078
+          'first-line': 28L,
1056
           'folded-linenos': [],
1079
           'folded-linenos': [],
1057
-          'sel-line': 26L,
1058
-          'sel-line-start': 1030L,
1059
-          'selection_end': 1055L,
1060
-          'selection_start': 1043L,
1080
+          'sel-line': 37L,
1081
+          'sel-line-start': 1125L,
1082
+          'selection_end': 1186L,
1083
+          'selection_start': 1178L,
1061
           'zoom': 0L},
1084
           'zoom': 0L},
1062
-         1520692465.724],
1063
-        [loc('sources/config.py'),
1064
-         {'attrib-starts': [('Source',
1065
-                             12),
1066
-                            ('Source.get_content',
1067
-                             28)],
1068
-          'first-line': 21L,
1085
+         1520694094.015],
1086
+        [loc('run.py'),
1087
+         {'attrib-starts': [('run',
1088
+                             531)],
1089
+          'first-line': 522L,
1069
           'folded-linenos': [],
1090
           'folded-linenos': [],
1070
-          'sel-line': 30L,
1071
-          'sel-line-start': 1138L,
1072
-          'selection_end': 1163L,
1073
-          'selection_start': 1151L,
1091
+          'sel-line': 532L,
1092
+          'sel-line-start': 22109L,
1093
+          'selection_end': 22126L,
1094
+          'selection_start': 22126L,
1074
           'zoom': 0L},
1095
           'zoom': 0L},
1075
-         1520692470.498],
1096
+         1520694103.129],
1076
         [loc('run.py'),
1097
         [loc('run.py'),
1077
-         {'attrib-starts': [('VideoInfo',
1078
-                             343),
1079
-                            ('VideoInfo.apply',
1080
-                             526)],
1081
-          'first-line': 523L,
1098
+         {'attrib-starts': [('run',
1099
+                             531)],
1100
+          'first-line': 525L,
1082
           'folded-linenos': [],
1101
           'folded-linenos': [],
1083
-          'sel-line': 529L,
1084
-          'sel-line-start': 22022L,
1085
-          'selection_end': 22022L,
1086
-          'selection_start': 22022L,
1102
+          'sel-line': 532L,
1103
+          'sel-line-start': 22109L,
1104
+          'selection_end': 22141L,
1105
+          'selection_start': 22133L,
1087
           'zoom': 0L},
1106
           'zoom': 0L},
1088
-         1520692477.372],
1089
-        [loc('sources/config.py'),
1090
-         {'attrib-starts': [('Source',
1091
-                             12),
1092
-                            ('Source.read_streams',
1093
-                             41)],
1094
-          'first-line': 44L,
1095
-          'folded-linenos': [44L,
1096
-                             58L],
1097
-          'sel-line': 53L,
1098
-          'sel-line-start': 2017L,
1099
-          'selection_end': 2030L,
1100
-          'selection_start': 2030L,
1107
+         1520694105.043],
1108
+        [loc('run.py'),
1109
+         {'attrib-starts': [('run',
1110
+                             531)],
1111
+          'first-line': 525L,
1112
+          'folded-linenos': [],
1113
+          'sel-line': 532L,
1114
+          'sel-line-start': 22109L,
1115
+          'selection_end': 22150L,
1116
+          'selection_start': 22142L,
1101
           'zoom': 0L},
1117
           'zoom': 0L},
1102
-         1520692758.744],
1118
+         1520694105.709],
1103
         [loc('run.py'),
1119
         [loc('run.py'),
1104
-         {'attrib-starts': [('VideoInfo',
1105
-                             343),
1106
-                            ('VideoInfo.apply',
1107
-                             526)],
1108
-          'first-line': 523L,
1120
+         {'attrib-starts': [('run_cli',
1121
+                             538)],
1122
+          'first-line': 531L,
1109
           'folded-linenos': [],
1123
           'folded-linenos': [],
1110
-          'sel-line': 529L,
1111
-          'sel-line-start': 22022L,
1112
-          'selection_end': 22022L,
1113
-          'selection_start': 22022L,
1124
+          'sel-line': 538L,
1125
+          'sel-line-start': 22221L,
1126
+          'selection_end': 22285L,
1127
+          'selection_start': 22277L,
1114
           'zoom': 0L},
1128
           'zoom': 0L},
1115
-         1520692764.885],
1116
-        [loc('sources/config.py'),
1117
-         {'attrib-starts': [('Source',
1118
-                             12),
1119
-                            ('Source.__init__',
1120
-                             14)],
1121
-          'first-line': 17L,
1122
-          'folded-linenos': [58L],
1123
-          'sel-line': 26L,
1124
-          'sel-line-start': 1044L,
1125
-          'selection_end': 1060L,
1126
-          'selection_start': 1060L,
1129
+         1520694111.18],
1130
+        [loc('run.py'),
1131
+         {'attrib-starts': [],
1132
+          'first-line': 715L,
1133
+          'folded-linenos': [],
1134
+          'sel-line': 724L,
1135
+          'sel-line-start': 29166L,
1136
+          'selection_end': 29178L,
1137
+          'selection_start': 29170L,
1127
           'zoom': 0L},
1138
           'zoom': 0L},
1128
-         1520692806.414],
1139
+         1520694112.068],
1129
         [loc('run.py'),
1140
         [loc('run.py'),
1130
-         {'attrib-starts': [('VideoInfo',
1131
-                             343),
1132
-                            ('VideoInfo.apply',
1133
-                             526)],
1134
-          'first-line': 523L,
1141
+         {'attrib-starts': [],
1142
+          'first-line': 720L,
1135
           'folded-linenos': [],
1143
           'folded-linenos': [],
1136
-          'sel-line': 529L,
1137
-          'sel-line-start': 22022L,
1138
-          'selection_end': 22022L,
1139
-          'selection_start': 22022L,
1144
+          'sel-line': 727L,
1145
+          'sel-line-start': 29296L,
1146
+          'selection_end': 29327L,
1147
+          'selection_start': 29319L,
1140
           'zoom': 0L},
1148
           'zoom': 0L},
1141
-         1520692811.456],
1142
-        [loc('sources/config.py'),
1143
-         {'attrib-starts': [('Source',
1144
-                             12),
1145
-                            ('Source.read_streams',
1146
-                             41)],
1147
-          'first-line': 52L,
1149
+         1520694113.128],
1150
+        [loc('run.py'),
1151
+         {'attrib-starts': [],
1152
+          'first-line': 720L,
1148
           'folded-linenos': [],
1153
           'folded-linenos': [],
1149
-          'sel-line': 60L,
1150
-          'sel-line-start': 2292L,
1151
-          'selection_end': 2292L,
1152
-          'selection_start': 2292L,
1154
+          'sel-line': 727L,
1155
+          'sel-line-start': 29296L,
1156
+          'selection_end': 29336L,
1157
+          'selection_start': 29328L,
1153
           'zoom': 0L},
1158
           'zoom': 0L},
1154
-         1520692931.11],
1159
+         1520694113.917],
1155
         [loc('run.py'),
1160
         [loc('run.py'),
1156
-         {'attrib-starts': [('VideoInfo',
1157
-                             343),
1158
-                            ('VideoInfo.apply',
1159
-                             526)],
1160
-          'first-line': 523L,
1161
+         {'attrib-starts': [('Main',
1162
+                             22),
1163
+                            ('Main.__init__',
1164
+                             24)],
1165
+          'first-line': 19L,
1161
           'folded-linenos': [],
1166
           'folded-linenos': [],
1162
-          'sel-line': 529L,
1163
-          'sel-line-start': 22022L,
1164
-          'selection_end': 22022L,
1165
-          'selection_start': 22022L,
1167
+          'sel-line': 33L,
1168
+          'sel-line-start': 1001L,
1169
+          'selection_end': 1018L,
1170
+          'selection_start': 1018L,
1166
           'zoom': 0L},
1171
           'zoom': 0L},
1167
-         1520692945.834],
1168
-        [loc('sources/config.py'),
1169
-         {'attrib-starts': [('Source',
1170
-                             12),
1171
-                            ('Source.__init__',
1172
-                             14)],
1173
-          'first-line': 16L,
1172
+         1520694125.794],
1173
+        [loc('run.py'),
1174
+         {'attrib-starts': [('Main',
1175
+                             22),
1176
+                            ('Main.__init__',
1177
+                             24)],
1178
+          'first-line': 28L,
1174
           'folded-linenos': [],
1179
           'folded-linenos': [],
1175
-          'sel-line': 21L,
1176
-          'sel-line-start': 763L,
1177
-          'selection_end': 763L,
1178
-          'selection_start': 763L,
1180
+          'sel-line': 37L,
1181
+          'sel-line-start': 1125L,
1182
+          'selection_end': 1166L,
1183
+          'selection_start': 1152L,
1179
           'zoom': 0L},
1184
           'zoom': 0L},
1180
-         1520693017.716],
1181
-        [loc('sources/config.py'),
1185
+         1520694143.184],
1186
+        [loc('ContentSources.py'),
1182
          {'attrib-starts': [],
1187
          {'attrib-starts': [],
1183
           'first-line': 0L,
1188
           'first-line': 0L,
1184
           'folded-linenos': [],
1189
           'folded-linenos': [],
1187
           'selection_end': 21L,
1192
           'selection_end': 21L,
1188
           'selection_start': 21L,
1193
           'selection_start': 21L,
1189
           'zoom': 0L},
1194
           'zoom': 0L},
1190
-         1520693172.463],
1191
-        [loc('sources/config.py'),
1192
-         {'attrib-starts': [('Source',
1193
-                             12),
1194
-                            ('Source.__init__',
1195
-                             14)],
1195
+         1520694148.372],
1196
+        [loc('ContentSources.py'),
1197
+         {'attrib-starts': [('ContentSources',
1198
+                             16),
1199
+                            ('ContentSources.__init__',
1200
+                             20)],
1196
           'first-line': 18L,
1201
           'first-line': 18L,
1197
           'folded-linenos': [],
1202
           'folded-linenos': [],
1198
-          'sel-line': 27L,
1199
-          'sel-line-start': 1070L,
1200
-          'selection_end': 1095L,
1201
-          'selection_start': 1083L,
1203
+          'sel-line': 20L,
1204
+          'sel-line-start': 703L,
1205
+          'selection_end': 747L,
1206
+          'selection_start': 739L,
1202
           'zoom': 0L},
1207
           'zoom': 0L},
1203
-         1520693173.999],
1204
-        [loc('sources/config.py'),
1205
-         {'attrib-starts': [('Source',
1206
-                             12),
1207
-                            ('Source.get_content',
1208
-                             29)],
1209
-          'first-line': 24L,
1208
+         1520694152.882],
1209
+        [loc('ContentSources.py'),
1210
+         {'attrib-starts': [('ContentSources',
1211
+                             16),
1212
+                            ('ContentSources.__init__',
1213
+                             20)],
1214
+          'first-line': 28L,
1210
           'folded-linenos': [],
1215
           'folded-linenos': [],
1211
-          'sel-line': 31L,
1212
-          'sel-line-start': 1178L,
1213
-          'selection_end': 1203L,
1214
-          'selection_start': 1191L,
1216
+          'sel-line': 38L,
1217
+          'sel-line-start': 1556L,
1218
+          'selection_end': 1621L,
1219
+          'selection_start': 1613L,
1215
           'zoom': 0L},
1220
           'zoom': 0L},
1216
-         1520693174.976],
1217
-        [loc('sources/config.py'),
1218
-         {'attrib-starts': [('Source',
1219
-                             12),
1220
-                            ('Source.read_streams',
1221
-                             41)],
1222
-          'first-line': 32L,
1221
+         1520694161.991],
1222
+        [loc('run.py'),
1223
+         {'attrib-starts': [('Main',
1224
+                             22),
1225
+                            ('Main.__init__',
1226
+                             24)],
1227
+          'first-line': 28L,
1223
           'folded-linenos': [],
1228
           'folded-linenos': [],
1224
-          'sel-line': 41L,
1225
-          'sel-line-start': 1421L,
1226
-          'selection_end': 1441L,
1227
-          'selection_start': 1429L,
1229
+          'sel-line': 35L,
1230
+          'sel-line-start': 1074L,
1231
+          'selection_end': 1102L,
1232
+          'selection_start': 1102L,
1228
           'zoom': 0L},
1233
           'zoom': 0L},
1229
-         1520693175.767],
1234
+         1520694959.722],
1230
         [loc('sources/config.py'),
1235
         [loc('sources/config.py'),
1231
          {'attrib-starts': [('Source',
1236
          {'attrib-starts': [('Source',
1232
                              12),
1237
                              12),
1233
                             ('Source.__init__',
1238
                             ('Source.__init__',
1234
                              14)],
1239
                              14)],
1235
-          'first-line': 14L,
1240
+          'first-line': 11L,
1236
           'folded-linenos': [],
1241
           'folded-linenos': [],
1237
-          'sel-line': 22L,
1238
-          'sel-line-start': 876L,
1239
-          'selection_end': 904L,
1240
-          'selection_start': 893L,
1242
+          'sel-line': 18L,
1243
+          'sel-line-start': 616L,
1244
+          'selection_end': 623L,
1245
+          'selection_start': 623L,
1241
           'zoom': 0L},
1246
           'zoom': 0L},
1242
-         1520693189.768],
1247
+         1520697293.876],
1243
         [loc('sources/config.py'),
1248
         [loc('sources/config.py'),
1244
-         {'attrib-starts': [('Source',
1245
-                             12),
1246
-                            ('Source.read_streams',
1247
-                             41)],
1248
-          'first-line': 33L,
1249
+         {'attrib-starts': [],
1250
+          'first-line': 142L,
1249
           'folded-linenos': [],
1251
           'folded-linenos': [],
1250
-          'sel-line': 42L,
1251
-          'sel-line-start': 1452L,
1252
-          'selection_end': 1476L,
1253
-          'selection_start': 1476L,
1252
+          'sel-line': 151L,
1253
+          'sel-line-start': 5206L,
1254
+          'selection_end': 5206L,
1255
+          'selection_start': 5206L,
1254
           'zoom': 0L},
1256
           'zoom': 0L},
1255
-         1520693202.442],
1256
-        [loc('run.py'),
1257
-         {'attrib-starts': [('VideoInfo',
1258
-                             343),
1259
-                            ('VideoInfo.apply',
1260
-                             526)],
1261
-          'first-line': 517L,
1257
+         1520699114.77],
1258
+        [loc('../../../../../Python27/Lib/ftplib.py'),
1259
+         {'attrib-starts': [('FTP',
1260
+                             78),
1261
+                            ('FTP.getresp',
1262
+                             213)],
1263
+          'first-line': 211L,
1262
           'folded-linenos': [],
1264
           'folded-linenos': [],
1263
-          'sel-line': 529L,
1264
-          'sel-line-start': 22022L,
1265
-          'selection_end': 22022L,
1266
-          'selection_start': 22022L,
1265
+          'sel-line': 223L,
1266
+          'sel-line-start': 7831L,
1267
+          'selection_end': 7831L,
1268
+          'selection_start': 7831L,
1267
           'zoom': 0L},
1269
           'zoom': 0L},
1268
-         1520693245.985],
1270
+         1520699128.124],
1269
         [loc('sources/config.py'),
1271
         [loc('sources/config.py'),
1270
          {'attrib-starts': [('Source',
1272
          {'attrib-starts': [('Source',
1271
                              12),
1273
                              12),
1272
-                            ('Source.read_streams',
1273
-                             41)],
1274
-          'first-line': 39L,
1274
+                            ('Source.replace_item',
1275
+                             143)],
1276
+          'first-line': 139L,
1275
           'folded-linenos': [],
1277
           'folded-linenos': [],
1276
-          'sel-line': 42L,
1277
-          'sel-line-start': 1452L,
1278
-          'selection_end': 1476L,
1279
-          'selection_start': 1476L,
1278
+          'sel-line': 143L,
1279
+          'sel-line-start': 4984L,
1280
+          'selection_end': 5003L,
1281
+          'selection_start': 5003L,
1280
           'zoom': 0L},
1282
           'zoom': 0L},
1281
-         1520693266.767]],
1283
+         1520699141.454]],
1282
         20),
1284
         20),
1283
-        'current-loc': loc('run.py'),
1285
+        'current-loc': loc('sources/config.py'),
1284
         'editor-state-list': [(loc('run.py'),
1286
         'editor-state-list': [(loc('run.py'),
1285
-                               {'attrib-starts': [('VideoInfo',
1286
-        343),
1287
-        ('VideoInfo.apply',
1288
-         526)],
1289
-                                'first-line': 517L,
1287
+                               {'attrib-starts': [('Main',
1288
+        22),
1289
+        ('Main.__init__',
1290
+         24)],
1291
+                                'first-line': 28L,
1290
                                 'folded-linenos': [],
1292
                                 'folded-linenos': [],
1291
-                                'sel-line': 528L,
1292
-                                'sel-line-start': 22020L,
1293
-                                'selection_end': 22020L,
1294
-                                'selection_start': 22020L,
1293
+                                'sel-line': 35L,
1294
+                                'sel-line-start': 1074L,
1295
+                                'selection_end': 1102L,
1296
+                                'selection_start': 1102L,
1295
                                 'zoom': 0L}),
1297
                                 'zoom': 0L}),
1296
                               (loc('util.py'),
1298
                               (loc('util.py'),
1297
                                {'attrib-starts': [('unescape',
1299
                                {'attrib-starts': [('unescape',
1308
         16),
1310
         16),
1309
         ('ContentSources.__init__',
1311
         ('ContentSources.__init__',
1310
          20)],
1312
          20)],
1311
-                                'first-line': 33L,
1313
+                                'first-line': 28L,
1312
                                 'folded-linenos': [],
1314
                                 'folded-linenos': [],
1313
-                                'sel-line': 37L,
1314
-                                'sel-line-start': 1506L,
1315
-                                'selection_end': 1538L,
1316
-                                'selection_start': 1538L,
1315
+                                'sel-line': 38L,
1316
+                                'sel-line-start': 1556L,
1317
+                                'selection_end': 1621L,
1318
+                                'selection_start': 1613L,
1317
                                 'zoom': 0L}),
1319
                                 'zoom': 0L}),
1318
                               (loc('sources/ltc.py'),
1320
                               (loc('sources/ltc.py'),
1319
                                {'attrib-starts': [('Source',
1321
                                {'attrib-starts': [('Source',
1413
                               (loc('sources/config.py'),
1415
                               (loc('sources/config.py'),
1414
                                {'attrib-starts': [('Source',
1416
                                {'attrib-starts': [('Source',
1415
         12),
1417
         12),
1416
-        ('Source.read_streams',
1417
-         41)],
1418
-                                'first-line': 39L,
1418
+        ('Source.write_streams',
1419
+         73)],
1420
+                                'first-line': 81L,
1421
+                                'folded-linenos': [],
1422
+                                'sel-line': 86L,
1423
+                                'sel-line-start': 3224L,
1424
+                                'selection_end': 3285L,
1425
+                                'selection_start': 3285L,
1426
+                                'zoom': 0L}),
1427
+                              (loc('../../../../../Python27/Lib/ftplib.py'),
1428
+                               {'attrib-starts': [('FTP',
1429
+        78),
1430
+        ('FTP.getresp',
1431
+         213)],
1432
+                                'first-line': 211L,
1419
                                 'folded-linenos': [],
1433
                                 'folded-linenos': [],
1420
-                                'sel-line': 42L,
1421
-                                'sel-line-start': 1452L,
1422
-                                'selection_end': 1476L,
1423
-                                'selection_start': 1476L,
1434
+                                'sel-line': 223L,
1435
+                                'sel-line-start': 7831L,
1436
+                                'selection_end': 7831L,
1437
+                                'selection_start': 7831L,
1424
                                 'zoom': 0L})],
1438
                                 'zoom': 0L})],
1425
         'has-focus': True,
1439
         'has-focus': True,
1426
         'locked': False},
1440
         'locked': False},
1436
          loc('sources/euronews.py'),
1450
          loc('sources/euronews.py'),
1437
          loc('resolver.py'),
1451
          loc('resolver.py'),
1438
          loc('resolvers/cloudsany.py'),
1452
          loc('resolvers/cloudsany.py'),
1439
-         loc('sources/config.py')]),
1453
+         loc('sources/config.py'),
1454
+         loc('../../../../../Python27/Lib/ftplib.py')]),
1440
                                'open_files': [u'Downloader.py',
1455
                                'open_files': [u'Downloader.py',
1441
         u'resolver.py',
1456
         u'resolver.py',
1442
         u'resolvers/cloudsany.py',
1457
         u'resolvers/cloudsany.py',
1448
         u'sources/filmix.py',
1463
         u'sources/filmix.py',
1449
         u'util.py',
1464
         u'util.py',
1450
         u'ContentSources.py',
1465
         u'ContentSources.py',
1451
-        u'sources/config.py',
1452
-        u'run.py']},
1466
+        u'run.py',
1467
+        u'sources/config.py']},
1453
         'saved_notebook_display': None,
1468
         'saved_notebook_display': None,
1454
         'split_percents': {0: 0.42670046472327844},
1469
         'split_percents': {0: 0.42670046472327844},
1455
         'splits': 2,
1470
         'splits': 2,
1464
                          -1080,
1479
                          -1080,
1465
                          1858,
1480
                          1858,
1466
                          1080)}]}
1481
                          1080)}]}
1467
-guimgr.recent-documents = [loc('run.py'),
1468
-                           loc('sources/config.py'),
1482
+guimgr.recent-documents = [loc('sources/config.py'),
1483
+                           loc('../../../../../Python27/Lib/ftplib.py'),
1484
+                           loc('run.py'),
1469
                            loc('ContentSources.py'),
1485
                            loc('ContentSources.py'),
1470
                            loc('util.py'),
1486
                            loc('util.py'),
1471
                            loc('sources/filmix.py'),
1487
                            loc('sources/filmix.py'),
1997
                         [u''])}
2013
                         [u''])}
1998
 search.replace-history = [u'www.shortcut.lv',
2014
 search.replace-history = [u'www.shortcut.lv',
1999
                           u'shortcut.lv']
2015
                           u'shortcut.lv']
2000
-search.search-history = [u'read_streams',
2016
+search.search-history = [u'cfg_file',
2017
+                         u'read_streams',
2001
                          u'read_stream',
2018
                          u'read_stream',
2002
                          u'confif_file',
2019
                          u'confif_file',
2003
                          u'confif_f',
2020
                          u'confif_f',
2015
                          u'thumbnail',
2032
                          u'thumbnail',
2016
                          u'http:',
2033
                          u'http:',
2017
                          u'www.lattelecom.tv',
2034
                          u'www.lattelecom.tv',
2018
-                         u'http://www',
2019
-                         u'lattelecom.tv']
2035
+                         u'http://www']
2020
 testing.stored-results = (1,
2036
 testing.stored-results = (1,
2021
                           [],
2037
                           [],
2022
                           {})
2038
                           {})

+ 43
- 14
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, cfg_file="streams.cfg"):
15
+    def __init__(self,country="lv",cfg_path=None, cfg_file=""):
16
         self.name = "config"
16
         self.name = "config"
17
         self.country=country
17
         self.country=country
18
+        if not cfg_file: cfg_file = "streams.cfg"
18
         cur_directory = os.path.dirname(os.path.abspath(__file__))
19
         cur_directory = os.path.dirname(os.path.abspath(__file__))
19
         if not cfg_path: cfg_path = cur_directory
20
         if not cfg_path: cfg_path = cur_directory
20
         self.cfg_path = cfg_path
21
         self.cfg_path = cfg_path
72
         sf.close()
73
         sf.close()
73
     def write_streams(self):
74
     def write_streams(self):
74
 
75
 
75
-        if re.search("(https*|ftps*)://.*", self.streams_file):
76
-            # TODO
77
-            pass
76
+        if re.search("ftps*://.*", self.streams_file):
77
+            mode = "ftp"
78
+        elif re.search("https*://.*", self.streams_file):
79
+            mode = "http"
80
+            print "Warning stream_file http upload no yet implemented"
81
+            return
82
+        else:
83
+            mode = "file"
78
 
84
 
79
-        else:  # Paraksts fails
85
+        if mode == "ftp":
86
+            import tempfile
87
+            f = tempfile.NamedTemporaryFile("w", delete=False)
88
+            tmp_file = f.name
89
+        else:  # Parasts fails
80
             try:
90
             try:
81
                 f = open(self.streams_file, "w")
91
                 f = open(self.streams_file, "w")
82
             except Exception as e:
92
             except Exception as e:
83
                 raise Exception("Can not open streams file %s" % self.streams_file)
93
                 raise Exception("Can not open streams file %s" % self.streams_file)
84
-            for l in self.lists.keys():
85
-                f.write("[%s]\n"%l)
86
-                t = self.get_title(l)
87
-                if t<>l:
88
-                    f.write("%s\n"%t)
89
-                for item in self.lists[l]:
90
-                    f.write("%s|%s|%s|%s\n"%(item[0].replace("\n",""),item[1],item[2],item[3].replace("\n","\\n")))
91
-                f.write("\n")
92
-            f.close()
94
+
95
+        for l in self.lists.keys():
96
+            f.write("[%s]\n"%l)
97
+            t = self.get_title(l)
98
+            if t<>l:
99
+                f.write("%s\n"%t)
100
+            for item in self.lists[l]:
101
+                f.write("%s|%s|%s|%s\n"%(item[0].replace("\n",""),item[1],item[2],item[3].replace("\n","\\n")))
102
+            f.write("\n")
103
+        f.close()
104
+
105
+        if mode == "ftp":
106
+            import ftplib, urlparse
107
+            p = urlparse.urlparse(self.streams_file)
108
+            try:
109
+                ftp = ftplib.FTP(p.hostname)
110
+                ftp.login(p.username, p.password)
111
+                ftp.storbinary("STOR "+p.path, open(tmp_file, "r"))
112
+                ftp.close()
113
+            except Exception as e:
114
+                print e.message
115
+
116
+
93
 
117
 
94
     def get_lists(self):
118
     def get_lists(self):
95
         return self.lists.keys()
119
         return self.lists.keys()
126
 
150
 
127
 
151
 
128
 if __name__ == "__main__":
152
 if __name__ == "__main__":
153
+
154
+    source = Source(cfg_file="ftp://user:Kaskade7@home.blue.lv/hdd/streams.cfg")
155
+    source.read_streams()
156
+    source.write_streams()
157
+    import sys
129
     sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
158
     sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
130
     import run
159
     import run
131
     source = Source()
160
     source = Source()