Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ ⎇ branch:  streamtuner2


Check-in [ee1b2744a1]

Overview
Comment:Alternate "rt" and "r" gzopen file flag (the "t" is an addition of Python3 gzip, and failed with Python2 on Windows)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ee1b2744a147b464235be61031d8b45c1688bd9b
User & Date: mario on 2016-11-06 18:52:37
Other Links: manifest | tags
Context
2016-11-06
18:53
Remove newstation_ok/_cancel signal symbols. check-in: 045ec7be83 user: mario tags: trunk
18:52
Alternate "rt" and "r" gzopen file flag (the "t" is an addition of Python3 gzip, and failed with Python2 on Windows) check-in: ee1b2744a1 user: mario tags: trunk
18:51
Fix misnamed row{} reference. check-in: d2925011aa user: mario tags: trunk
Changes

Modified config.py from [e6c70b9373] to [1120420e80].

39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
39
40
41
42
43
44
45

46
47
48
49
50
51
52
53







-
+







from __future__ import print_function
import os
import sys
import json
import gzip
import platform
import re
from compat2and3 import gzip_decode, find_executable
from compat2and3 import gzip_decode, find_executable, PY2, PY3
import zlib
import zipfile
import inspect
import pkgutil
import argparse
from pluginconf import plugin_meta, module_list, get_data
import pluginconf
146
147
148
149
150
151
152

153
154
155
156
157
158
159
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160







+







        self.auto_save_appstate = 1
        self.auto_save_stations = 0
        self.reuse_m3u = 1
        self.playlist_asis = 0
        self.window_title = 0
        self.google_homepage = 0
        self.windows = platform.system()=="Windows"
        self.open_mode = "r" if self.windows and PY2 else "rt"
        self.pyquery = 1
        self.debug = 0

    # update old setting names
    def migrate(self):
        # 2.1.1
        if "audio/mp3" in self.play:
235
236
237
238
239
240
241
242

243
244

245
246
247
248
249
250
251
236
237
238
239
240
241
242

243
244

245
246
247
248
249
250
251
252







-
+

-
+







    # retrieve data from config file            
    def load(self, name):
        name = name + ".json"
        file = self.dir + "/" + name
        try:
            # .gz or normal file
            if os.path.exists(file + ".gz"):
                f = gzip.open(file + ".gz", "rt")
                f = gzip.open(file + ".gz", self.open_mode)
            elif os.path.exists(file):
                f = open(file, "rt")
                f = open(file, self.open_mode)
            else:
                return # file not found
            # decode
            r = json.load(f)
            f.close()
            return r
        except Exception as e: