ANN: Version 0.1.1 of sarge (a subprocess wrapper library) has been released.

2013-06-04 Thread Vinay Sajip
it out. The project is hosted on BitBucket at https://bitbucket.org/vinay.sajip/sarge/ And you can leave feedback on the issue tracker there. I hope you find Sarge useful! Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.3.4) of the Python module which wraps GnuPG has been released.

2013-06-05 Thread Vinay Sajip
>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified = gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' For more information, visit http://code.google.com/p/python-gnupg/ - as always, your feedback is most welcome (especially bug reports, patches and suggestions for improvement). Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. -- http://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.3.1) of the Python module which wraps GnuPG has been released.

2012-09-01 Thread Vinay Sajip
PGP MESSAGE-\nVersion: GnuPG v1.4.9 (GNU/Linux)\n \nhQIOA/6NHMDTXUwcEAf ... -END PGP MESSAGE-\n' >>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, wo

Re: Logging handler: No output

2012-09-02 Thread Vinay Sajip
ltiple messages. The rule of thumb is: most code should get loggers and log to them, but adding handlers, setting levels etc. should be only done in one place (typically invoked from a "if __name__ == '__main__'" clause. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Logging: Specifying converter attribute of a log formatter in config file

2012-09-16 Thread Vinay Sajip
On Thursday, August 30, 2012 11:38:27 AM UTC+1, Radha Krishna Srimanthula wrote: > > Now, how do I specify the converter attribute (time.gmtime) in the above > section? Sadly, there is no way of doing this using the configuration file, other than having e.g. a class UTCFormatter(logging.Format

Re: Getting a TimedRotatingFileHandler not to put two dates in the same file?

2012-10-24 Thread Vinay Sajip
t a bug, and so it'll see the light of day in Python 3.4, if at all. An implementation is in my sandbox repo at http://hg.python.org/sandbox/vsajip in branch fix9556. If all you need to do is rollover at a different time daily (say 7 a.m.), you might be able to use this. Feel free to use that code as inspiration for your subclass. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Specifying two log files with one configuration file

2013-01-08 Thread Vinay Sajip
'test', and propagate: 0 prevents the test message from being passed up to the root logger. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.3.2) of the Python module which wraps GnuPG has been released.

2013-01-17 Thread Vinay Sajip
HMDTXUwcEAf ... -END PGP MESSAGE-\n' >>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified =

A new script which creates Python 3.3 venvs with Distribute and pip installed in them

2013-01-30 Thread Vinay Sajip
n run the script with -h to see the command line options available, which are a superset of the pyvenv script. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: A new script which creates Python 3.3 venvs with Distribute and pip installed in them

2013-01-30 Thread Vinay Sajip
elopment documentation: http://docs.python.org/3/library/venv.html#an-example-of-extending-envbuilder Doing it in Python means that it runs cross-platform, offers a few benefits such as command line help, or the option to install Distribute but not pip. Regards, Vinay Sajip -- http://mail.pytho

Re: Python launcher (PEP 397) and emacs python-mode.el

2013-01-31 Thread Vinay Sajip
shebang line of #!/usr/bin/python3.2, and on Windows it will still call the appropriate Python 3.2 even if it's not in /usr/bin, as there's no /usr/bin :-)) Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: python logging filter limitation, looks intentional?

2012-01-29 Thread Vinay Sajip
nvolve another hierarchy traversal and additional calls to the ancestor filters. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonWin debugger holds onto global logging objects too long

2012-02-06 Thread Vinay Sajip
cript that I ran in PythonWin didn't show any problems, so you'll probably need to post a short script which demonstrates the problem when run in PythonWin. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-11 Thread Vinay Sajip
tBucket at https://bitbucket.org/vinay.sajip/sarge/ And you can leave feedback on the issue tracker there. I hope you find Sarge useful! Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-12 Thread Vinay Sajip
but unless a real show-stopper occurs, there's not much to be gained by throwing up our hands. BTW extproc is nice, but I wanted to push the envelope a little :-) Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-12 Thread Vinay Sajip
file handles map to other handles or streams; I feel that using a Capture instance is less fiddly for the user. Let a thousand flowers bloom, and all that. I do thank you for the time you've taken to make these comments, and I found the reading you pointed me to interesting. I will update

Re: ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-12 Thread Vinay Sajip
rtable with, and to avoid things that make them uncomfortable. I'm not pushing the async feature as a major advantage of the library - it's still useful without that, IMO. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-13 Thread Vinay Sajip
sh('ls >>> abc') /bin/sh: Syntax error: redirection unexpected '' If you're saying there might be bugs in the parser, that's something else - I'll address those as and when they turn up. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-13 Thread Vinay Sajip
#x27;ll only do that if you pass "a & b & c & d" to sarge, and not otherwise. The other use of threads by sarge - to read output streams from child processes - is no different from the stdlib usage of threads in subprocess.Popen.communicate(). Possibly Rick was objecting to the ton

Re: re module: Nothing to repeat, but no sre_constants.error: nothing to repeat ?

2012-02-14 Thread Vinay Sajip
it is > equivalent. It does not fail to compile. > > Why the inconsistency? What's going on here? > > -- Devin $ is a meta character for regular expressions. Use '\$*', which does compile. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Sarge, a library wrapping the subprocess module, has been released.

2012-02-17 Thread Vinay Sajip
t meant supporting Unicode literals via "from __future__ import unicode_literals". I'm stuck on 2.5 with other projects, so I share your pain :-( Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTP logging

2012-02-20 Thread Vinay Sajip
set logging.raiseExceptions to True (in which case all logging exceptions will be swallowed - not necessarily what he wants). Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: HTTP logging

2012-02-20 Thread Vinay Sajip
On Feb 20, 5:47 pm, Vinay Sajip wrote: > I will reinstate it in the reference API docs, but the answer to > Jason's problem is to either subclass HTTPHandler and override > handleError to suppress the error, or set logging.raiseExceptions to > True (in which case all logging e

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-21 Thread Vinay Sajip
. In the stdlib, only StreamHandler and its subclasses actually implement flush(), which flushes I/O buffers to disk. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Vinay Sajip
otherwise, please give some examples of potential problems and with example code if possible. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Vinay Sajip
the > same > buffer. Shouldn't the access be synchronized? Yes, you might well be right - though no problems have been reported, it's probably best to be safe. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Vinay Sajip
On Feb 23, 5:55 pm, Fayaz Yusuf Khan wrote: > buffer. Shouldn't the access be synchronized? I've now updated the repos for 2.7, 3.2 and default to add locking for flush/close operations. Thanks for the suggestion. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

PEP 414 has been accepted

2012-02-27 Thread Vinay Sajip
e idea is to make porting code from 2.x to 3.x easier than before. Get porting! Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Error with co_filename when loading modules from zip file

2012-03-05 Thread Vinay Sajip
de the .zip. If you delete all .pyc files and only have .py in the .zip, what happens? Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Error with co_filename when loading modules from zip file

2012-03-06 Thread Vinay Sajip
fix would be not in the logging package, but in the module loading machinery (as mentioned on that issue). I wouldn't worry about the performance aspect - once the logging package is loaded, there's no performance impact. That's a tiny one- off hit which you will probably not notice a

Re: Help me with weird logging problem

2012-03-06 Thread Vinay Sajip
test will it be passed to the handlers (which will also perform level tests). So, a logger.setLevel(logging.DEBUG) should be all you need to add before logging anything. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.2.9) of the Python module which wraps GnuPG has been released.

