mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#68 state:fixed] Create the appdata folder before trying to create a debug log.
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40179
This commit is contained in:
parent
e3fb879f9f
commit
37abac1401
@ -10,6 +10,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import os.path as op
|
import os.path as op
|
||||||
|
|
||||||
from PyQt4.QtCore import Qt, QTimer, QObject, QCoreApplication, QUrl, SIGNAL
|
from PyQt4.QtCore import Qt, QTimer, QObject, QCoreApplication, QUrl, SIGNAL
|
||||||
@ -56,6 +57,8 @@ class DupeGuru(DupeGuruBase, QObject):
|
|||||||
|
|
||||||
def __init__(self, data_module, appid):
|
def __init__(self, data_module, appid):
|
||||||
appdata = unicode(QDesktopServices.storageLocation(QDesktopServices.DataLocation))
|
appdata = unicode(QDesktopServices.storageLocation(QDesktopServices.DataLocation))
|
||||||
|
if not op.exists(appdata):
|
||||||
|
os.makedirs(appdata)
|
||||||
# For basicConfig() to work, we have to be sure that no logging has taken place before this call.
|
# For basicConfig() to work, we have to be sure that no logging has taken place before this call.
|
||||||
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
|
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
|
||||||
DupeGuruBase.__init__(self, data_module, appdata, appid)
|
DupeGuruBase.__init__(self, data_module, appdata, appid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user