Hello All,

I tried to use MiddleKit, but documented Enum attribute does not work.
This is my first application using Python, Webware and Cheetah. I am
not python guru, but since I wanted my application to start working
I made some changes in my copy of Webware. May be those patches (or
ideas of those patches) will help other ppl to get MiddleKit start
working for them.

BTW, does anybody knows is MiddleKit is still in development?

Best Regards,
       Alex V. Koval

File: Webware/MiscUtils/DataTable.py

Index: DataTable.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiscUtils/DataTable.py,v
retrieving revision 1.16
diff -r1.16 DataTable.py
349a350,377
>                               fixLine2 = 0
>                               if "'" in line:
>                                       # handle quoted values
>                                       inside = 0
>                                       newLine = []
>                                       for i in range(len(line)):
>                                               c = line[i]
>                                               if c=="'":
>                                                       if inside:
>                                                               inside = 0
>                                                       else:
>                                                               inside = 1
>                                                       newLine.append(c)
>                                               elif c==delimiter:
>                                                       if inside:
>                                                               newLine.append('\1')
>                                                       else:
>                                                               newLine.append(c)
>                                               else:
>                                                       newLine.append(c)
>                                       #print '>> newLine =', newLine
>                                       line = join(newLine, '')
>                                       #print '>> line =', line
>                                       fixLine2 = 1
>                               else:
>                                       fixLine2 = 0
> 
>                               #print "splitting line [%s] by delemiter: %s" % 
>(line,delimiter)
359a388,395
>                                               return value
>                                       values = map(fixValue, values)
> 
>                               if fixLine2:
>                                       def fixValue(value, delimiter=delimiter):
>                                               value = replace(value, '\1', delimiter)
>                                               if value[:1] == value[-1:] == '"':
>                                                       value = replace(value[1:-1], 
>"''", "'")

File: MiddleKit/Core/EnumAttr.py
Index: EnumAttr.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Core/EnumAttr.py,v
retrieving revision 1.2
diff -r1.2 EnumAttr.py
2c2
< 
---
> import string
8,9c8,9
<               # We expect than an 'Enums' key holds the enumeration values
<               enums = self['Enums']
---
>               Notes = self['Notes']
>               enums = Notes[string.index( self['Notes'], "'")+1:-1]




_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to