Bug fix: Logviewer got broke by ostools

This commit is contained in:
Kiooeht 2011-08-16 00:56:54 -07:00
parent 9d8c5501a1
commit 491e5d73c3
2 changed files with 3 additions and 2 deletions

View file

@ -8,6 +8,8 @@ from generic import RightClickList, RightClickTree
from parsetools import convertTags
from convo import PesterText
_datadir = ostools.getDataDir()
class PesterLogSearchInput(QtGui.QLineEdit):
def __init__(self, theme, parent=None):
QtGui.QLineEdit.__init__(self, parent)
@ -124,7 +126,6 @@ class PesterLogUserSelect(QtGui.QDialog):
@QtCore.pyqtSlot()
def openDir(self):
if ostools.isOSX():
_datadir = ostools.getDataDir()
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + os.path.join(_datadir, "logs"), QtCore.QUrl.TolerantMode))
else:
QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + os.path.join(os.getcwd(), "logs"), QtCore.QUrl.TolerantMode))

View file

@ -51,7 +51,7 @@ if not ((major > 4) or (major == 4 and minor >= 6)):
_datadir = ostools.getDataDir()
# See, what I've done here is that _datadir is '' if we're not on OSX, so the
# concatination is the same as if it wasn't there.
if not os.path.exists(_datadir):
if _datadir and not os.path.exists(_datadir):
os.mkdir(_datadir)
if not os.path.exists(_datadir+"profiles"):
os.mkdir(_datadir+"profiles")