Re: Parsing text

2009-05-07 Thread Suraj Barkale
iainemsley iainemsley at googlemail.com writes:

 
 Hi,
 I'm trying to write a fairly basic text parser to split up scenes and
 acts in plays to put them into XML. I've managed to get the text split
 into the blocks of scenes and acts and returned correctly but I'm
 trying to refine this and get the relevant scene number when the split
 is made but I keep getting an NoneType error trying to read the block
 inside the for loop and nothing is being returned. I'd be grateful for
 some suggestions as to how to get this working.
 
 for scene in text.split('Scene'):
 num = re.compile(^\s\[0-9, i{1,4}, v], re.I)
 textNum = num.match(scene)
 if textNum:
 print textNum
 else:
 print No scene number
 m = 'div type=scene'
 m += scene
 m += '\div'
 print m
 
 Thanks, Iain
 --
 http://mail.python.org/mailman/listinfo/python-list
 
 

Are you trying to match Roman numerals? As others have said, it is difficult to
make any suggestions without knowing the input to your program.

You may want to look at PyParsing (http://pyparsing.wikispaces.com/) to parse
the text file without messing with regular expressions.

Regards,
Suraj

--
http://mail.python.org/mailman/listinfo/python-list


[issue5897] No library reference tree in chm help file

2009-05-01 Thread Suraj Barkale

New submission from Suraj Barkale suraj+pyt...@barkale.com:

In the windows help file installed with Python 2.6.2, many topics (e.g.
Python Standard Library) are shown are leaf nodes instead of books.
After checking source code, `:numbered:` clause was added to many
index.rst files in revision 71270. The TOC for these files no longer
appears in the CHM viewer.

--
assignee: georg.brandl
components: Documentation
messages: 86892
nosy: georg.brandl, suraj
severity: normal
status: open
title: No library reference tree in chm help file
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5897
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Web framework for embedded system

2009-04-28 Thread Suraj Barkale
Thomas Heller theller at python.net writes:
 
 I'm looking for a lightweight web-framework for an embedded system.
 The system is running a realtime linux-variant on a 200 MHz ARM
 processor, Python reports a performance of around 500 pystones.

You can start with webpy (http://webpy.org/) and build up from there.

 
 The web application will not be too fancy, no databases involved
 for example, but it will need to control some simple peripherals
 (some parallel in/out, some dacs) attached to the system.
 
 It should provide a user interface showing the current state and
 allowing to manipulate it via a browser, and I will probably need
 to support some rpc as well.
 
 Does this sound sensible at all? Any suggestions?

I don't know how Python will affect the real-time tasks your system is
performing. You may want to look at a web framework in C (e.g.
http://www.koanlogic.com/klone/index.html).
Regards,
Suraj


--
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyGUI 2.0.5

2009-04-26 Thread Suraj Barkale
Greg Ewing greg.ewing at canterbury.ac.nz writes:
 
 PyGUI 2.0.5 is available:
 
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
 
 More bug fixes for various platforms.

Tested on Vista Home Premium 64bit with Python 2.6.2 all tests pass except:
16-model_dialog.py - If the model dialog Spanish Inqisition is closed by
pressing ENTER key, it pops up again. However, clicking buttons works fine.

Minor nitpicks:
1. Menu accelerators are not enabled by default i.e. pressing Alt + F does not
open the File menu.
2. Alt + F4 does not close the window.
3. None of the controls (except menus) have _Vista look_ to them
(http://dl.getdropbox.com/u/14797/no_vista_theme.png).

 
 Still no idea what's causing the object has been destroyed
 error on Windows XP, though. Does this happen for everyone?
 Is there anyone who *has* got 12-scroll.py working for them
 on XP?
 
I have never seen this error either on XP or Vista. 12-scroll.py has always
worked for me.

Regards,
Suraj

--
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyGUI 2.0.4

2009-04-22 Thread Suraj Barkale
Greg Ewing greg.ewing at canterbury.ac.nz writes:

 
 PyGUI 2.0.4 is available:
 
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
 
 Fixes a few more bugs and hopefully improves things
 on Windows, although I can't be sure it will fix all
 the Windows problems people are having, because I
 haven't been able to reproduce some of them.
 
I will test this over the weekend on Vista. Are you planning to put it on google
code or sourceforge so issues can be easily submitted?

Thanks  Regards,
Suraj

--
http://mail.python.org/mailman/listinfo/python-list


Re: Modifying the value of a float-like object

2009-04-15 Thread Suraj Barkale
 Eric.Le.Bigot at spectro.jussieu.fr writes:
 
 Hello,
 
 Is there a way to easily build an object that behaves exactly like a
 float, but whose value can be changed?  The goal is to maintain a list
 [x, y,…] of these float-like objects, and to modify their value on the
 fly (with something like x.value = 3.14) so that any expression like x
 +y uses the new value.
 

Have you looked at sympy (http://code.google.com/p/sympy/)? It implements
symbolic mathematics so you can define the equations  put in the values to get
the result. You should be able to derive from the Symbol class to implement the
accuracy behavior.

Regards,
Suraj

--
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: PyGUI 2.0.1

2009-04-15 Thread Suraj Barkale
Greg Ewing greg.ewing at canterbury.ac.nz writes:
 
 PyGUI 2.0.1 is available:
 
Thank you very much for this GUI toolkit. I always wanted something like this on
windows. I installed this and tried out the tests on Python 2.6.1 and Windows XP
SP3. Following are my observations. I will try to send some patches once I have
looked at the code in detail.

After installing on windows I had to manually delete
C:\python26\lib\site-packages\GUI\Win32\__init__.py in order to get it work.

Test 02-window.py:
1. Resizing window produces white horizontal bars. Use double buffering to
prevent this?

Test 05-checkbox.py:
1. Checkbok background is a black rectangle.

Test 06-radiobutton.py:
1. Radiobutton has a white background.

Test 09-textfield.py:
1. All textfields have black area at right  bottom.
2. For multiline textfield, the black are is not painted over during 
repaint.
3. Textfields no not have XP style borders.

Test 15-dialog.py:
1. Alt+F4 does not work. However Ctrl+Q works fine.
2. Initially keyboard navigation is not possible. Once a button is clicked,
it is focused and keyboard navigation is possible.
2. If Cancel button has focus, pressing Enter should print Cancel. Currently
it prints OK.
3. Pressing spacebar should activate focused button.

Test 18-exceptions.py:
1. Printing traceback to console is not sufficient on windows.

Test 29-slider.py:
1. Defenitions of 'live' and 'non-live' are swapped in the printed message.

Test 33-mouse-events.py:
1. mouse-enter and mouse-leave events are not reported.

Test 37-image-cursor.py:
1. Mouse pointer hotspot is in the middle of the image.

Test 38-keys.py:
1. Key combinations with Ctrl  Alt are not detected properly.
2. Scroll-lock is reported as f14
3. Pause/Break is reported as f15
4. Caps-lock  Num-lock are detected as keycodes but 'key' is not reported.

Regards,
Suraj


--
http://mail.python.org/mailman/listinfo/python-list


Re: email from windows

2009-03-30 Thread Suraj Barkale
prakash jp prakash.stack at gmail.com writes:
 Hi all,
  
 In windows environment, how to send email from one gmail address to another
gmail (or another mail) addrress
  
  
Gmail requires SSL smtp support which is missing in Python stdlib. However, you
can look at this example (http://www.example-code.com/python/gmail_smtp_465.asp)
which uses a module called chilkat to do the work.

Regards,
Suraj

--
http://mail.python.org/mailman/listinfo/python-list


[issue5355] Expat parser error constants are string descriptions

2009-02-23 Thread Suraj Barkale

New submission from Suraj Barkale suraj+pyt...@barkale.com:

All the error constants in `xml.parsers.expat.errors` are strings.
However, when expat raises an ExpatError exception, ExpatError.code
attribute is a number. There seems to be no way of associating
ExpatError with a corresponding error code from `xml.parsers.expat.errors.

Following code snippet should print Ignore empty file but in Python
2.6 it raises ExpatError.

from xml.etree import ElementTree
from xml.parsers import expat

try:
ElementTree.parse('')
except expat.ExpatError as e:
if e.code == expat.errors.XML_ERROR_NO_ELEMENTS:
print Ignore empty file
else:
raise

--
components: XML
messages: 82648
nosy: suraj
severity: normal
status: open
title: Expat parser error constants are string descriptions
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5355
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5355] Expat parser error constants are string descriptions

2009-02-23 Thread Suraj Barkale

Suraj Barkale suraj+pyt...@barkale.com added the comment:

In the snippet `ElementTree.parse('')` should be replaced by
`ElementTree.fromstring('')`.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5355
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4453] MSI installer shows error message if Compile .py files to bytecode option is selected

2008-11-28 Thread Suraj Barkale

New submission from Suraj Barkale [EMAIL PROTECTED]:

If the option to Compile .py files to bytecode after installation is
selected during installation (by clicking on Advanced button on
Customize dialog), installer shows the attached dialog. There seems to
be no problem after installation is finished. I have tested this on
Vista Ultimate SP1 32 bit.

--
components: Installation
files: SetupError.JPG
messages: 76537
nosy: suraj
severity: normal
status: open
title: MSI installer shows error message if Compile .py files to bytecode 
option is selected
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file12146/SetupError.JPG

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4453
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: dbus-python for windows

2008-01-15 Thread Suraj Barkale
est electronixtar at gmail.com writes:
 I am trying to port Scribes to Windows, 

Hi there like minded fellow

 sourceforge.net/projects/windbus/≥ but it not for Python, so how could
 I install dbus module for Windows Python 2.5 ?

I have also started to dabble in windbus-python for the sake of Scribes. I have
following observations:
1. I don't have Visual Studio 2003 (required for compiling Python 2.x modules)
so alternative is to use MinGW. Follow instructions at
http://js.cx/~justin/mingw You can skip the GtkGLExt part.
2. Checkout windbus from sourceforge, apply the patch (patch.exe doesn't work on
Vista. Rename it to p4tch.exe)
3. Follow the windows build instructions for windbus. It gets compiled 
correctly 
:).
4. dbus-python has dependency on dbus AND dbus-glib. But all my attempts of
getting dbus-glib to build have failed so for.
5. dbus-python looks at wrong place for python headers, this is very easy to
connect and if we can get dbus-glib to build then we are there :)

I will keep banging my head  let you know once I have cracked it (or the
dbus-python :)

P.S. Please CC me in your reply as I am not on the list.

Regards,
Suraj



-- 
http://mail.python.org/mailman/listinfo/python-list