Re: argparse epilog call function?

2017-06-27 Thread Didymus
On Tuesday, June 27, 2017 at 11:47:42 AM UTC-4, Didymus wrote: > On Tuesday, June 27, 2017 at 9:56:13 AM UTC-4, Didymus wrote: > > Greetings, > > > > I might be barking up the wrong tree, but was wondering if there's a way to > > have the argpasre epi

Re: argparse epilog call function?

2017-06-27 Thread Didymus
On Tuesday, June 27, 2017 at 9:56:13 AM UTC-4, Didymus wrote: > Greetings, > > I might be barking up the wrong tree, but was wondering if there's a way to > have the argpasre epilog call a function. for example: > > epilog=Examples() > > Where Examples is: &g

argparse epilog call function?

2017-06-27 Thread Didymus
Greetings, I might be barking up the wrong tree, but was wondering if there's a way to have the argpasre epilog call a function. for example: epilog=Examples() Where Examples is: def Examples(): text = """Lots of examples""" print(text.format()) I've place this in and found that it pr

pexpect matching?

2015-11-16 Thread Didymus
Greetings, I have the following code: import pexpect child = pexpect.spawn('/bin/bash') i = child.expect_exact('bash-3.2$ ') child.sendline("rpm -q --queryformat '%{VERSION}\\n' glibc") i = child.expect (['2', '2.5', '2.52.5', pexpect.TIMEOUT]) print child.before print '---' print child.af

Re: Logging Custom Levels?

2015-04-01 Thread Didymus
On Tuesday, March 31, 2015 at 1:37:29 PM UTC-4, Jean-Michel Pichavant wrote: > > A solution is pretty simple, do not use an intermediate log function pdebug. > > import logging > PDEBUG_NUM=20 > logging.addLevelName(PDEBUG_NUM, "PDEBUG") > > logger = logging.getLogger('foo') > logging.basicConf

Logging Custom Levels?

2015-03-31 Thread Didymus
Hi, I've create a Python file called "log.py" and placed in the custom levels: # Performance Debug... logging.addLevelName(PDEBUG_NUM, "PDEBUG") def pdebug(self, message, *args, **kws): """ Performance Debug Message Level """ self.log(PDEBUG_NUM, message, *args, **kws) logging.

Re: Logging custom level not print module properly??

2015-03-03 Thread Didymus
On Tuesday, March 3, 2015 at 10:02:02 AM UTC-5, Peter Otten wrote: > Didymus wrote: > > > Hi, > > > > I have setup custom levels (with the help of the Python community) for > > logging. I set this up as a class in a module "log.py" below. The problem >

Logging custom level not print module properly??

2015-03-03 Thread Didymus
Hi, I have setup custom levels (with the help of the Python community) for logging. I set this up as a class in a module "log.py" below. The problem I'm seeing is that no matter the file the the logging is happening in it always prints the module as "log", I've rcreated the testcase below: % p

Re: Logging with Custom Levels not working

2015-02-20 Thread Didymus
On Friday, February 20, 2015 at 4:25:50 AM UTC-5, Ian wrote: > > On Wednesday, February 18, 2015 at 3:16:40 PM UTC-5, Ian wrote: > >> > def perror(self, message, *args, **kws): > >> > """ Performance Error Message Level """ > >> > # Yes, logger takes its '*args' as 'args'. > >> > self._

Re: Logging with Custom Levels not working

2015-02-19 Thread Didymus
On Wednesday, February 18, 2015 at 3:16:40 PM UTC-5, Ian wrote: > > def perror(self, message, *args, **kws): > > """ Performance Error Message Level """ > > # Yes, logger takes its '*args' as 'args'. > > self._log(PERROR_NUM, message, args, **kws) > > > > logging.Logger.perror = perror

Logging with Custom Levels not working

2015-02-18 Thread Didymus
Greetings, I've been setting up a custom logging for a project here and got some great examples of code from stackoverflow. The only problem I'm having is that no matter what I set the log level too all the messages print out... Verbosity Level set to: 55 [PVERBOSE] Performance Verbose Leve

Assignment Operators?

2014-10-02 Thread Didymus
Hi All, I was wondering if someone could explain an assignment operator that I'm seeing in some code. As an example: >>> errors = False >>> errors |= 3 >>> errors 3 >>> errors |= 4 >>> errors 7 The '|=' operator, I read should be like a = a | b, but this appears to add the two numbers a