Vladimir Kolev avatar Vladimir Kolev committed 4c083c2

Settings are now saved in $HOME/.gsharkdown to fix the problem with permissions

Comments (0)

Files changed (3)

data/gsharkdown.ini

-down_path = ""
-show_stat_icon = 0
-repeat_playlist = 0
-shuffle_playlist = 0
-show_notification = 0
-update_checked = 1
-completition = Roni Size|Eminem|Madonna|Skillet|DMX|Dr. Dre|Ceca|Ceca Velickovic|Syrenia|Within temptation|Lady Gaga|EMinem|Beatles|Scorpions|Deep Purple|Na Inat|Foureira|
Add a comment to this file

data/playlist.pkl

Empty file removed.

 
 BASEPATH = os.path.abspath(os.path.dirname(sys.argv[0]))
 
-CONFIG = ConfigObj("%s/data/gsharkdown.ini" % BASEPATH)
+CONFIG = ConfigObj("%s/.gsharkdown/gsharkdown.ini" % os.environ.get("HOME"))
 
 
 class SharkDown:
         self.staticon.connect("activate", self.icon_clicked)
         self.staticon.set_tooltip("gSharkDown : Download from Grooveshark")
 
-        if os.path.exists("%s/data/playlist.pkl" % BASEPATH):
+        if os.path.exists("%s/.gsharkdown/playlist.pkl" % os.environ.get("HOME")):
             self.load_saved_playlist()
         else:
             print "Playlist not found"
         self.window.show_all()
 
     def load_saved_playlist(self):
-        file = open("%s/data/playlist.pkl" % BASEPATH, 'rb')
+        file = open("%s/.gsharkdown/playlist.pkl" % os.environ.get("HOME"),
+                    'rb')
         eoferror = True
         while eoferror:
             try:
         response = dialog.run()
         if response == gtk.RESPONSE_YES:
             try:
-                output = open("%s/data/playlist.pkl" % BASEPATH, 'w')
+                output = open("%s/.gsharkdown/playlist.pkl" % os.environ.get("HOME"),
+                              'w')
                 for i in range(0, len(self.playitems)):
                     pickle.dump(self.playitems[i], output)
                 output.close()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.