Commit a5107bd1 authored by sumpfralle's avatar sumpfralle

silenced GtkWarnings in non-debug mode (aimed at older GTK releases)

fixed typo

git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@985 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 060770ee
...@@ -48,8 +48,11 @@ from pycam import VERSION ...@@ -48,8 +48,11 @@ from pycam import VERSION
import pycam.Utils.log import pycam.Utils.log
from optparse import OptionParser from optparse import OptionParser
import socket import socket
import warnings
import logging import logging
import time import time
# we need to import gtk.Warning to silence these warnings later
#import gtk
# we need the multiprocessing exception for remote connections # we need the multiprocessing exception for remote connections
try: try:
...@@ -174,6 +177,15 @@ def execute(parser, opts, args, pycam): ...@@ -174,6 +177,15 @@ def execute(parser, opts, args, pycam):
log.setLevel(logging.WARNING) log.setLevel(logging.WARNING)
# disable the progress bar # disable the progress bar
opts.progress = "none" opts.progress = "none"
# silence all warnings
warnings.filterwarnings("ignore")
else:
# silence gtk warnings
try:
import gtk
warnings.filterwarnings("ignore", category=gtk.Warning)
except ImportError:
pass
# show version and exit # show version and exit
if opts.show_version: if opts.show_version:
...@@ -435,9 +447,7 @@ if __name__ == "__main__": ...@@ -435,9 +447,7 @@ if __name__ == "__main__":
+ "the '--export-?' parameters will cause PyCAM to start " \ + "the '--export-?' parameters will cause PyCAM to start " \
+ "in batch mode. Most parameters are useful only for " \ + "in batch mode. Most parameters are useful only for " \
+ "batch mode.", + "batch mode.",
epilog="Take a look at the wiki for more information: " \ epilog="PyCAM website: http://pycam.sf.net")
+ "http://sourceforge.net/apps/mediawiki/pycam/.\nBug reports" \
+ ": http://sf.net/tracker/?group_id=237831&atid=1104176")
group_general = parser.add_option_group("General options") group_general = parser.add_option_group("General options")
group_export = parser.add_option_group("Export formats", group_export = parser.add_option_group("Export formats",
"Export the resulting toolpath or meta-data in various formats. " \ "Export the resulting toolpath or meta-data in various formats. " \
......
...@@ -57,7 +57,7 @@ def get_platform(): ...@@ -57,7 +57,7 @@ def get_platform():
def open_url(uri): def open_url(uri):
if (get_platform() == "PLATFORM_WINDOWS") and (uri[1:3] == ":\\"): if (get_platform() == PLATFORM_WINDOWS) and (uri[1:3] == ":\\"):
# We are on Windows and a local path is given. Open the file # We are on Windows and a local path is given. Open the file
# normally. Otherwise "C:\\" is misinterpreted as a protocol. # normally. Otherwise "C:\\" is misinterpreted as a protocol.
return open(uri) return open(uri)
......
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