112 |
|
os.unlink (filename) |
113 |
|
except IOError: |
114 |
|
# TODO: this should be a warning. |
115 |
< |
print "File %s does not exists. Will be created." % filename |
115 |
> |
g_Logger.trace ("File %s does not exists. Will be created." % filename) |
116 |
|
|
117 |
|
open (filename, 'w').write (str (os.getpid ())) |
118 |
|
self.context.addService (CmdLineArgs (self.context.OptionParser ())) |
210 |
|
type="int") |
211 |
|
|
212 |
|
def run (self): |
213 |
+ |
if "--help" in sys.argv: |
214 |
+ |
g_Logger.detailLevel = -100 |
215 |
|
validOptions = getValidOptions (sys.argv) |
216 |
|
|
217 |
|
opts, args = self.parser.parse_args (args=validOptions) |
218 |
< |
|
218 |
> |
|
219 |
|
g_Logger.stream = opts.logFile |
220 |
< |
g_Logger.detailLevel = opts.logLevel |
220 |
> |
if "--help" not in sys.argv: |
221 |
> |
g_Logger.detailLevel = opts.logLevel |
222 |
|
|
223 |
|
if not len (args): |
224 |
|
args = ["start"] |
226 |
|
factory = CommandFactory (self.context, opts, args) |
227 |
|
startCommand = factory.createByName (args[0]) |
228 |
|
if not startCommand: |
229 |
< |
print "Command %s not known." % args[0] |
229 |
> |
"Command %s not known." % args[0] |
230 |
|
sys.exit (1) |
231 |
|
startCommand.run () |
232 |
|
startCommand.finish () |