Browse Source

Fix icon path

doc-issue-template
MrS0m30n3 10 years ago
parent
commit
27399e5321
2 changed files with 14 additions and 29 deletions
  1. 20
      youtube_dl_gui/Utils.py
  2. 23
      youtube_dl_gui/YoutubeDLGUI.py

20
youtube_dl_gui/Utils.py

@ -48,21 +48,23 @@ def get_path_seperator():
def fix_path(path):
if path != '' and path[-1:] != get_path_seperator():
path += get_path_seperator()
return path
def get_HOME():
return os.path.expanduser("~")
def add_PATH(path):
os.environ["PATH"] += os.pathsep + path
def abs_path(path):
path_list = path.split(get_path_seperator())
for i in range(len(path_list)):
if path_list[i] == '~':
path_list[i] = get_HOME()
return get_path_seperator().join(path_list)
def get_HOME():
return os.path.expanduser("~")
def add_PATH(path):
os.environ["PATH"] += os.pathsep + path
def abs_path(filename):
path = os.path.abspath(filename).split(get_path_seperator())
path.pop()
return get_path_seperator().join(path)
def file_exist(filename):
return os.path.exists(filename)

23
youtube_dl_gui/YoutubeDLGUI.py

@ -1,22 +1,5 @@
#! /usr/bin/env python
'''
This file contains all gui classes
MainFrame
Custom wx.ListCtrl class
OptionsFrame
GeneralPanel
AudioPanel
ConnectionPanel
VideoPanel
FilesystemPanel
SubtitlesPanel
OtherPanel
UpdatePanel
AuthenticationPanel
PlaylistPanel
'''
import wx
from wx.lib.pubsub import setuparg1
from wx.lib.pubsub import pub as Publisher
@ -79,7 +62,7 @@ LANGUAGES = ["English",
"Spanish",
"German"]
ICON = 'icons/youtube-dl-gui.png'
ICON = fix_path(abs_path(__file__))+'icons/youtube-dl-gui.png'
class MainFrame(wx.Frame):
@ -479,7 +462,7 @@ class UpdatePanel(wx.Panel):
self.autoUpdateChk.SetValue(self.optList.autoUpdate)
def save_options(self):
self.optList.updatePath = abs_path(self.updatePathBox.GetValue())
self.optList.updatePath = fix_path(self.updatePathBox.GetValue())
self.optList.autoUpdate = self.autoUpdateChk.GetValue()
class PlaylistPanel(wx.Panel):
@ -1145,7 +1128,7 @@ class GeneralPanel(wx.Panel):
self.savePathBox.SetValue(self.optList.savePath)
def save_options(self):
self.optList.savePath = abs_path(self.savePathBox.GetValue())
self.optList.savePath = fix_path(self.savePathBox.GetValue())
class OtherPanel(wx.Panel):

Loading…
Cancel
Save