12 import os |
12 import os |
13 import sys |
13 import sys |
14 import shutil |
14 import shutil |
15 import zipfile |
15 import zipfile |
16 import compileall |
16 import compileall |
17 import urllib.parse |
17 try: #Py3 |
|
18 import urllib.parse as parse |
|
19 except (ImportError): |
|
20 import urlparse as parse |
18 |
21 |
19 from PyQt4.QtCore import pyqtSlot, Qt, QDir, QFileInfo |
22 from PyQt4.QtCore import pyqtSlot, Qt, QDir, QFileInfo |
20 from PyQt4.QtGui import QWidget, QDialogButtonBox, QAbstractButton, QApplication, \ |
23 from PyQt4.QtGui import QWidget, QDialogButtonBox, QAbstractButton, QApplication, \ |
21 QDialog, QVBoxLayout |
24 QDialog, QVBoxLayout |
22 |
25 |
245 archive = archiveFilename |
248 archive = archiveFilename |
246 destination = \ |
249 destination = \ |
247 self.destinationCombo.itemData(self.destinationCombo.currentIndex()) |
250 self.destinationCombo.itemData(self.destinationCombo.currentIndex()) |
248 |
251 |
249 # check if archive is a local url |
252 # check if archive is a local url |
250 url = urllib.parse.urlparse(archive) |
253 url = parse.urlparse(archive) |
251 if url[0].lower() == 'file': |
254 if url[0].lower() == 'file': |
252 archive = url[2] |
255 archive = url[2] |
253 |
256 |
254 # check, if the archive exists |
257 # check, if the archive exists |
255 if not os.path.exists(archive): |
258 if not os.path.exists(archive): |