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

⌈⌋ branch:  streamtuner2


Check-in [77d42c82df]

Overview
Comment:Transitional .cache/XDG_DATA_HOME support (by symlinking from .config dir)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:77d42c82dfd9891c57a740ea8d8b077132cdaec8
User & Date: mario on 2019-02-04 09:30:38
Other Links: manifest | tags
Context
2019-02-06
21:16
Switch to XDG_CACHE_HOME/.cache (because that's what the cache files are, not really user data). More consistently use new storage path throughout core and plugins (favicon+cachereset). check-in: 2ee52fe7e8 user: mario tags: trunk
2019-02-04
09:30
Transitional .cache/XDG_DATA_HOME support (by symlinking from .config dir) check-in: 77d42c82df user: mario tags: trunk
2019-01-01
05:52
Remove 0install support. check-in: a89faaac39 user: mario tags: trunk
Changes

Modified config.py from [70c45975f0] to [08e51d1986].

202
203
204
205
206
207
208

209
210
211

212
213
214
215










216
217
218
219
220
221
222
        return players[typ][-1]
    
        
    # http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
    def xdg(self, path="/streamtuner2"):
        home = os.environ.get("HOME", self.tmp)
        config = os.environ.get("XDG_CONFIG_HOME", os.environ.get("APPDATA", home+"/.config"))

        
        # storage dir
        self.dir = config + path

        
        # create if necessary
        if (not os.path.exists(self.dir)):
            os.makedirs(self.dir)










       

    # store some configuration list/dict into a file                
    def save(self, name="settings", data=None, gz=0, nice=0):
        name = name + ".json"
        if (data is None):
            data = vars(self)







>



>




>
>
>
>
>
>
>
>
>
>







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
        return players[typ][-1]
    
        
    # http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
    def xdg(self, path="/streamtuner2"):
        home = os.environ.get("HOME", self.tmp)
        config = os.environ.get("XDG_CONFIG_HOME", os.environ.get("APPDATA", home+"/.config"))
        datadir = os.environ.get("XDG_DATA_HOME", os.environ.get("APPDATA", home+"/.cache"))
        
        # storage dir
        self.dir = config + path
        self.datadir = datadir + path  # not actually used, for now we have subdir symlinks from .config to .cache
        
        # create if necessary
        if (not os.path.exists(self.dir)):
            os.makedirs(self.dir)
        if (not os.path.exists(self.datadir)):
            os.makedirs(self.datadir)
            
        # move/symlink cache files/dirs into datadir
        if not self.windows:
            for source, target in [(self.dir+"/"+sub, self.datadir+"/"+sub) for sub in ["cache", "icons", "themes"]]:
                if os.path.exists(source) and not os.path.exists(target):
                    os.rename(source, target)
                if os.path.exists(target) and not os.path.exists(source):
                    os.symlink(target, source)
       

    # store some configuration list/dict into a file                
    def save(self, name="settings", data=None, gz=0, nice=0):
        name = name + ".json"
        if (data is None):
            data = vars(self)