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): def fix_path(path):
if path != '' and path[-1:] != get_path_seperator(): if path != '' and path[-1:] != get_path_seperator():
path += 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()) path_list = path.split(get_path_seperator())
for i in range(len(path_list)): for i in range(len(path_list)):
if path_list[i] == '~': if path_list[i] == '~':
path_list[i] = get_HOME() path_list[i] = get_HOME()
return get_path_seperator().join(path_list) 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): def file_exist(filename):
return os.path.exists(filename) return os.path.exists(filename)

23
youtube_dl_gui/YoutubeDLGUI.py

@ -1,22 +1,5 @@
#! /usr/bin/env python #! /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 import wx
from wx.lib.pubsub import setuparg1 from wx.lib.pubsub import setuparg1
from wx.lib.pubsub import pub as Publisher from wx.lib.pubsub import pub as Publisher
@ -79,7 +62,7 @@ LANGUAGES = ["English",
"Spanish", "Spanish",
"German"] "German"]
ICON = 'icons/youtube-dl-gui.png'
ICON = fix_path(abs_path(__file__))+'icons/youtube-dl-gui.png'
class MainFrame(wx.Frame): class MainFrame(wx.Frame):
@ -479,7 +462,7 @@ class UpdatePanel(wx.Panel):
self.autoUpdateChk.SetValue(self.optList.autoUpdate) self.autoUpdateChk.SetValue(self.optList.autoUpdate)
def save_options(self): 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() self.optList.autoUpdate = self.autoUpdateChk.GetValue()
class PlaylistPanel(wx.Panel): class PlaylistPanel(wx.Panel):
@ -1145,7 +1128,7 @@ class GeneralPanel(wx.Panel):
self.savePathBox.SetValue(self.optList.savePath) self.savePathBox.SetValue(self.optList.savePath)
def save_options(self): def save_options(self):
self.optList.savePath = abs_path(self.savePathBox.GetValue())
self.optList.savePath = fix_path(self.savePathBox.GetValue())
class OtherPanel(wx.Panel): class OtherPanel(wx.Panel):

Loading…
Cancel
Save