root/livinglogic.python.xist/src/ll/xist/utils.py @ 3144:e69dbe6b271b

Revision 3144:e69dbe6b271b, 0.7 KB (checked in by Walter Doerwald <walter@…>, 12 years ago)

Fix parser bug. Fix .h file problem. Handle xmlns attribute in pool. Simplify URLAttr/PI interaction.

When parsing attributes that had an empty value, where drop. This is fixed
now.

distutils has dropped helpers.h from the source distributions. Fix this by
renaming the file to helpers_include.c.

Registerung module in a Pool object, now copies the xmlns attribute too (if it
exists and is a string).

"Fancy" URL attributes will now no longer be transformed in any way when
publishing.

Line 
1# -*- coding: utf-8 -*-
2
3## Copyright 1999-2008 by LivingLogic AG, Bayreuth/Germany
4## Copyright 1999-2008 by Walter Dörwald
5##
6## All Rights Reserved
7##
8## See xist/__init__.py for the license
9
10
11"""
12<p>This module contains several functions and classes,
13that are used internally by &xist;.</p>
14"""
15
16
17from ll import url as url_
18
19import xsc
20
21
22__docformat__ = "xist"
23
24
25def findattr(content, name):
26    startpos = content.find(name)
27    if startpos != -1:
28        startpos = startpos+len(name)
29        while content[startpos].isspace():
30            startpos += 1
31        startpos += 1 # skip '='
32        while content[startpos].isspace():
33            startpos += 1
34        char = content[startpos]
35        startpos += 1
36        endpos = content.find(char, startpos)
37        if endpos != -1:
38            return content[startpos:endpos]
39    return None
Note: See TracBrowser for help on using the browser.