Re: Barcodes

2009-08-24 Thread Chris Withers
Ronn Ross wrote: I found this library, but no documentation(https://cybernetics.hudora.biz/projects/wiki/huBarcode). Has anyone used this or know of a similar library with better documentation? Yup, reportlab has really good barcode generation stuff. I use it to generate labels with barcode

inconsistent sitecustomize.py importing...

2009-08-25 Thread Chris Withers
Hi All, Give this sitecustomize.py: print "ping" ...and this script: #!/usr/local/bin/python2.5 print "pong!" ...both in ~/folder, I would expect the output from: ~$./folder/script ...to be: ping pong ...but sitecustomize.py is not imported :-( If I do: ~$/usr/local/bin/python2.5 folder

Even more inconsistent sitecustomize.py importing with PYTHONPATH rolled in...

2009-08-25 Thread Chris Withers
Chris Withers wrote: However, if I do: ~/folder$/usr/local/bin/python2.5 script ...sitecustomize.py IS imported! However, the following doesn't import sitecustomize.py: ~/folder$ ./script While the following DOES import sitecustomize.py: ~/folder$ export PYTHONPATH= ~/folder$ ./s

Re: Even more inconsistent sitecustomize.py importing with PYTHONPATH rolled in...

2009-08-25 Thread Chris Withers
Chris Withers wrote: Bizarrely, none of the following import sitecustomize.py: ~$ export PYTHONPATH=~/folder ~$ ./script ~$ export PYTHONPATH=~/folder/ ~$ ./script ~$ export PYTHONPATH=~/folder ~/folder$ ./script ~$ export PYTHONPATH=~/folder/ ~/folder$ ./script Okay, brain fail on my part

Re: why python got less developers ?

2009-08-27 Thread Chris Withers
Esam Qanadeely wrote: .NET= i meant all .NET languages What? You mean like Python? ;-) Google IronPython ya troll... Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: An iteration idiom (Was: Re: [Guppy-pe-list] loading files containing multiple dumps)

2009-09-03 Thread Chris Withers
Raymond Hettinger wrote: In the first case, you would write: sets.extend(h.load(f)) yes, what I had was: for s in iter(h.load(f)): sets.append(s) ...which I mistakenly thought was working, but in in fact boils down to Raymond's code. The problem is that each item that h.load(f) returns

TestFixtures 1.6.1 released!

2009-09-06 Thread Chris Withers
Hi All, I'm pleased to announce a new release of TestFixtures. This package is a collection of helpers and mock objects that are useful when writing unit tests or doc tests. This release sees the following changes: - @replace and Replacer.replace can now replace attributes that may not be p

xlutils 1.4.1 released!

2009-09-06 Thread Chris Withers
Hi All, I'm pleased to announce a new release of xlutils. This package is a small collection of utilities that make use of both xlrd and xlwt to process Microsoft Excel files. This release includes memory and speed enhancements for xlutils.filter and xlutils.copy. To find out more, please

Re: zip a huge file into multiple small ones

2009-09-07 Thread Chris Withers
krishna chaitanya wrote: I am new to dealing with zip files in python. I have a huge file which i need to zip and send as an attachment through email. My email restrictions are not allowing me to send it in one go. Is there a way to split this file into multiple zip files, so that i can mail t

Re: httplib incredibly slow :-(

2009-09-07 Thread Chris Withers
Dieter Maurer wrote: Chris Withers writes on Thu, 13 Aug 2009 08:20:37 +0100: ... I've already established that the file downloads in seconds with [something else], so I'd like to understand why python isn't doing the same and fix the problem... A profile might help to unde

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-07 Thread Chris Withers
Sverker Nilsson wrote: I hope the new loadall method as I wrote about before will resolve this. def loadall(self,f): ''' Generates all objects from an open file f or a file named f''' if isinstance(f,basestring): f=open(f) while True: yield self.load(f) It would be

uses for setup.cfg and extracting data from it

2009-09-09 Thread Chris Withers
Hi All, Do people generally source control their package's setup.cfg? http://docs.python.org/distutils/configfile.html sort of implies it should be editable by the person installing the package, but I've never personally used a package where that's the case... Assuming the distutils docs are

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-09 Thread Chris Withers
Sverker Nilsson wrote: But I don't think I would want to risk breaking someone's code just for this when we could just add a new method. I don't think anyone will be relying on StopIteration being raised. If you're worried, do the next release as a 0.10.0 release and explain the backwards inco

Re: Some issue with easy_install and PIL/Imaging

2009-09-11 Thread Chris Withers
Klein Stéphane wrote: Resume : 1. first question : why PIL package in "pypi" don't work ? Because Fred Lundh have his package distributions unfortunate names that setuptools doesn't like... 2. second question : when I add PIL dependence in my setup.py and I do "python setup.py develop",

Re:

2009-09-11 Thread Chris Withers
open...@hushmail.com wrote: fs = cgi.FieldStorage() url = fs.getvalue('url', "http://www.openlayers.org";) try: insert a "print url" here... y = urllib2.urlopen(url) print y.read() This script produces the "failed')>". This is a name lookup failing, whatever you're ending up with

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-11 Thread Chris Withers
Sverker Nilsson wrote: If you just use heap(), and only want total memory not relative to a reference point, you can just use hpy() directly. So rather than: CASE 1: h=hpy() h.heap().dump(...) #other code, the data internal to h is still around h.heap().dump(...) you'd do: CASE 2: hpy().heap

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Chris Withers
John Nagle wrote: That's a wrapper for Antigrain ("http://www.antigrain.com/";), which is a C++ library. I'm trying hard to avoid dependencies on binary libraries with limited support. Builds exist only for Python 2.4 and 2.5. Huh? Matplotlib is a pretty phenomenal charting library, I use

Re: Looking for a pure Python chart drawing module

2009-09-18 Thread Chris Withers
Grant Edwards wrote: On 2009-09-16, Alan G Isaac wrote: Tkinter is part of the Python standard library: That doesn't mean you can depend on it being available. It doesn't get installed by default on some Linux distros. That's 'cos some linux distros feel the need to destroy python's pack

Re: recommendation for webapp testing?

2009-09-18 Thread Chris Withers
Simon Brunning wrote: Mechanize is a superb library for its intended purpose - I use it all the time. It's lack of support for pages with JavaScript functionality, though, means it's not very useful at a testing tool for modern web sites. There's also zope.testbrowser, which is a handy wrapper

Re: How do I begin debugging a python memory leak?

2009-09-18 Thread Chris Withers
Matthew Wilson wrote: I have a web app based on TurboGears 1.0. In the last few days, as traffic and usage has picked up, I noticed that the app went from using 4% of my total memory all the way up to 50%. I suspect I'm loading data from the database and somehow preventing garbage collection.

TestFixtures 1.6.2 released!

2009-09-23 Thread Chris Withers
Hi All, I'm pleased to announce a new release of TestFixtures. This package is a collection of helpers and mock objects that are useful when writing unit tests or doc tests. This release fixes problems when using Comparison objects with instances of Django models, so tests like the following wi

problems trying to build python 2.6 as a shared library

2009-09-25 Thread Chris Withers
Hi All, I'm trying to build Python 2.6 as a shared library, so I did: ./configure --enable-shared make make altinstall No obvious signs of failure, but when I try and use the resulting python, I get: python2.6: error while loading shared libraries: libpython2.6.so.1.0: cannot open sha

problems compiling pyscopg2 on RHEL4

2009-09-25 Thread Chris Withers
Hi All, I installed the following rpms: postgresql-libs-7.4.19-1.el4_6.1 postgresql-devel-7.4.19-1.el4_6.1 postgresql-7.4.19-1.el4_6.1 And then installed psycopg2 as follows: wget http://initd.org/pub/software/psycopg/psycopg2-2.0.12.tar.gz tar xzf psycopg2-2.0.12.tar.gz cd psycopg2-2.0.12 pyt

bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-26 Thread Chris Withers
Hi All, From the docs of pkgutils.walk_packages: """ 'onerror' is a function which gets called with one argument (the name of the package which was being imported) if any exception occurs while trying to import a package. If no onerror function is supplied, ImportErrors are caugh

Re: bug? pkgutil.walk_packages returns packages that result in an ImportError

2010-08-30 Thread Chris Withers
Peter Otten wrote: My expectation of this is that if onerrors is left as None, names yielded will be importable. I would infer no such promise, especially as the generator also yields modules, and no attempt at all is made to import those. Really? I thought the __import__ fired over everythi

Re: Fw: sendmail error

2010-08-31 Thread Chris Withers
Alexander Kapps wrote: Instead you want something like: except smtplib.SMTPException, msg print "eroare: " + msg Err, that's still concatenating a string and an exception object. What *would* work is: except smtplib.SMTPException, msg print "eroare: " + str(msg) ...not that it's pa

Re: sendmail error

2010-08-31 Thread Chris Withers
Thomas Jollans wrote: I struggle to imagine what one might do to a piece of code to garble it this badly. You viewed the text/plain part of his message, the text/html part showed the code almost correctly, complete with pasted-from-IDE colour formatting ;-) Chris -- Simplistix - Content Man

business date and calendar libraries?

2010-09-13 Thread Chris Withers
Hi All, I'm wondering what libraries people would use to answer the following questions relating to business days: - on a naive level; "what's give me the last business day" (ie: skipping weekends) - on a less-naive level; same question but taking into account public holidays - on a horr

os.path.normcase rationale?

2010-09-15 Thread Chris Withers
Hi All, I'm curious as to why, with a file called "Foo.txt" os.path.normcase('FoO.txt') will return "foo.txt" rather than "Foo.txt"? Yes, I know the behaviour is documented, but I'm wondering if anyone can remember the rationale for that behaviour? cheers, Chris -- Simplistix - Content Ma

Re: sqlalchemy: how to define association object with declarative style?

2010-09-20 Thread Chris Withers
Hi Jerry, For SQLAlchemy questions, you're better off asking on sqlalch...@googlegroups.com. On 07/09/2010 10:39, Jerry Fleming wrote: class GroupUser(DeclarativeBase, Tablename, TimestampMixin): id = Column(Integer, Sequence('group_user_id_seq'), primary_key=True) user = Column(Int

Re: os.path.normcase rationale?

2010-09-20 Thread Chris Withers
On 15/09/2010 22:12, Ben Finney wrote: Chris Withers writes: I'm curious as to why, with a file called "Foo.txt" os.path.normcase('FoO.txt') will return "foo.txt" rather than "Foo.txt"? What kind of answer are you looking for? A direct

Re: os.path.normcase rationale?

2010-09-20 Thread Chris Withers
On 16/09/2010 00:14, Gregory Ewing wrote: Ben Finney wrote: it doesn't matter what the case is, so there's no need for anything more complex than all lowercase. Also doing what was suggested would require looking at what's in the file system, which would be a lot of bother to go to for no good

Re: os.path.normcase rationale?

2010-09-20 Thread Chris Withers
On 17/09/2010 03:35, Nobody wrote: os.path.normcase(path) Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward slash

Re: os.path.normcase rationale?

2010-09-24 Thread Chris Withers
On 21/09/2010 01:02, Steven D'Aprano wrote: On Mon, 20 Sep 2010 19:45:37 +0100, Chris Withers wrote: Well, no, that doesn't feel right. Normalisation of case, for me, means "give me the case as the filesystem thinks it should be", What do you mean "the files

Re: Distributing Packages

2010-09-24 Thread Chris Withers
On 23/09/2010 16:41, Greg Lindstrom wrote: I am not intending to start anything, here, but would like to know if any consensus has been reached in how to distribute Python modules. Hi Greg, The following shows a pattern that's working well for me: https://secure.simplistix.co.uk/svn/Simplisti

Checker 1.4 Released!

2010-09-26 Thread Chris Withers
I'm pleased to announce a new release of Checker. This is a cross-platform, pluggable tool for comparing the configuration of a machine with a known configuration stored in text files in a source control system all written in Python. This release adds a 'command' checker that lets you record and

Re: help!!!

2010-10-06 Thread Chris Withers
On 06/10/2010 05:28, Dennis Lee Bieber wrote: On Tue, 05 Oct 2010 23:54:00 -0400, declaimed the following in gmane.comp.python.general: plz can u convert this cpp file into python i need that badly as soon as possible... I am new to python. I just wanna learn it Step one... DON'T

ConFoo spam?

2010-10-07 Thread Chris Withers
Hi All, Is it just me or does the mailing of just about every single python-based project mailing list with a 90% form email advertising a conference that only has one python track *and* clashes with PyCon feel just a bit like spam? I know it's enough to put me off even considering going to

Re: add bitbucket repo url to install_requires

2010-10-08 Thread Chris Withers
On 05/10/2010 12:43, Julian wrote: I'm developing a django app which depends on an app in a private bitbucket repository, for example ssh://h...@bitbucket.org/username/my-django-app. is it possible to add this url to the list of install_requires in my setup.py? tried various possibilities, but n

Re: logging.handlers.SMTPHandler and fileConfig

2010-10-11 Thread Chris Withers
On 11/10/2010 15:52, pstatham wrote: I'm trying to use pythons logging.handlers.SMTPHandler with a configuration file (so that I don't have to have passwords etc. inside of the script) Use MailingLogger and ZConfig ;-) http://groups.google.com/group/simplistix/browse_thread/thread/f4223c3a92e9

Sybil 1.0.0 Released!

2017-05-26 Thread Chris Withers
Hi All, I'm pleased to announce the first release of Sybil, a library to help you test the examples in your documents. For example, given the following Sphinx source file: Sample Documentation Let's put something in the Sybil document's namespace: .. inv

Re: Sybil 1.0.0 Released!

2017-05-30 Thread Chris Withers
On 27/05/2017 00:56, Skip Montanaro wrote: On Fri, May 26, 2017 at 2:34 AM, Chris Withers mailto:ch...@simplistix.co.uk>> wrote: The package is on PyPI and a full list of all the links to docs, issue trackers and the like can be found here: https://github.com/cjw96/sybil

Sybil 1.0.1 Released!

2017-05-30 Thread Chris Withers
Hi All, I'm pleased to announce a new release of Sybil, a library to help you test the examples in your documentation. This release fixes a bug where unicode and byte literals weren't corrected in doctest tracebacks, event when FIX_BYTE_UNICODE_REPR was specified. The package is on PyPI and

testfixtures 5.0.0 released!

2017-06-05 Thread Chris Withers
Hi All, I'm pleased to announce the release of testfixtures 5.0.0 featuring the following: * Move fromnose topytest for running tests. * Switch frommanuel tosybil

testfixtures 5.1.0 released!

2017-06-08 Thread Chris Withers
Hi All, I'm pleased to announce the release of testfixtures 5.1.0 featuring the following: * Added support for including non-editable fields to the|comparer|used by|compare()|when comparing/django/|Model|instances. The package is on PyPI and a full list of all the links to docs, issue tr

xlrd 1.1.0 and xlwt 1.3.0 released!

2017-08-21 Thread Chris Withers
Hi All, I'm pleased to announce the release of xlrd 1.1.0 and xlwt 1.3.0. Please consult their change logs on readthedocs.org to see what's new. As before, I will be upfront and say you should no longer be using these unless libraries unless you have a particular need to work with .xls file

<    1   2   3   4