Commit 2b6a3934 authored by sumpfralle's avatar sumpfralle

fixed url parsing for Windows

improved multiprocessing log messages


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@979 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 8b515f61
...@@ -57,6 +57,11 @@ def get_platform(): ...@@ -57,6 +57,11 @@ def get_platform():
def open_url(uri): def open_url(uri):
if (get_platform() == "PLATFORM_WINDOWS") and (uri[1:3] == ":\\"):
# We are on Windows and a local path is given. Open the file
# normally. Otherwise "C:\\" is misinterpreted as a protocol.
return open(uri)
else:
return urllib.urlopen(uri) return urllib.urlopen(uri)
def check_uri_exists(uri): def check_uri_exists(uri):
......
...@@ -161,17 +161,16 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None, ...@@ -161,17 +161,16 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None,
# server mode is disabled for the Windows pyinstaller standalone # server mode is disabled for the Windows pyinstaller standalone
# due to "pickle errors". How to reproduce: run the standalone binary # due to "pickle errors". How to reproduce: run the standalone binary
# with "--enable-server --server-auth-key foo". # with "--enable-server --server-auth-key foo".
server_mode_unavailable = "Server mode is not available for " \ feature_matrix_text = "Take a look at the wiki for a matrix of " + \
+ "the Windows standalone executable. Please use the " \ "platforms and available features: " + \
+ "installer package instead (if possible)." "http://sf.net/apps/mediawiki/pycam/?title=" + \
"Parallel_Processing_on_different_Platforms"
if enable_server: if enable_server:
log.warn("Unable to enable server mode with the Windows " \ log.warn("Unable to enable server mode with your current " + \
+ "standalone executable. " \ "setup.\n" + feature_matrix_text)
+ server_mode_unavailable)
elif run_server: elif run_server:
log.warn("Unable to run in server-only mode with the Windows " \ log.warn("Unable to run in server-only mode with the Windows " + \
+ "standalone executable. " \ "standalone executable.\n" + feature_matrix_text)
+ server_mode_unavailable)
else: else:
# no further warnings required # no further warnings required
pass pass
...@@ -187,7 +186,7 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None, ...@@ -187,7 +186,7 @@ def init_threading(number_of_processes=None, enable_server=False, remote=None,
# causes "WindowsError: invalid handle" error messages. The processes # causes "WindowsError: invalid handle" error messages. The processes
# can't communicate - thus no results are returned. # can't communicate - thus no results are returned.
# Reproduce with: "--number-of-processes 2" # Reproduce with: "--number-of-processes 2"
log.warn("Multiprocessing capabilities are not available for the " \ log.info("Multiprocessing capabilities are not available for the " \
+ "Windows standable executable. Use the installer package " \ + "Windows standable executable. Use the installer package " \
+ "instead (if possible).") + "instead (if possible).")
mp_is_available = False mp_is_available = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment