comp.lang.python
  Home FAQ Contact Sign in
comp.lang.python only
 
Advanced search
July 2008
motuwethfrsasuw
 123456 27
78910111213 28
14151617181920 29
21222324252627 30
28293031    31
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.python Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Validation in plone         


Author: Sallu
Date: Jul 6, 2008 23:10

Hi all and one,
How to do server side validation in plone? please help me its very
urgent. i created a validator.py file where i wrote a script for
'special character are not allowed' and calling that script in
movie.py its working fine by validators = ('splcharvalid',), and when
i wrote another script for email validation and want to call in same
field like
validators = ('emailvalid',), and i am calling like this
validators = ('splcharvalid',),('emailvalid',), but its not working
even i wrote like this too
validators = ('splcharvalid','emailvalid',), but its too not
working.. could you please help mr to resolve this problem or may tell
me another way to do validation in plone..
1 Comment
  extended setattr()         


Author: Rotlaus
Date: Jul 6, 2008 23:01

2 weeks ago i asked for a etended getattr() which worked really fine,
but now i would love to have a extended setattr() as well.

Lets assume i have some classes:

class A(object):
def __init__(self):
self.B = B()

class B(object):
def __init__(self):
self.C = C()

class C(object):
def __init__(self, foo='', bar=''):
self.foo = foo
self.bar = bar

and now i wanna do something like this:

a=A()
ext_setattr(a, 'B.C', ('a', 'b'))

Is this possible? It would also be nice if the attributes would be
created if they not exist, always implying that
objectname==objecttype.
Show full article (0.65Kb)
4 Comments
  VNC capture in python         


Author: Astan Chee
Date: Jul 6, 2008 21:12

Hi,
I was wondering if I can do a capture of a VNC screen in python. Kinda
like this http://search.cpan.org/~lbrocard/Net-VNC-0.35/lib/Net/VNC.pm
but without opening a VNC window or doing a screen capture.
Thanks for any suggestions

--
"Formulations of number theory: Complete, Consistent, Non-trivial. Choose two."

Animal Logic
http://www.animallogic.com

Please think of the environment before printing this email.

This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free.
1 Comment
  Re: GUI Programming by hand not code with Python Code         


Author: Victor Noagbodji
Date: Jul 6, 2008 20:17

> Is their a program that lets you design a GUI by hand (like gambas)
> not by code (like wxpython) but the commands are in python?
>
> A program similar to gambas or vb
>
> Gambas with python code instead of gambas code would be perfect.
>
> Thanks in advance

Check out the Designer program that comes with PyQt.

--
NOAGBODJI Paul Victor
no comments
  can't start IDLE 2.6 in Windows Vista         


Author: Mensanator
Date: Jul 6, 2008 19:47

Python 2.6b1 installed ok on my XP laptop but not my Vista desktop.

First I got a strange application log error:

Activation context generation failed for
"C:\Python\Dlls\_socket.pyd".
Error in manifest or policy file
"C:\Python26\DLLs\Microsoft.VC90.CRT.MANIFEST"
on line 12. The value
"..\msvcr90.dll"
of attribute "name" in element
"urn:schemas-microsoft-com:asm.v1^file" is invalid.

Oddly, It IS valid. Poking around, I changed the name in the
manifest from "..\msvcr90.dll" to "msvcr90.dll" and copied
the .dll from the parent directory.

This stopped the app;ication error log messages.

In Googling around, I found the suggestion to do

python lib\idlelib\idle.py -n

which gives me this error:
Show full article (1.64Kb)
no comments
  GUI Programming by hand not code with Python Code         


Author: jayjaygibbs
Date: Jul 6, 2008 19:33

Is their a program that lets you design a GUI by hand (like gambas)
not by code (like wxpython) but the commands are in python?

A program similar to gambas or vb

Gambas with python code instead of gambas code would be perfect.

Thanks in advance
5 Comments
  mirroring files and data via http         


Author: Steve Potter
Date: Jul 6, 2008 18:14

I'm working on a project to create a central administration interface
for several websites located on different physical servers.

You can think of the websites as a blog type application. My
administration application will be used to create new blog posts with
associated media (images, etc..)

So I am thinking to setting up a script on each of the sites to "phone
home" once per day and download any new posts and media files.

I am thinking of transmitting the post data in an xml format that
could then be decoded an recorded into the database on the slave
site. Are there any easy ways to encode a python dictionary to and
from xml?

For the media files I am thinking that the administration interface
would also provide an xml file with a list of all of the media files
required along with an http path to retrieve them and a checksum of
some sort to verify that they were downloaded correctly.

Basically I am trying to figure out if anything already exists to
perform some of these functions or if I have to make them from
scratch. I know none of it should be too hard, but I hate to re-
invent the wheel.
Show full article (1.14Kb)
3 Comments
  RE: how are strings immutable in python?         


Author: Delaney, Timothy (Tim)
Date: Jul 6, 2008 18:00

ssecorp wrote:
> so why would you ever want mutability?
>
>
> seems very counterintuitive and unreliable.

Because immutability imposes a lot of restrictions and performance
characteristics that mutable objects don't have. For example, compare
building up a list and a tuple element-by-element (using the most
appropriate methods for each):

a = []
b = ()

for i in range(10):
a.append(i)
b += (i,)

The list can simply grow its memory space and assign the new element.
OTOH, we need to create two new tuples each time (the one containing the
new element, and the one which is a concatenation of the old elements
plus the new element). The old tuple and the temporary tuple then get
thrown away.
Show full article (1.21Kb)
no comments
  Very weird bug!         


Author: ssecorp
Date: Jul 6, 2008 14:47

I was looking into currying and

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
Show full article (2.76Kb)
3 Comments
  interpretation of special characters in Python         


Author: TP
Date: Jul 6, 2008 14:42

Hi everybody,

I am new to Python, I try to understand how Python treats special
characters. For example, if I execute the following line in a shell
console, I obtain a colored string:

$ python -c "print '\033[30;44m foo \033[0m'"

So, it works.
Some time ago, I have made a lot of shell variables with all possible colors
(with shell functions executed each time I launch a new shell). For
example:

$ echo -e $esc$ColorBlackOnDarkblue foo $esc$ColorReset

gives the same result than the python command above.
To know the corresponding non-interpreted characters, I can use the -n
option of echo:

$ echo -n $esc$ColorBlackOnDarkblue foo $esc$ColorReset
\033[30;44m foo \033[0m

So, it is exactly the string above, as expected.

My problem arises when it comes to get these shell variables ( $esc,
$ColorBlackOnDarkblue, $ColorReset) in a Python script, with os.environ, in
the following 5-line script:
Show full article (1.63Kb)
9 Comments
1 2