summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2011-01-05 15:07:15 -0500
committerLuke Macken <lmacken@redhat.com>2011-01-05 15:07:15 -0500
commit37e88fcbf0e581b4bd1d7ceb81d5423495ae3bb6 (patch)
tree59b2e0c427cca5eab201e32a4cef318c58c68ced
parent964b788e07771d6e0d0a2644dd13e9b8af102525 (diff)
Download releases to the Downloads folder by default.
For Windows XP users, it will save it to 'My Documents'.
-rwxr-xr-xliveusb/gui.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/liveusb/gui.py b/liveusb/gui.py
index c0380c3..a820c64 100755
--- a/liveusb/gui.py
+++ b/liveusb/gui.py
@@ -27,6 +27,7 @@ A cross-platform graphical interface for the LiveUSBCreator
import os
import sys
import logging
+import urlparse
from time import sleep
from datetime import datetime
@@ -78,6 +79,12 @@ class ReleaseDownloader(QtCore.QThread):
self.emit(QtCore.SIGNAL("status(PyQt_PyObject)"),
_("Downloading %s..." % os.path.basename(self.url)))
grabber = URLGrabber(progress_obj=self.progress, proxies=self.proxies)
+ home = os.getenv('HOME', 'USERPROFILE')
+ filename = os.path.basename(urlparse.urlparse(self.url).path)
+ for folder in ('Downloads', 'My Documents'):
+ if os.path.isdir(os.path.join(home, folder)):
+ filename = os.path.join(home, folder, filename)
+ break
try:
iso = grabber.urlgrab(self.url, reget='simple')
except URLGrabError, e: