.txt
or .html
at the end of the URL to specify the output format - the default is HTML.
Sporadic off the cuff remarks about software development, group dynamics and the requisite "anything else on my mind"
.txt
or .html
at the end of the URL to specify the output format - the default is HTML.
By the way, a cool trick that I picked up somewhere is to register an account at http://www.cjb.net. You pick a subdomain of cjb.net (like joeblow.cjb.net) and then they redirect any email that goes to@joeblow.cjb.net to an email address of your choosing. So what I do is I have ilowe.cjb.net and every time I sign up somewhere, I give an address that encodes the name of the site I am registering on (for example yahoo-groups@ilowe.cjb.net). This has two benefits: first, I don't have to give out my real email address; second, if somebody starts spamming me using one of the addresses, I just add a filter to my mail client to kill that particular address and continue along my merry way. That way I don't have dozens of sites pointing to one "junk" email address that I need to log into every once in a while to clean out.
site-packages
folder. Once this is done, fire up a hex editor and edit each of the DLLs that are installed in the libsvn
package and replace all instances of the string python23.dll
with the string python24.dll
. That's all there is to it.
typecheck
v0.2.0 released
typecheck
module to the Python Package Index. The module's website has been updated to reflect the new version number and link to the newest build but has not yet been modified to document the changed interface after the merge with Collin's code. He tagged the 0.2.0 version yesterday so we still need to catch up on a couple of minor documentation points.typecheck
and
and or
). Look for version 0.2.0 in your local Cheeseshop RSS Feed.
html2text
right now but a lot of entries with embedded HTML come out looking pretty weird. I'll post the script once I clean up the text generation.vTodo
objects to a vCalendar stream and it works just fine.rdate
property is what controls repeating tasks/events - not any of the other ones that purportedly serve the same purpose.
Could you eliminate the need for the text member variable by usingstr(elt)
instead? Or would that interfere with usingstr
to return the XML representation for the whole element?
str
and repr
so that the former would be a shortcut to return the text
property and the latter would return the XML representation of the element.print
or interpolate the element its string value will be used. There is also a nice parallel with the way nodes are handled in XPath.text
property in order to continue to support the oodles of screaming fans who have already shipped billion-dollar projects based on my little library.mystic
yesterday. We wanted to install Python 2.4 with subversion, trac and apache 2. It took a fair bit of wrangling (i.e. building from source) to get everything working together after which Justin realised that we hadn't upgraded to Sarge (duh!). He rebuilt everything using the latest packages and it looks OK so far.sites-available
/sites-enabled
organization is nicely architected, it does make for some pretty painful contortions when performing wholesale changes on a group of virtual hosts. For example, we started off testing the new installation of Apache 2.x on port 81 (which required that we split out the vhost declarations into files of their own) and then proceeded to switch it to port 80 (which ended up requiring a quick cat
/sed
/re-direct combination). Without a good knowledge of shell scripts or some scripting language this would have been really painful.dump
ed it and load
ed it onto mystic
. It seems that I did something wrong because it load
ed in Berkeley DB mode. All that is fixed now and taken care of.root.title
as opposed to root('title')
. More complex queries, however, reveal the power of XPath: compare [x for x in root.head.children if x.localname == 'style']
to root('head//style')
to retrieve all style
elements of an HTML document. Or even root('//p')
to retrieve all the paragraphs.parse
function until I add a try/except
for that exception.
startElementNS
method on a SAX ContentHandler
is not necessarily passed the QName of the element. The name is passed as a URI/element name tuple, but the QName is not mandatory unless the feature_namespace_prefixes
feature is enabled. The following code shows how to do this:
from xml.sax.handler import feature_namespaces, feature_namespace_prefixes
from xml.sax import make_parser
contentHandler = MyContentHandler()
parser = make_parser()
# Perform namespace processing
parser.setFeature(feature_namespaces, True)
# Report original prefixed names (i.e. qname is passed to startElementNS)
parser.setFeature(feature_namespace_prefixes, True)
parser.setContentHandler(contentHandler)
parser.parse(inputSource)
children
attribute should not contain descendants. It never really did but since YAXL Element
s are represented as XML fragments, it may have seemed that way.
>>> import yaxl
>>> x = yaxl.Element('x')
>>> x.append('y').append('z').append('w')
<w />
>>> x.children
[<y><z><w /></z></y>]
z
and w
elements are returned as part of children
but they are just part of the XML fragment that y
outputs.child::*
and get back a list of immediate children.
Element
objects. Currently only attribute-value and node/node-set selections are supported. Also, only the following axes are allowed in queries: self
, parent
, ancestor
, ancestor-or-self
, child
, descendant
, descendant-or-self
select
on an instance of Element
or you can call an instance of Element
and supply the XPath as the only parameter.
doctest
tests within typechecked functions.func_globals
object is the same object as the function's module's __dict__
property. This is not true of any decorated function where the decorator is defined outside the module the function is defined in.typecheck.doctest
module allows you to bypass the check that doctest usually uses and replaces it with a much more liberal one that just verifies that a function's __module__
property is the same as the name of the module in which the function is defined.