Commit f6e0e5f8 authored by sumpfralle's avatar sumpfralle

moved "setproctitle" to pycam.Utils


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@737 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 088f08ab
......@@ -36,12 +36,11 @@ import pycam.Importers
import pycam.Exporters.GCodeExporter
import pycam.Toolpath.Generator
import pycam.Utils.threading
import pycam.Utils
from pycam.Toolpath import Bounds, Toolpath
from pycam import VERSION
import pycam.Utils.log
from optparse import OptionParser
# setproctitle is (optionally) imported later
#import setproctitle
import logging
import time
......@@ -139,11 +138,7 @@ def get_output_handler(destination):
def execute(opts, args, pycam):
# try to change the process name
try:
import setproctitle
setproctitle.setproctitle("pycam")
except ImportError:
pass
pycam.Utils.setproctitle("pycam")
if len(args) > 0:
inputfile = os.path.expanduser(args[0])
......@@ -591,6 +586,7 @@ if __name__ == "__main__":
+ "This program is required for importing SVG files.")
(opts, args) = parser.parse_args()
try:
if opts.profile_destination:
import cProfile
cProfile.run('execute(opts, args, pycam)', opts.profile_destination)
......@@ -598,5 +594,7 @@ if __name__ == "__main__":
# We need to add the parameter "pycam" to avoid weeeeird namespace
# issues. Any idea how to fix this?
execute(opts, args, pycam)
except KeyboardInterrupt:
log.info("Quit requested")
pycam.Utils.threading.cleanup()
......@@ -27,6 +27,13 @@ import os
#import win32com
#import win32api
# setproctitle is (optionally) imported
try:
from setproctitle import setproctitle
except ImportError:
# silently ignore name change requests
setproctitle = lambda name: None
def get_external_program_location(key):
extensions = ["", ".exe"]
......
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