2012-03-30 Thread Vinay Sajip
sphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified = gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' For more information, visit http://code.google.com/p/python-gnupg/ - as always, your feedback is most welcome (especially bug reports, patches and suggestions for improvement). Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading Live Output from a Subprocess

2012-04-06 Thread Vinay Sajip
, with documentation at [2] and source code at [3]. It's intended for your use case, works with both Python 2.x and 3.x, and is tested on Linux, OS X and Windows. Disclosure: I'm the maintainer. Regards, Vinay Sajip [1] http://pypi.python.org/pypi/sarge/0.1 [2] http://sarge.readthedocs.org/en/latest/ [3] https://bitbucket.org/vinay.sajip/sarge/ -- http://mail.python.org/mailman/listinfo/python-list

Possible change to logging.handlers.SysLogHandler

2012-04-06 Thread Vinay Sajip
ed as objectionable. Regards, Vinay Sajip [1] http://bugs.python.org/issue14452 [2] http://bugs.python.org/issue7077 [3] http://bugs.python.org/issue8795 -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing & Logging

2012-04-07 Thread Vinay Sajip
re configured for a particular logger. I will try to update the Cookbook in the logging docs with this approach, and a working script. Background information is available here: [1][2] Regards, Vinay Sajip [1] http://plumberjack.blogspot.co.uk/2010/09/using-logging-with-multiprocessing.htm

Re: Multiprocessing & Logging

2012-04-07 Thread Vinay Sajip
.getLogger(record.name) logger.handle(record) And then instantiate the QueueListener with an instance of DelegatingHandler. QueueListener doesn't need actual logging handlers, just something with a handle method which takes a record. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing & Logging

2012-04-07 Thread Vinay Sajip
cookbook example should show once the docs get built on docs.python.org. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible change to logging.handlers.SysLogHandler

2012-04-16 Thread Vinay Sajip
Vinay Sajip yahoo.co.uk> writes: > I am thinking of removing the BOM insertion in 2.7 and 3.2 - although > it is a change in behaviour, the current behaviour does seem broken > with regard to RFC 5424 conformance. However, as some might disagree > with that assessment and view it

Re: Wish: Allow all log Handlers to accept the level argument

2012-05-29 Thread Vinay Sajip
ded much of the time. The code above won't do any more or less than if you hadn't bothered to set the level on the handler. Don't forget, more complex configurations are effected even more simply using dictConfig(). Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Permission denied and lock issue with multiprocess logging

2011-06-12 Thread Vinay Sajip
s nothing to do with logging - it's related to semaphore behaviour in the presence of fork(), which of course happens in multiprocessing scenarios. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Improper creating of logger instances or a Memory Leak?

2011-06-19 Thread Vinay Sajip
pplication; typically, a module, or perhaps some part of a module. If you want to include information in the log to see what different threads are doing, do that using the information provided here: http://docs.python.org/howto/logging-cookbook.html#adding-contextual-information-to-your-logging-outpu

Re: Improper creating of logger instances or a Memory Leak?

2011-06-19 Thread Vinay Sajip
foobar gmail.com> writes: > > I've run across a memory leak in a long running process which I can't > determine if its my issue or if its the logger. > BTW did you also ask this question on Stack Overflow? I've answered there, too. http://stackoverflow.com/quest

Re: Improper creating of logger instances or a Memory Leak?

2011-06-20 Thread Vinay Sajip
ctly what you want to do, but there's certainly no need to create one *logger* per thread. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: String concatenation vs. string formatting

2011-07-09 Thread Vinay Sajip
logspot.com/2010/10/supporting-alternative-formatting.html Also by the way - Python doesn't say there shouldn't be more than one way to do things - just that there should be one *obvious* way (from the Zen of Python). Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: String concatenation vs. string formatting

2011-07-10 Thread Vinay Sajip
Andrew Berg gmail.com> writes: > How would I do that with the newer formatting? I've tried: There are examples in the blog post I linked to earlier: http://plumberjack.blogspot.com/2010/10/supporting-alternative-formatting.html Regards, Vinay Sajip -- http://mail.python.

Re: String concatenation vs. string formatting

2011-07-10 Thread Vinay Sajip
Andrew Berg gmail.com> writes: > On 2011.07.10 02:23 AM, Vinay Sajip wrote: > > There are examples in the blog post I linked to earlier: > It seems that would require logutils. I'm trying to keep dependencies to > a minimum in my project, but I'll take a look at l

Re: Help me understand this logging config

2011-09-02 Thread Vinay Sajip
x27;Info') 2011-09-02 10:51:13,445 INFO djfront.auth.facebook Info >>> ... as expected. Since it's Python 2.6, it should be using the dictconfig which ships with Django 1.3. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me understand this logging config

2011-09-02 Thread Vinay Sajip
nse" for more information. (InteractiveConsole) >>> import logging >>> logger = logging.getLogger('djfront.auth.facebook') >>> logger.debug('Debug') >>> logger.info('Info') 2011-09-02 10:51:13,445 INFO djfront.auth.facebook Inf

Re: Help me understand this logging config

2011-09-02 Thread Vinay Sajip
nse" for more information. (InteractiveConsole) >>> import logging >>> logger = logging.getLogger('djfront.auth.facebook') >>> logger.debug('Debug') >>> logger.info('Info') 2011-09-02 10:51:13,445 INFO djfront.auth.facebook Inf

ANN: A new version (0.2.8) of the Python module which wraps GnuPG has been released.

2011-09-02 Thread Vinay Sajip
sphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified = gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' For more information, visit http://code.google.com/p/python-gnupg/ - as always, your feedback is most welcome (especially bug reports, patches and suggestions for improvement). Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. -- http://mail.python.org/mailman/listinfo/python-list

Re: Making `logging.basicConfig` log to *both* `sys.stderr` and `sys.stdout`?

2011-09-02 Thread Vinay Sajip
ort passing a list of handlers to basicConfig(): see http://plumberjack.blogspot.com/2011/04/added-functionality-for-basicconfig-in.html which will allow you to do what you want quite easily. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing class name causes process to 'hang'

2011-03-14 Thread Vinay Sajip
on 2.7 to use the standard logging package - that's been available since Python 2.3. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging and PyQt4

2011-03-15 Thread Vinay Sajip
ather than Qt's. To direct logging output to a GUI, it would be appropriate to develop a Qt/PyQt-aware handler class (derived from logging.Handler) to do the Qt interfacing. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging module usage

2011-03-31 Thread Vinay Sajip
andler to the root logger of your top-level package, which you should. I see you're using Python 2.x, but you may nevertheless find it useful to look at the logging docs for Python 3.2. These have been split into reference docs and HOWTOs, rather than the somewhat monolithic approach taken in the 2.x docs. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.2.7) of the Python module which wraps GnuPG has been released.

2011-04-10 Thread Vinay Sajip
inux)\n \nhQIOA/6NHMDTXUwcEAf ... -END PGP MESSAGE-\n' >>> decrypted = gpg.decrypt(str(encrypted), passphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='se

Re: Two similar logging programs but different ouputs

2011-04-18 Thread Vinay Sajip
ted). Hence only logger1's message is printed. NullHandler is a handler which does nothing - there is no point in adding it to a system which configures logging, and only any point in adding it to top-level loggers of libraries which may be used when logging is configured (also documented). Regard

Re: Two similar logging programs but different ouputs

2011-04-18 Thread Vinay Sajip
cation (this is also documented). Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Two similar logging programs but different ouputs

2011-04-19 Thread Vinay Sajip
m glad you brought these points up, they do highlight an area where the documentation could be clearer. I'll get on it. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: unpickling derived LogRecord in python 2.7 from python2.6

2011-04-27 Thread Vinay Sajip
SocketHandler pickles the LogRecord's __dict__ rather than the LogRecord itself, precisely because of the improved interoperability over pickling the instance directly. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Have you read the Python docs lately?

2011-04-28 Thread Vinay Sajip
on early drafts, which were put together initially for the 3.2 release. If anyone has any other improvements to suggest, keep 'em coming! Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: A suggestion for an easy logger

2011-05-07 Thread Vinay Sajip
spite other logging libraries claiming to be more Pythonic, they have pretty much the same concepts as stdlib logging - because those concepts are tied to logging, not to Java. Call it correlation vs. causation, or convergent evolution, or what you will. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: A suggestion for an easy logger

2011-05-08 Thread Vinay Sajip
ly, for earlier Python versions, you'd need to subclass and override StreamHandler.emit() to get equivalent functionality :-( Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: A suggestion for an easy logger

2011-05-08 Thread Vinay Sajip
hing like sh = logging.StreamHandler(sys.stdout) sh.terminator = '' logging.getLogger().addHandler(sh) but be sure to execute this code one time only, or you will get multiple identical messages for a single logging call. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: A suggestion for an easy logger

2011-05-09 Thread Vinay Sajip
On May 9, 3:53 pm, TheSaint wrote: > Vinay Sajip wrote: > >logging.basicConfig(level=logging.DEBUG, format='%(message)s') > > logging.basicConfig(format='%(message)s', level=logging.DEBUG) > > I formulated in the reverse order of arguments, may that ca

Re: python logging

2011-05-18 Thread Vinay Sajip
ndler to the root logger, if no other handlers have been configured for the root logger. In Python 3.2 and later, if no handlers have been configured, messages at level WARNING and greater will be printed to sys.stderr using a "handler of last resort" - see http://docs.python.or

Re: python logging

2011-05-19 Thread Vinay Sajip
(see para starting "PLEASE NOTE:") and http://docs.python.org/howto/logging.html#advanced-logging-tutorial (search for "If you call the functions") This is not a behaviour change - it's been like this since logging appeared in Python, see http://hg.python.org/cpython/annotate/f72b1f8684a2/Lib/logging/__init__.py#l1145 Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Class decorators might also be super too

2011-05-29 Thread Vinay Sajip
On May 29, 7:33 am, Michele Simionato wrote: > He is basically showing that using mixins for implementingloggingis not such > a good idea, I don't think he was particularly advocating implementing logging this way, but rather just using logging for illustrative purposes. Regards,

Re: How to prevent logging warning?

2005-10-05 Thread Vinay Sajip
on what's wrong? (It's a rhetorical question - the answer is of course quite subjective). Certainly, I could change things so that e.g. the error is suppressed when logging.raiseExceptions is set to 0 (typically for production use). Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent logging warning?

2005-10-05 Thread Vinay Sajip
s/without/with/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent logging warning?

2005-10-06 Thread Vinay Sajip
erest in it. In fact you're the first person to ask! It generates a few extra entries in the config file which are used by the utility only, which are seemingly regarded as "cruft" by most people. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple logger

2005-10-07 Thread Vinay Sajip
handler a simple (non-rotating) file handler to the root logger. See the documentation for more information. Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: Controlling exception handling of logging module

2005-10-19 Thread Vinay Sajip
sj wrote: > Thanks, but my point wasn't fixing the bug. I'd like the logging > module to raise an exception on this occasion (rather than print and > consume the error) so that I can find the bug easily. If those two > lines were part of 10,000-line code, I'd have to check all logging > statemen

Re: How to prevent logging warning?

2005-10-25 Thread Vinay Sajip
gards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Perhaps so, but the logging module seems like such an unpythonic beast to > me. How about cleaning it up (*) before we add more to it? Stuff like > colorizing seems like it belongs in its own module (presuming a reasonably > general markup scheme can be agreed upon) so

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > >> - It's a package, but contrary to any other package I've ever seen, > >> most of its functionality is implemented in __init__.py. > > Trent> I'm not defending the implementation, but does this cause any > Trent> particular problems? > > No, it just seems

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
Trent Mick wrote: > Yah. It was added before Guido more clearly stated that he thought > modules should have a successful life outside the core before being > accepted in the stdlib. Perhaps so, but Guido was also quite keen to get PEP-282 implemented for inclusion in 2.3, and pronounced on the c

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Since the logging package currently uses mixedCase it would appear it > shouldn't revert to lower_case. I'm thinking it should have probably used > lower_case from the start though. I see no real reason to have maintained > compatibility with log4j. Similarly, I think

Re: improvements for the logging package

2005-09-13 Thread Vinay Sajip
Thomas Heller wrote: > Yes, it seems so. Although I would have expected the documentation to > inform me about incompatible changes in the api. It does, in the "in-development" version of the documentation. Sorry it was not in the 2.4 releases :-( http://www.python.org/dev/doc/devel/lib/minimal

Re: logging into one file problem

2005-09-13 Thread Vinay Sajip
Maksim Kasimov wrote: [Example snipped] Will the following do what you want? Don't add handlers in each module. Just add a handler to the root logger in the main script. Thus: module1.py: import logging logger = logging.getLogger('module1') #now use the logger in your code module2.py: import l

Re: NTEventLogHandler not logging `info'?

2005-09-22 Thread Vinay Sajip
Jaime Wyant wrote: > This code doesn't seem to do what I think it should do: > > # python 2.3.2 > # not sure of my win32 extensions version > > import logging > from logging.handlers import NTEventLogHandler > logger = logging.getLogger("testlogger") > handler = NTEventLogHandler("testlogger") > lo

Re: NTEventLogHandler not logging `info'?

2005-09-22 Thread Vinay Sajip
Jaime Wyant wrote: > I must be missing something. This is what I read from the documentation: > > When a logger is created, the level is set to NOTSET (which causes all > messages to be processed in the root logger, or delegation to the > parent in non-root loggers). > The documentation could be c

Re: unicode encoding usablilty problem

2005-02-25 Thread Vinay Sajip
n a stream opened using codecs.open to StreamHandler. Not quite as friendly, I'll grant you. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Re: SysLogHandler is drivin me nuts PEBCAC

2004-11-30 Thread Vinay Sajip
Jan Dries <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's > keyboard and not ceyboard? > PEBCAC: Problem Exists Between Chair And Computer -- http://mail.python.org/mailman/listinfo/python-list

Re: RotatingFileHandler

2004-12-03 Thread Vinay Sajip
tingFileHandler(filename,'a',2000,4) formatter = logging.Formatter() logFile.setFormatter(formatter) ...then you can call emit. Of course, you should not normally be calling emit() from user code. The correct approach is to log events to loggers, and not emit them to handlers directly. Best r

Re: File locking and logging

2004-12-03 Thread Vinay Sajip
ns log via a SocketHandler to a designated node, where you run a server process which locally logs to file events received across the network. There is a working example of this in the Python 2.4 docs. Best regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging from severl classes

2004-12-27 Thread Vinay Sajip
It works for me: #file3.py import file1 import file2 a = file1.A() b = file2.B() b.otherfunction() gives 2004-12-28 00:18:34,805 DEBUG file2 6 creating class B 2004-12-28 00:18:34,805 DEBUG file2 9 in otherfunction -- http://mail.python.org/mailman/listinfo/python-list

Re: RotatingFileHandler and logging config file

2005-03-20 Thread Vinay Sajip
onstructor arguments) is performed. BTW - constructor is not just for Java, but C++ too (not to mention C#). Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: I'm just an idiot when it comes logging

2005-03-23 Thread Vinay Sajip
ld. Since you haven't done this, you will see an INFO message appear even though the root logger's level is set to ERROR. (This would only affect logging calls to the root logger). Rule of thumb: Set levels on handlers only when you need them, not as common practice. If you don'

Re: logging problems

2005-04-29 Thread Vinay Sajip
rter tries to log a message. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list

Re: __del__ and logging

2005-04-29 Thread Vinay Sajip
ndicate in the logger file that > the instance had closed ok. > It all depends. If your __del__ is being called via atexit() for application cleanup, for example, logging may not be available to you because it has been cleaned up beforehand. The logging module registers an atexit() handl

ANN: Version 0.1.2 of sarge (a subprocess wrapper library) has been released.

2013-12-17 Thread Vinay Sajip
e's a lot more information, with examples, than I can put into this post. You can install Sarge using "pip install sarge" to try it out. The project is hosted on BitBucket at https://bitbucket.org/vinay.sajip/sarge/ And you can leave feedback on the issue tracker there. I hope you find Sarge useful! Regards, Vinay Sajip -- https://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.3.6) of python-gnupg has been released.

2014-02-06 Thread Vinay Sajip
ecrypt(str(encrypted), passphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified = gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' For more information, visit http://code.google.com/p/python-gnupg/ - as always, your feedback is most welcome (especially bug reports, patches and suggestions for improvement). Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. -- https://mail.python.org/mailman/listinfo/python-list

ANN: distlib 0.2.2 released on PyPI

2016-01-31 Thread Vinay Sajip
at files. A more detailed change log is available at [2]. Please try it out, and if you find any problems or have any suggestions for improvements, please give some feedback using the issue tracker! [3] Regards, Vinay Sajip [1] https://pypi.python.org/pypi/distlib/0.2.2 [2] https://goo.gl/M

ANN: A new version (0.3.7) of python-gnupg has been released.

2014-12-07 Thread Vinay Sajip
exporting keys. This addition was inadvertently left out   of 0.3.6. This release [2] has been signed with my code signing key: Vinay Sajip (CODE SIGNING KEY) Fingerprint: CA74 9061 914E AC13 8E66 EADB 9147 B477 339A 9B86 What Does It Do? The gnupg module allows Python programs to ma

[ANN]: distlib 0.2.0 released on PyPI

2014-12-17 Thread Vinay Sajip
, and if you find any problems or have any suggestions for improvements, please give some feedback using the issue tracker! [3] Regards, Vinay Sajip [1] https://pypi.python.org/pypi/distlib/0.2.0 [2] http://pythonhosted.org/distlib/overview.html#change-log-for-distlib [3] https://bitbucket.org

ANN: Version 0.1.4 of sarge (a subprocess wrapper library) has been released.

2015-01-24 Thread Vinay Sajip
es, than I can put into this post. You can install Sarge using "pip install sarge" to try it out. The project is hosted on BitBucket at https://bitbucket.org/vinay.sajip/sarge/ And you can leave feedback on the issue tracker there. I hope you find Sarge useful! Regards, Vinay Sajip -- https://mail.python.org/mailman/listinfo/python-list

[ANN]: distlib 0.1.8 released on PyPI

2014-03-19 Thread Vinay Sajip
lease try it out, and if you find any problems or have any suggestions for improvements, please give some feedback using the issue tracker! [3] Regards, Vinay Sajip [1] https://pypi.python.org/pypi/distlib/0.1.8  [2] http://pythonhosted.org/distlib/overview.html#change-log-for-distlib  [3]

[ANN]: distlib 0.1.9 released on PyPI

2014-05-19 Thread Vinay Sajip
give some feedback using the issue tracker! [3] Regards, Vinay Sajip [1] https://pypi.python.org/pypi/distlib/0.1.9 [2] http://pythonhosted.org/distlib/overview.html#change-log-for-distlib [3] https://bitbucket.org/pypa/distlib/issues/new -- https://mail.python.org/mailman/listinfo/python-list

ANN: A new version (0.3.5) of python-gnupg has been released.

2013-08-30 Thread Vinay Sajip
t; decrypted = gpg.decrypt(str(encrypted), passphrase='secret') >>> str(decrypted) 'Hello, world!' >>> signed = gpg.sign("Goodbye, world!", passphrase='secret') >>> verified = gpg.verify(str(signed)) >>> print "Verified" if verified else "Not verified" 'Verified' For more information, visit http://code.google.com/p/python-gnupg/ - as always, your feedback is most welcome (especially bug reports, patches and suggestions for improvement). Enjoy! Cheers Vinay Sajip Red Dove Consultants Ltd. -- http://mail.python.org/mailman/listinfo/python-list

ANN: distlib 0.2.1 released on PyPI

2015-07-08 Thread Vinay Sajip
cased value.     Handled multiple-architecture wheel filenames correctly. A more detailed change log is available at [2]. Please try it out, and if you find any problems or have any suggestions for improvements, please give some feedback using the issue tracker! [3] Regards, Vinay Sajip [1]

  1   2   3   4   >