Added ability to specify urls for all files.
This commit is contained in:
parent
d343d3d70f
commit
cc508621f1
2 changed files with 6 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
'''Command line module for web2exe.'''
|
'''Command line module for web2exe.'''
|
||||||
|
|
||||||
__version__ = "v0.2.4b"
|
__version__ = "v0.2.5b"
|
||||||
|
|
||||||
from utils import zip_files, join_files, log, get_temp_dir
|
from utils import zip_files, join_files, log, get_temp_dir
|
||||||
from pycns import save_icns
|
from pycns import save_icns
|
||||||
|
|
|
||||||
6
main.py
6
main.py
|
|
@ -6,6 +6,7 @@ import glob
|
||||||
import sys
|
import sys
|
||||||
import codecs
|
import codecs
|
||||||
import platform
|
import platform
|
||||||
|
import requests
|
||||||
|
|
||||||
from PySide import QtGui, QtCore
|
from PySide import QtGui, QtCore
|
||||||
from PySide.QtGui import QApplication, QHBoxLayout, QVBoxLayout
|
from PySide.QtGui import QApplication, QHBoxLayout, QVBoxLayout
|
||||||
|
|
@ -20,6 +21,9 @@ from utils import get_data_path, get_data_file_path
|
||||||
|
|
||||||
MAX_RECENT = 10
|
MAX_RECENT = 10
|
||||||
|
|
||||||
|
def url_exists(path):
|
||||||
|
r = requests.head(path)
|
||||||
|
return r.status_code == requests.codes.ok
|
||||||
|
|
||||||
class Validator(QtGui.QRegExpValidator):
|
class Validator(QtGui.QRegExpValidator):
|
||||||
def __init__(self, regex, action, parent=None):
|
def __init__(self, regex, action, parent=None):
|
||||||
|
|
@ -337,7 +341,7 @@ class MainWindow(QtGui.QMainWindow, CommandBase):
|
||||||
|
|
||||||
if (setting.type == 'file' and
|
if (setting.type == 'file' and
|
||||||
setting.value and
|
setting.value and
|
||||||
not os.path.exists(setting_path)):
|
(not os.path.exists(setting_path) and not url_exists(setting.value))):
|
||||||
log(setting.value, "does not exist")
|
log(setting.value, "does not exist")
|
||||||
settings_valid = False
|
settings_valid = False
|
||||||
widget = self.find_child_by_name(setting.name)
|
widget = self.find_child_by_name(setting.name)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue