Added ability to specify urls for all files.

This commit is contained in:
Joey Payne 2015-09-18 14:33:20 -06:00
commit cc508621f1
2 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,6 @@
'''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 pycns import save_icns

View file

@ -6,6 +6,7 @@ import glob
import sys
import codecs
import platform
import requests
from PySide import QtGui, QtCore
from PySide.QtGui import QApplication, QHBoxLayout, QVBoxLayout
@ -20,6 +21,9 @@ from utils import get_data_path, get_data_file_path
MAX_RECENT = 10
def url_exists(path):
r = requests.head(path)
return r.status_code == requests.codes.ok
class Validator(QtGui.QRegExpValidator):
def __init__(self, regex, action, parent=None):
@ -337,7 +341,7 @@ class MainWindow(QtGui.QMainWindow, CommandBase):
if (setting.type == 'file' 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")
settings_valid = False
widget = self.find_child_by_name(setting.name)