[TurboGears] shell hub.commit() question

2006-01-07 Thread agreif

Hi,
I have the following question related to hub.commit and hub.end:

why does the hub.end() make a rollback?
is it necessary to end the hub after a commit?


C:\alex\project\test\turbogears1tg-admin shell
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
on win32
Type help, copyright, credits or license for more information.
(InteractiveConsole)
 hub.begin
 a= Author(last_name=Greif,first_name=Alex)
 1/QueryIns:  INSERT INTO author (id, first_name, last_name) VALUES (4,
'Alex', 'Greif')
 1/QueryOne:  SELECT last_name, first_name FROM author WHERE id = 4
 1/QueryR  :  SELECT last_name, first_name FROM author WHERE id = 4
 hub.commit()
 1/COMMIT  :
 hub.end()
 1/ROLLBACK:



[TurboGears] creating e-mails with TG

2006-01-07 Thread Max Ischenko

Hello,

I wonder, how do people approach the task of creating (template-based) e-mail 
messages with TurboGears? I used to use rather elaborate solution based on XSLT 
and now about updating it substituting XSLT logic with Kid but I'd like to 
explore other and may be better alternatives.

Main goals: template-based e-mail creation; approachable logic embedded within 
the template; ease of localizing into different languages.



[TurboGears] Re: Identity crisis

2006-01-07 Thread Jeff Watkins


On 6 Jan, 2006, at 11:15 pm, Cliff Wells wrote:


Is there any way [...]


Absolutely! All you have to do is write an IdentityProvider. And to  
do that, all you MUST do is create a class that exposes a method  
named identity_from_request and returns an Identity dictionary.


An easier way to go would be to extend the basic IdentityProvider  
class, because it will handle things like sending the identity cookie  
and checking the form for identity credentials. Your  
ImapIdentityProvider (or nerkles' LdapIdentityProvider) MUST  
implement only load_identity and validate_identity. There are several  
other methods you MAY override (secret_token_for_identity and  
invalidate_secret_token_for_identity).


The two files that will be of interest to you are:
turbogears.identity.provider.base
turbogears.identity.provider.soprovider (as an example)

If someone would find the solution to the transaction problem I've  
been having, I might have time to write up a HowTo for creating a new  
IdentityProvider...


--
Jeff Watkins
http://newburyportion.com/

“In science it often happens that scientists say, ‘You know that’s a  
really good argument; my position is mistaken,’ and then they  
actually change their minds and you never hear that old view from  
them again. They really do it. It doesn’t happen as often as it  
should, because scientists are human and change is sometimes painful.  
But it happens every day. I cannot recall the last time something  
like that happened in politics or religion.” Carl Sagan, 1987




[TurboGears] Re: shell hub.commit() question

2006-01-07 Thread Lee McFadden

The rollback (I'm guessing) is a safety net to prevent any
transactions (possibly in another thread when running in an actual app
rather than the shell) from being cut off in the middle without a
rollback/commit.

On 1/7/06, agreif [EMAIL PROTECTED] wrote:

 Hi,
 I have the following question related to hub.commit and hub.end:

 why does the hub.end() make a rollback?
 is it necessary to end the hub after a commit?


 C:\alex\project\test\turbogears1tg-admin shell
 Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
 on win32
 Type help, copyright, credits or license for more information.
 (InteractiveConsole)
  hub.begin
  a= Author(last_name=Greif,first_name=Alex)
  1/QueryIns:  INSERT INTO author (id, first_name, last_name) VALUES (4,
 'Alex', 'Greif')
  1/QueryOne:  SELECT last_name, first_name FROM author WHERE id = 4
  1/QueryR  :  SELECT last_name, first_name FROM author WHERE id = 4
  hub.commit()
  1/COMMIT  :
  hub.end()
  1/ROLLBACK:




[TurboGears] Re: Identity crisis

2006-01-07 Thread Cliff Wells


Jeff Watkins wrote:


On 6 Jan, 2006, at 11:15 pm, Cliff Wells wrote:


Is there any way [...]


Absolutely!


Thanks!


If someone would find the solution to the transaction problem I've 
been having, I might have time to write up a HowTo for creating a new 
IdentityProvider...
I just spent an hour tracing through database.py to no avail.  I feel 
this overwhelming sense of wanting to stick with a plain database 
connection and raw SQL...  I don't think I'll be able to help much.   
However, one thing I do notice is that the error message may not be 
telling the whole story:


assert not self._obsolete, This transaction has already gone through 
ROLLBACK; begin another transaction


all this *really* tells us is that self._obsolete is False, not that a 
rollback happened.  I'd try to track down if there's some condition that 
can get self._obsolete into an incorrect state.   Then and only then 
would I assume that assertion really means what it says it does.


Cliff



[TurboGears] Re: Identity crisis

2006-01-07 Thread Cliff Wells


Cliff Wells wrote:


assert not self._obsolete, This transaction has already gone through 
ROLLBACK; begin another transaction


all this *really* tells us is that self._obsolete is False, not that a 
rollback happened.  I'd try to track down if there's some condition 
that can get self._obsolete into an incorrect state.   Then and only 
then would I assume that assertion really means what it says it does.

Er, self._obsolete is True is what I meant.  Is it really 5am?  Sheesh.

I notice from another thread (and the source of database.py) that a 
rollback happens whenever commit() is called.  Since you're doing the 
queries manually, perhaps you need to call begin() prior to the next 
query? 

Also, what happens if you don't call the class connection directly?  Can 
you just put some dummy results in a list rather than call the database 
and see if the problem goes away?


Cliff



[TurboGears] Re: Identity now supports MD5 SHA1 hashed passwords

2006-01-07 Thread [EMAIL PROTECTED]

And how to use it? I'm trying with no sucess :-P

In dev.cfg I have tryed:
identity.soprovider.encryption_algorithm=sha1
and
identity.soprovider.password_encryption=sha1

I input data from DataController( classsql_class=TG_User ) but the
password is allways simple text :-|



[TurboGears] Re: creating e-mails with TG

2006-01-07 Thread Steven Kryskalla

There's an addon called TurboEmail that will let you do this.  The code
for TurboEmail is in this ticket:
http://trac.turbogears.org/turbogears/ticket/244

And here is some discussion on it:
http://tinyurl.com/8lwmw



[TurboGears] Re: project start command and Growl (was: TurboGears new site look - let's get to it!)

2006-01-07 Thread Martina Oefelein



Am 07.01.2006 um 00:17 schrieb Jorge Godoy:

That plus the start-project instead of project-start would  
be really
interesting.  I get more annoyed with having to type ./prTAB- 
TAB to get

./project-start.py than with 'quickstart'...


usually I don't use project-start.py directly. Instead I create a  
shell one-liner start like this:
python project-start.py || growlnotify -t project stopping -m bye,  
bye...


This pops up a message when the server stops due to an error during  
autoreload. This way, when I save changed code while the server is  
running, I don't have to watch the terminal window for errors.  
Instead, I can directly switch to the browser, wait a moment, and hit  
reload.


Of course, this only works on the Mac, and only if you have Growl  
installed. Maybe tg-admin start could check for growlnotify and call  
if automatically?


ciao
Martina



[TurboGears] File upload blocks other requests

2006-01-07 Thread agreif

Hi,

I experienced the following problem with TG 08a5 and CherryPy 2.1.0 on
Linux:
while one client uploads a file, all other requests are blocked until
the the upload is finished.

Is there a way to make fileuploading multiuser capable?

my controller looks like this:

@turbogears.expose()
def upload(self, myFile, folderName):
folderPath = util.getUploadFolderPath(folder=folderName)

filePath = os.path.join(folderPath,  myFile.filename)
fileHandle = open(filePath, 'a')
while True:
data = myFile.file.read(8192)
if not data:
break
fileHandle.write(data)
fileHandle.close()
return self.uploadForm(folderName=folderName)

cheers,
Alex.



[TurboGears] Re: Identity now supports richer requirements checking

2006-01-07 Thread [EMAIL PROTECTED]

Am I wrong or we can use 'identity.in_group' or/and
'identity.conditions.in_group'?
I thing that all conditions in 'identity.conditions' are in
'identity'...

@identity.require( identity.conditions.in_group( admin ) )
or
@identity.require( identity.in_group( admin ) ) 

???



[TurboGears] Re: Identity now supports MD5 SHA1 hashed passwords

2006-01-07 Thread Jeff Watkins



On 7 Jan, 2006, at 9:16 am, [EMAIL PROTECTED] wrote:



And how to use it? I'm trying with no sucess :-P

In dev.cfg I have tryed:
identity.soprovider.encryption_algorithm=sha1
and
identity.soprovider.password_encryption=sha1

I input data from DataController( classsql_class=TG_User ) but the
password is allways simple text :-|



As I mentioned in the initial message, you must manually encrypt the  
password using `encrypt_password` on the current provider. For example:


u= TG_User( userId='jeff', displayName='Jeff Watkins',
emailAddress='[EMAIL PROTECTED]',
password=identity.current_provider.encrypt_password 
( 'foobar' ) )



--
Jeff Watkins
http://newburyportion.com/

Computers, they're just a fad.




[TurboGears] Re: Identity now supports richer requirements checking

2006-01-07 Thread Jeff Watkins
On 7 Jan, 2006, at 9:41 am, [EMAIL PROTECTED] wrote:Am I wrong or we can use 'identity.in_group' or/and'identity.conditions.in_group'?I thing that all conditions in 'identity.conditions' are in'identity'...@identity.require( identity.conditions.in_group( "admin" ) )or@identity.require( identity.in_group( "admin" ) ) ??? Correct.Although I usually add the following to my controller file:from turbogears import identityfrom turbogears.identity.conditions import * --Jeff Watkinshttp://newburyportion.com/ 

[TurboGears] Re: project start command and Growl (was: TurboGears new site look - let's get to it!)

2006-01-07 Thread Richard (koorb)


Martina Oefelein wrote:
 python project-start.py || growlnotify -t project stopping -m bye,
 bye...

 This pops up a message when the server stops due to an error during
 autoreload. This way, when I save changed code while the server is
 running, I don't have to watch the terminal window for errors.
 Instead, I can directly switch to the browser, wait a moment, and hit
 reload.

 Of course, this only works on the Mac, and only if you have Growl
 installed. Maybe tg-admin start could check for growlnotify and call
 if automatically?
 
 ciao
 Martina

ooo! now I like the sound of that!



[TurboGears] Re: project start command and Growl (OSX) or zenity (Linux/Gnome)

2006-01-07 Thread Olivier Favre-Simon
Richard (koorb) wrote:
 Martina Oefelein wrote:
   
 python project-start.py || growlnotify -t project stopping -m bye,
 bye...

 This pops up a message when the server stops due to an error during
 autoreload. This way, when I save changed code while the server is
 running, I don't have to watch the terminal window for errors.
 Instead, I can directly switch to the browser, wait a moment, and hit
 reload.

 Of course, this only works on the Mac, and only if you have Growl
 installed. Maybe tg-admin start could check for growlnotify and call
 if automatically?

 ciao
 Martina
 

 ooo! now I like the sound of that!
   
Yep, that's better!

For users with GTK enabled GUIs (like me on Linux + GNOME desktop) the
zenity command (http://directory.fsf.org/zenity.html) enables opening
popup windows with icons related to message type (info, error, etc.)

That's really a small sub-project : using sys.platform to launch
platform-specific shell command for GUI notification of server events ,
based on output of the start script.




signature.asc
Description: OpenPGP digital signature


[TurboGears] Re: Breaking change coming for those using other template engines!

2006-01-07 Thread christian

christian wrote:
 Leandro Lucarella wrote:
  Kevin Dangoor, el viernes  6 de enero a las 12:27 me escribiste:
  
   Christian Wyglendowski and I have been talking about the overlap
   between Buffet (his CherryPy template filter) and TurboGears' template
   plugin support. What we've ended up with is a slightly modified
   interface that allows Buffet and TurboGears to use the same plugins
   for rendering templates. Even better, these plugins have no ties at
   all to TurboGears, Buffet or CherryPy. They can be used by anyone who
   wants to support multiple template engine rendering based on a dict.
 
  That's just amazing. I love the work TG puts on interoperability and reuse!

 I really appreciate that too!  Kevin obviously gets open source and
 he and the TG community (all of you) have really moved a number Python
 projects forward.  Thanks for being willing to come together on this
 templating plugin system and hopefully CherryPy, TG and other projects
 will benefit from it.

I updated Buffet to support the new plugin format and moved the Python
string Template and Myghty templating support into plugins
(BuffetString, BuffetMyghty).  If someone running TurboGears could try
them out and let me know if they work, I'd appreciate it.  You can get
both of them through easy_install or at projects.dowski.com.

Christian
http://www.dowski.com



[TurboGears] Re: widget - dynamically contruct template string on __init__

2006-01-07 Thread Ksenia Marasanova

2006/1/7, Ksenia Marasanova [EMAIL PROTECTED]:
 Hey,

 I am trying to construct template property of a widget based on widget
 parameters, in __init__ method:

 class MyWidget(Widget):
 def __init__(self, *args, **kwargs):
 # just use textarea template for testing
 kwargs['template'] = 
 div xmlns:py=http://purl.org/kid/ns#; py:strip=True
 textarea name=${widget.name} id=${widget.name}
 class=textarea_field
 py:attrs=widget.attrs${widget_value}/textarea
span class=field_error
 py:if=widget_error${str(widget_error)}/span
 /div
super(MyWidget, self).__init__(*args, **kwargs)

 But it doesn't work, here is the end of the traceback that looks relevant:
   File [...]/turbogears/widgets/base.py, line 129, in insert
 self.template)
   File [...]/turbogears/view.py, line 61, in transform
 engine, template = _choose_engine(template)
   File [...]/turbogears/view.py, line 32, in _choose_engine
 raise KeyError, \
 KeyError: 'Template engine div xmlns is not installed'

Okay, I see it finally. I was using widgets devcast as a manual, but
it looks like since changeset 437 template cannot be assigned to a
widget instance, it can only be declared as a class variable (and
processed in __classinit__).
Never mind.

--
Ksenia


[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread Lee McFadden

If you're running in development mode which is the default when you
run python projectname-start.py, make sure your dev.cfg has it's
threadpool set higher than 1.

On 1/7/06, agreif [EMAIL PROTECTED] wrote:

 Hi,

 I experienced the following problem with TG 08a5 and CherryPy 2.1.0 on
 Linux:
 while one client uploads a file, all other requests are blocked until
 the the upload is finished.

 Is there a way to make fileuploading multiuser capable?

 my controller looks like this:

 @turbogears.expose()
 def upload(self, myFile, folderName):
 folderPath = util.getUploadFolderPath(folder=folderName)

 filePath = os.path.join(folderPath,  myFile.filename)
 fileHandle = open(filePath, 'a')
 while True:
 data = myFile.file.read(8192)
 if not data:
 break
 fileHandle.write(data)
 fileHandle.close()
 return self.uploadForm(folderName=folderName)

 cheers,
 Alex.




[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread agreif

Hi,

I am running in prod mode.
But anyway, where can I set the threadpool ?

thanks,
Alex.



[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread Lee McFadden

In either dev.cfg or prod.cfg add/amend the following:

server.threadPool = 1

Make sure you have enough threads to handle the load.  On one of my
very low traffic internal apps I have this set to 5.  The app in
question deals with file uploads and I've not had a problem with it so
far.

Lee

On 1/7/06, agreif [EMAIL PROTECTED] wrote:

 Hi,

 I am running in prod mode.
 But anyway, where can I set the threadpool ?

 thanks,
 Alex.




[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread agreif

thanks, it works now.

ALex.



[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread Jorge Godoy

Bob Ippolito [EMAIL PROTECTED] writes:

 It would be great if TG's controller had a filter that did  streaming.
 CherryPy's default is stupid.

Isn't it better, then, to suggest changing CP's default?  This way besides TG
users CP users would also benefit from the change... 

-- 
Jorge Godoy  [EMAIL PROTECTED]


[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread Soni Bergraj

Hello,
is there a convenient way to provide resources to all templates other
than in the std name space (turbogears.view.variableProviders)?


Thanks:),

-- 
Soni Bergraj


[TurboGears] Re: File upload blocks other requests

2006-01-07 Thread Bob Ippolito



On Jan 7, 2006, at 10:09 AM, Jorge Godoy wrote:



Bob Ippolito [EMAIL PROTECTED] writes:

It would be great if TG's controller had a filter that did   
streaming.

CherryPy's default is stupid.


Isn't it better, then, to suggest changing CP's default?  This way  
besides TG

users CP users would also benefit from the change...


No, it would break backwards compatibility... where in this case it  
doesn't matter much, because old applications don't subclass TG's  
controller.


-bob



[TurboGears] IdentityConfiguration problem

2006-01-07 Thread Alberto

Hi,

I've just updated to r469 and something on indentity broke my app. An
IdentityConfigurationExcpetion is raised where it worked flawlessly
before.

I'm sure its my own stupidity as I'm still a newbie on entry_points et
al and it looks as I have not registered my identity plugin correctly.
¿Could someone please point me in the right direction?

BTW, this commit has two typos which prevented the framework from
loading:

Index: turbogears/identity/__init__.py
===
--- turbogears/identity/__init__.py (revision 469)
+++ turbogears/identity/__init__.py (working copy)
@@ -22,7 +22,7 @@

 def _load_class( classPath ):
 module_path,class_name= classPath.split(:,1)
-module= _load_module( module_path ) )
+module= _load_module( module_path )
 return getattr( module, class_name )


@@ -37,7 +37,7 @@
 plugin= entrypoint.load()
 return plugin()

-raise IdentityConfigurationException( IdentityProvider plugin
missing: %s,
+raise IdentityConfigurationException( IdentityProvider plugin
missing: %s %
   provider_plugin )

The traceback I get is the following:

Unhandled exception in thread started by bound method Server._start of
cherrypy._cpserver.Server object at 0x3d18b0
Traceback (most recent call last):
  File
/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cpserver.py,
line 122, in _start
func()
  File /Users/alberto/src/turbogears/turbogears/startup.py, line 114,
in startTurboGears
cherrypy.root._cpFilterList.extend(
  File /Users/alberto/src/turbogears/turbogears/identity/filter.py,
line 21, in __init__
provider= create_default_provider()
  File /Users/alberto/src/turbogears/turbogears/identity/__init__.py,
line 40, in create_default_provider
raise IdentityConfigurationException( IdentityProvider plugin
missing: %s%
turbogears.identity.exceptions.IdentityConfigurationException:
IdentityProvider plugin missing: lalala.id_provider.MyIdentityProvider

1000 Thanks,
Alberto



[TurboGears] Just looking at the identity source

2006-01-07 Thread Justin Johnson



While browsing through the source for up and coming 0.9, I've noticed 
the following TG_User comment:


'''
Reasonably basic User definition. Probably would want additional attributes.
'''

Does this mean that the intention is to further add attributes?  As a 
suggestion - that might not be desirable.


For example, I'm working on a system where I already have a User class 
that contains id, password, email and creation date.  Basic stuff.


I'm representing further user information such as gender, date of birth, 
location etc through a separate table.  My User model really just acts 
as the gate keeper data to the system and is minimal.


Now, TG_User also has 'displayName' which is a 255 length description 
field!  On my set up I'd put that in my separate table.  Some apps 
wouldn't have any use for it at all.


This is application dependent and my feeling is that the identity system 
should just provide the absolute minimum to incorporate security.


Would it be possible to have this so that you can specify your own User 
model?


Otherwise, great job and I look forward to using it! :)




[TurboGears] Re: IdentityConfiguration problem

2006-01-07 Thread Jeff Watkins
Oops. Sorry about the typos, I was rushing to get the plugin support ready before my walk with my daughter. Naturally I goofed.Look for a separate email regarding the plugin stuff.On 7 Jan, 2006, at 3:44 pm, Alberto wrote:Hi,I've just updated to r469 and something on indentity broke my app. AnIdentityConfigurationExcpetion is raised where it worked flawlesslybefore.I'm sure its my own stupidity as I'm still a newbie on entry_points etal and it looks as I have not registered my identity plugin correctly.¿Could someone please point me in the right direction?BTW, this commit has two typos which prevented the framework fromloading:Index: turbogears/identity/__init__.py===--- turbogears/identity/__init__.py     (revision 469)+++ turbogears/identity/__init__.py     (working copy)@@ -22,7 +22,7 @@ def _load_class( classPath ):     module_path,class_name= classPath.split(":",1)-    module= _load_module( module_path ) )+    module= _load_module( module_path )     return getattr( module, class_name )@@ -37,7 +37,7 @@         plugin= entrypoint.load()         return plugin()-    raise IdentityConfigurationException( "IdentityProvider pluginmissing: %s",+    raise IdentityConfigurationException( "IdentityProvider pluginmissing: %s" %                                           provider_plugin )The traceback I get is the following:Unhandled exception in thread started by bound method Server._start ofcherrypy._cpserver.Server object at 0x3d18b0Traceback (most recent call last):  File"/sw/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cpserver.py",line 122, in _start    func()  File "/Users/alberto/src/turbogears/turbogears/startup.py", line 114,in startTurboGears    cherrypy.root._cpFilterList.extend(  File "/Users/alberto/src/turbogears/turbogears/identity/filter.py",line 21, in __init__    provider= create_default_provider()  File "/Users/alberto/src/turbogears/turbogears/identity/__init__.py",line 40, in create_default_provider    raise IdentityConfigurationException( "IdentityProvider pluginmissing: %s"%turbogears.identity.exceptions.IdentityConfigurationException:IdentityProvider plugin missing: lalala.id_provider.MyIdentityProvider1000 Thanks,Alberto  --Jeff Watkinshttp://newburyportion.com/"Just because you have the right to do something, doesn't mean it's the right thing to do."-- Fred Friendly, former president of CBS News 

[TurboGears] IdentityProvider plugins

2006-01-07 Thread Jeff Watkins
In keeping with TurboGears move to allow plugins for templates, I've added support to the Identity framework for IdentityProvider plugins. The one change to your config files is that if you're currently specifying the identity.provider via fully qualified class name, you'll need to change to the plugin name:identity.provider="sqlobject"This is the default SqlObjectIdentityProvider that ships with TurboGears. At some point, it would be nice to have an LDAP provider and someone mentioned an IMAP provider. These would just be EGGs that get installed.As a side note, I also changed the default model classes TG_User, TG_Group, and TG_Permission to be InheritableSQLObjects. This means you can extend the default model rather than create a whole new model. --Jeff Watkinshttp://newburyportion.com/"Not everything that can be counted counts, and not everything that counts can be counted."-- Albert Einstein 

[TurboGears] Re: IdentityProvider plugins

2006-01-07 Thread Jeff Watkins
No, but it would be really easy to do with a CompositeIdentityProvider that calls identity_from_request for each other provider until it gets an identity.On 7 Jan, 2006, at 4:37 pm, nerkles wrote:Any plans for multiple providers? For example it tries LDAP, and ifthat doesn't work, then it tries SQLObject?Glad to see this opening up though.  :D  --Jeff Watkinshttp://newburyportion.com/Getting an education was a bit like a communicable sexual disease. It made you unsuitable for a lot of jobs and then you had the urge to pass it on. -- (Terry Pratchett, Hogfather) 

[TurboGears] Growl!

2006-01-07 Thread Jeff Watkins


OK so Growl is great. Could someone create a cool gear icon for Growl  
to use?


--
Jeff Watkins
http://newburyportion.com/

'I know about people who talk about suffering for the common good.  
It's never bloody them! When you hear a man shouting Forward, brave  
comrades! you'll see he's the one behind the bloody big rock and the  
one wearing the only really arrow-proof helmet!'
-- Rincewind gives a speech on politics. (Terry Pratchett,  
Interesting Times)





[TurboGears] Re: Growl!

2006-01-07 Thread Richard (koorb)

like what exactly? does it need to be in a specific format?



[TurboGears] Re: Kid templates are a PAIN to debug

2006-01-07 Thread Ksenia Marasanova

I

2006/1/7, Jeremy Jones [EMAIL PROTECTED]:

 So, maybe I spoke too soon.  I'm getting the error again.  And I've
 removed all XML comments from the offending master.kid (as well as the
 template that extends it).  I've got the site on Dreamhost now (running
 under fastcgi), but haven't seen the problem thereyet.


I am getting this error too, on the same line (21 of master.py). First
few form submits go without problems, than the error appears and stays
there untill I restart the application :(

--
Ksenia


[TurboGears] Re: project start command and Growl (OSX) or zenity (Linux/Gnome)

2006-01-07 Thread Richard (koorb)

hmm, seems somewhat highjacked. I will post this here anyway

- Designed to fit on 1024 width and centred on the page.
- I know there is still no mailing list signup box, I'm trying to fit
it in.

http://koorb.co.uk/static/images/tglogos/layouts/blue-light-3.png



[TurboGears] Re: Just looking at the identity source

2006-01-07 Thread Olivier Favre-Simon
Entirely agreed.

Basic auth must be _basic_ = id+passwd


Not just display name but all personal data has nothing to do with
security and is fully application-specific.

This holds for the email field.


Identity is working good but may be some of the most security-aware
readers of this ML should help here: Even a good implementation doesn't
shield against all pitfalls when it comes to security.



Justin Johnson wrote:


 While browsing through the source for up and coming 0.9, I've noticed
 the following TG_User comment:

 '''
 Reasonably basic User definition. Probably would want additional
 attributes.
 '''

 Does this mean that the intention is to further add attributes?  As a
 suggestion - that might not be desirable.

 For example, I'm working on a system where I already have a User class
 that contains id, password, email and creation date.  Basic stuff.

 I'm representing further user information such as gender, date of
 birth, location etc through a separate table.  My User model really
 just acts as the gate keeper data to the system and is minimal.

 Now, TG_User also has 'displayName' which is a 255 length description
 field!  On my set up I'd put that in my separate table.  Some apps
 wouldn't have any use for it at all.

 This is application dependent and my feeling is that the identity
 system should just provide the absolute minimum to incorporate security.

 Would it be possible to have this so that you can specify your own
 User model?

 Otherwise, great job and I look forward to using it! :)






signature.asc
Description: OpenPGP digital signature


[TurboGears] Re: IdentityProvider plugins

2006-01-07 Thread Olivier Favre-Simon
Composition via inheritance is one way.

Another way could be middleware pipelining a-la-Paste.

This would allow arbitrary composition of many single-purpose
IdentityProvider, to KISS.

Alas I lack experience on the subject...



Jeff Watkins wrote:
 No, but it would be really easy to do with a CompositeIdentityProvider
 that calls identity_from_request for each other provider until it gets
 an identity.

 On 7 Jan, 2006, at 4:37 pm, nerkles wrote:


 Any plans for multiple providers? For example it tries LDAP, and if
 that doesn't work, then it tries SQLObject?

 Glad to see this opening up though.  :D


 --

 Jeff Watkins

 http://newburyportion.com/


 Getting an education was a bit like a communicable sexual disease. It
 made you unsuitable for a lot of jobs and then you had the urge to
 pass it on. 

 -- (Terry Pratchett, _Hogfather_)






signature.asc
Description: OpenPGP digital signature


[TurboGears] Re: Kid templates are a PAIN to debug

2006-01-07 Thread Jeremy Jones


Ksenia Marasanova wrote:


I

2006/1/7, Jeremy Jones [EMAIL PROTECTED]:
 


So, maybe I spoke too soon.  I'm getting the error again.  And I've
removed all XML comments from the offending master.kid (as well as the
template that extends it).  I've got the site on Dreamhost now (running
under fastcgi), but haven't seen the problem thereyet.
   




I am getting this error too, on the same line (21 of master.py). First
few form submits go without problems, than the error appears and stays
there untill I restart the application :(

--
Ksenia

 

This is exactly what I'm seeing.  It's not on all pages of the 
application, although it's not always on the same page.  It's just 
usually on the same specific page.


- jmj


[TurboGears] Re: Growl!

2006-01-07 Thread Jeff Watkins
PNG would work how about the white gear from the latest homepage design? And also maybe the gold one...It looks like there's a Python interface to Growl... this is neat.On 7 Jan, 2006, at 5:04 pm, Richard (koorb) wrote:like what exactly? does it need to be in a specific format?  --Jeff Watkinshttp://newburyportion.com/“In science it often happens that scientists say, ‘You know that’s a really good argument; my position is mistaken,’ and then they actually change their minds and you never hear that old view from them again. They really do it. It doesn’t happen as often as it should, because scientists are human and change is sometimes painful. But it happens every day. I cannot recall the last time something like that happened in politics or religion.” Carl Sagan, 1987 

[TurboGears] Re: IdentityProvider plugins

2006-01-07 Thread Jorge Godoy

nerkles [EMAIL PROTECTED] writes:

 Any plans for multiple providers? For example it tries LDAP, and if
 that doesn't work, then it tries SQLObject?

It would be easily achievable with PAM... ;-)  A plugin for PAM would enable a
series of authentication methods -- fingerprint, retin scan, shadow passwords,
passphrases, OTP, clear text passwords, no passwords at all... 

-- 
Jorge Godoy  [EMAIL PROTECTED]


[TurboGears] Re: Just looking at the identity source

2006-01-07 Thread Olivier Favre-Simon
Understood. Still that old trade-off  zeroconf/simple but
might-be-vulnerable VS. secure but complex.

Anyway I think the table should be split, with user private data
separate from system security data.

So people could extend / ALTER TABLE / whatever to add/change fields on
the second table with no impact on the basic provider code because is
data is insulated.


Jeff Watkins wrote:
 The goal of the Identity framework is to provide a usable system out
 of the box. This includes the fields most applications are likely to
 use. I recognise this isn't the ideal for everyone, but it allows
 developers to be productive quickly.

 At some point I hope to put together a nice admin interface for
 identity, which will work with the default model. This means
 developers can get going without any real code.

 On 7 Jan, 2006, at 5:18 pm, Olivier Favre-Simon wrote:

 Entirely agreed.

 Basic auth must be _basic_ = id+passwd


 Not just display name but all personal data has nothing to do with
 security and is fully application-specific.

 This holds for the email field.


 Identity is working good but may be some of the most security-aware
 readers of this ML should help here: Even a good implementation doesn't
 shield against all pitfalls when it comes to security.



 Justin Johnson wrote:


 While browsing through the source for up and coming 0.9, I've noticed
 the following TG_User comment:

 '''
 Reasonably basic User definition. Probably would want additional
 attributes.
 '''

 Does this mean that the intention is to further add attributes?  As a
 suggestion - that might not be desirable.

 For example, I'm working on a system where I already have a User class
 that contains id, password, email and creation date.  Basic stuff.

 I'm representing further user information such as gender, date of
 birth, location etc through a separate table.  My User model really
 just acts as the gate keeper data to the system and is minimal.

 Now, TG_User also has 'displayName' which is a 255 length description
 field!  On my set up I'd put that in my separate table.  Some apps
 wouldn't have any use for it at all.

 This is application dependent and my feeling is that the identity
 system should just provide the absolute minimum to incorporate security.

 Would it be possible to have this so that you can specify your own
 User model?

 Otherwise, great job and I look forward to using it! :)





 --
 Jeff Watkins
 http://newburyportion.com/





signature.asc
Description: OpenPGP digital signature


[TurboGears] Re: Newbie question re: running TurboGears for the first time on DreamHost with FastCGI

2006-01-07 Thread Sean De La Torre

Robin,

I'm glad everything worked!  Sarah and I exchanged emails and we found
that she needed to install the mysql python libraries (I've added this
info to the instructions).  Everything else was working fine.

Thanks,

Sean

Robin Munn wrote:
 On 1/3/06, Sean De La Torre [EMAIL PROTECTED] wrote:
 
  Sarah, can you send me your tg_fastcgi script ([EMAIL PROTECTED])?
  I wrote the instructions and have an app running on Dreamhost, so I
  think I'll be able to help out.
 
  Sean

 BTW, thanks a lot for the TurboGears-on-Dreamhost instructions, Sean!
 I followed them and had TurboGears running perfectly on my first try
 -- something I failed to do with Django. It took me a couple of hours
 of experimentation to get Django running on Dreamhost when I tried
 several months ago. (It's been long enough by now that I forget if I'd
 done something wrong back then, or if the instructions had been
 broken). But I just wanted to let you know that your instructions
 worked perfectly for me.

 Sarah, I'd also be willing to take a look at your configuration. I
 don't understand FCGI very well yet, so I can't guarantee I'll spot
 any problems, but I can look. Send me your .htaccess file as well,
 it's also possible something may be wrong in there.
 
 --
 Robin Munn
 [EMAIL PROTECTED]
 GPG key 0xD6497014



[TurboGears] Re: Just looking at the identity source

2006-01-07 Thread Justin Johnson



Absolutely agree with having something usable out the box.  But ideally 
the User model would be a base class that could be expanded on rather 
than second guessing some fields that everyone, or no-one, will want.  
Especially if those fields aren't actually used in the rest of security 
model code.


It would be a shame to produce a feature set of the base distribution 
that needs changes to the source code to use it in production after 
those first 'wow' moments.


The only extra code for demo's/quickstart model would be:

class DemoUser(TG_User):
   email=UnicodeCol()
   displayName=UnicodeCol()

given that TG_User contained only id+passwd and inherited from 
InheritableSQLObject rather than SQLObject.


The goal of the Identity framework is to provide a usable system out 
of the box. This includes the fields most applications are likely to 
use. I recognise this isn't the ideal for everyone, but it allows 
developers to be productive quickly.


At some point I hope to put together a nice admin interface for 
identity, which will work with the default model. This means 
developers can get going without any real code.


On 7 Jan, 2006, at 5:18 pm, Olivier Favre-Simon wrote:


Entirely agreed.

Basic auth must be _basic_ = id+passwd


Not just display name but all personal data has nothing to do with
security and is fully application-specific.

This holds for the email field.


Identity is working good but may be some of the most security-aware
readers of this ML should help here: Even a good implementation doesn't
shield against all pitfalls when it comes to security.



Justin Johnson wrote:




While browsing through the source for up and coming 0.9, I've noticed
the following TG_User comment:

'''
Reasonably basic User definition. Probably would want additional
attributes.
'''

Does this mean that the intention is to further add attributes?  As a
suggestion - that might not be desirable.

For example, I'm working on a system where I already have a User class
that contains id, password, email and creation date.  Basic stuff.

I'm representing further user information such as gender, date of
birth, location etc through a separate table.  My User model really
just acts as the gate keeper data to the system and is minimal.

Now, TG_User also has 'displayName' which is a 255 length description
field!  On my set up I'd put that in my separate table.  Some apps
wouldn't have any use for it at all.

This is application dependent and my feeling is that the identity
system should just provide the absolute minimum to incorporate security.

Would it be possible to have this so that you can specify your own
User model?

Otherwise, great job and I look forward to using it! :)







--
Jeff Watkins
http://newburyportion.com/






[TurboGears] Re: Just looking at the identity source

2006-01-07 Thread Olivier Favre-Simon
TG_User should really be TG_SP_Basic

Each local (i.e. having data on the server = not LDAP and alike)
Security Provider (SP) would have it's own table.


Justin Johnson wrote:


 Absolutely agree with having something usable out the box.  But
 ideally the User model would be a base class that could be expanded on
 rather than second guessing some fields that everyone, or no-one, will
 want.  Especially if those fields aren't actually used in the rest of
 security model code.

 It would be a shame to produce a feature set of the base distribution
 that needs changes to the source code to use it in production after
 those first 'wow' moments.

 The only extra code for demo's/quickstart model would be:

 class DemoUser(TG_User):
email=UnicodeCol()
displayName=UnicodeCol()

 given that TG_User contained only id+passwd and inherited from
 InheritableSQLObject rather than SQLObject.

 The goal of the Identity framework is to provide a usable system out
 of the box. This includes the fields most applications are likely to
 use. I recognise this isn't the ideal for everyone, but it allows
 developers to be productive quickly.

 At some point I hope to put together a nice admin interface for
 identity, which will work with the default model. This means
 developers can get going without any real code.

 On 7 Jan, 2006, at 5:18 pm, Olivier Favre-Simon wrote:

 Entirely agreed.

 Basic auth must be _basic_ = id+passwd


 Not just display name but all personal data has nothing to do with
 security and is fully application-specific.

 This holds for the email field.


 Identity is working good but may be some of the most security-aware
 readers of this ML should help here: Even a good implementation doesn't
 shield against all pitfalls when it comes to security.



 Justin Johnson wrote:



 While browsing through the source for up and coming 0.9, I've noticed
 the following TG_User comment:

 '''
 Reasonably basic User definition. Probably would want additional
 attributes.
 '''

 Does this mean that the intention is to further add attributes?  As a
 suggestion - that might not be desirable.

 For example, I'm working on a system where I already have a User class
 that contains id, password, email and creation date.  Basic stuff.

 I'm representing further user information such as gender, date of
 birth, location etc through a separate table.  My User model really
 just acts as the gate keeper data to the system and is minimal.

 Now, TG_User also has 'displayName' which is a 255 length description
 field!  On my set up I'd put that in my separate table.  Some apps
 wouldn't have any use for it at all.

 This is application dependent and my feeling is that the identity
 system should just provide the absolute minimum to incorporate
 security.

 Would it be possible to have this so that you can specify your own
 User model?

 Otherwise, great job and I look forward to using it! :)





 -- 
 Jeff Watkins
 http://newburyportion.com/







signature.asc
Description: OpenPGP digital signature


[TurboGears] Re: Identity crisis

2006-01-07 Thread Cliff Wells


Jeff Watkins wrote:

On 7 Jan, 2006, at 8:06 am, Cliff Wells wrote:

If someone would find the solution to the transaction problem I've 
been having, I might have time to write up a HowTo for creating a 
new IdentityProvider...



I just spent an hour tracing through database.py to no avail.



Man, I didn't mean to extort help on this problem (I've all but given 
up on SQLObject). I was mostly kidding. But you do have a good point. 
I remember something about the database being down causing _obsolete 
to be False. Of course, I'm use SQLite, so it's definitely not quite 
that problem...


Well, I think the real issue is that there are too many layers of 
abstraction and the real problem is getting obscured, hence my comment 
about finding raw SQL tempting.  One of the reasons I've resisted 
frameworks in the past is due to things like this.  When things work 
they are great, when they don't, debugging can be a nightmare.  In this 
case, the problem seems to stem from the fact that an exception occurred 
at some point, but database.py continues to try to clean up before 
letting the exception bubble up which in turn causes a different 
exception to get thrown and the original problem is lost.  I think that 
unless there's a good reason, I'd remove the rollback_all() from within 
the except block in run_with_transaction() as I suspect that to be the 
culprit, or perhaps just have it print the traceback *before* it tries 
to do anything else. 



import sys, traceback
def run_with_transaction(func, *args, **kw):
   try:
   try:
   retval = func(*args, **kw)
   commit_all()
   return retval
   except cherrypy.HTTPRedirect:
   commit_all()
   raise
   except cherrypy.InternalRedirect:
   commit_all()
   raise
   except:
   traceback.print_exc(file=sys.stdout)
   rollback_all()
   raise
   finally:
   end_all()





Regards,
Cliff



--

Jeff Watkins

http://newburyportion.com/


'I know about people who talk about suffering for the common good. 
It's never bloody them! When you hear a man shouting Forward, brave 
comrades! you'll see he's the one behind the bloody big rock and the 
one wearing the only really arrow-proof helmet!'


-- Rincewind gives a speech on politics. (Terry 
Pratchett, _Interesting Times_)








[TurboGears] Re: Identity crisis

2006-01-07 Thread Jeff Watkins
Actually, I found the problem and it WAS in my code, only Kid made it 200 times more difficult to track down the problem. See my most recent message in the "SQLObject transaction problems" thread.I agree that debugging TurboGears applications is nightmarish at the moment. I can only hope that's going to improve. At least when I was doing JSPs, I had some prayer of knowing what line the error appeared on.On 7 Jan, 2006, at 7:31 pm, Cliff Wells wrote:Well, I think the real issue is that there are too many layers of abstraction and the real problem is getting obscured, hence my comment about finding raw SQL tempting.  One of the reasons I've resisted frameworks in the past is due to things like this.  When things work they are great, when they don't, debugging can be a nightmare.  In this case, the problem seems to stem from the fact that an exception occurred at some point, but database.py continues to try to clean up before letting the exception bubble up which in turn causes a different exception to get thrown and the original problem is lost.  I think that unless there's a good reason, I'd remove the rollback_all() from within the except block in run_with_transaction() as I suspect that to be the culprit, or perhaps just have it print the traceback *before* it tries to do anything else. import sys, tracebackdef run_with_transaction(func, *args, **kw):   try:       try:           retval = func(*args, **kw)           commit_all()           return retval       except cherrypy.HTTPRedirect:           commit_all()           raise       except cherrypy.InternalRedirect:           commit_all()           raise       except:           traceback.print_exc(file=sys.stdout)           rollback_all()           raise   finally:       end_all()Regards,Cliff --Jeff Watkinshttp://newburyportion.com/'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!'-- Rincewind gives a speech on politics. (Terry Pratchett, _Interesting Times_)   --Jeff Watkinshttp://newburyportion.com/'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!'-- Rincewind gives a speech on politics. (Terry Pratchett, Interesting Times) 

[TurboGears] Re: IdentityProvider plugins

2006-01-07 Thread Matthew Bevan

I've already modified my in-house SQLObject provider to have greater
control over the names of fields - I.e. if you want to use EMail as the
userId...

Also changed was the default encryption behavior, which includes a
rot13 tester, and encryption aliases (sha1 vs. sha, etc.).

def rot13(text):
   table = string.maketrans(
   'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM',
   'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
   return string.translate(text, table)


   algorithm= get(identity.soprovider.password_encryption, md5)
   if algorithm == md5:
   self.encrypt_password = lambda pw: 
 md5.new(pw).hexdigest()
   elif algorithm in (sha1, sha):
   self.encrypt_password = lambda pw: 
 sha.new(pw).hexdigest()
   elif algorithm in (plain, none, None):
   self.encrypt_password = lambda pw: pw
   elif algorithm in (rot13, caesar):
   self.encrypt_password = lambda pw: rot13(pw)
   else:
   raise identity.IdentityConfigurationException(Unknown 
 password encryption algorithm: %s % algorithm)

I'll finish it up today and post it up under several new tickets.



[TurboGears] Re: Identity crisis

2006-01-07 Thread Cliff Wells


Jeff Watkins wrote:
Actually, I found the problem and it WAS in my code, only Kid made it 
200 times more difficult to track down the problem. See my most recent 
message in the *SQLObject transaction problems thread.*


*I agree that debugging TurboGears applications is nightmarish at the 
moment. I can only hope that's going to improve. At least when I was 
doing JSPs, I had some prayer of knowing what line the error appeared on.*

*
*
Well, I still think that if cleanup is going to be done from with an 
except block that the original traceback needs to be printed/logged 
*prior* to anything else happening, i.e. as close to the point of 
failure as possible.  Consider:


 try:
... print x
... except:
... print y
... raise
...
Traceback (most recent call last):
 File stdin, line 4, in ?
NameError: name 'y' is not defined


The cause of the original error is lost.  Put that a few layers of 
abstraction down and you've got fun.  Better to do this:


 import sys, traceback
 try:
... print x
... except:
... traceback.print_exc(file = sys.stdout)
... print y
... raise
...
Traceback (most recent call last):
 File stdin, line 2, in ?
NameError: name 'x' is not defined
Traceback (most recent call last):
 File stdin, line 5, in ?
NameError: name 'y' is not defined


*Much* easier to track down.   I think a couple hours with grep 
searching for exception blocks and adding some code to print/log/save 
the traceback would go a long way to making debugging apps easier.  Of 
course, if you do much more than printing the exception, great care must 
be taken that *that* code doesn't raise an exception itself ;-)


Regards,
Cliff




[TurboGears] Re: Broken CatWalk

2006-01-07 Thread Ronald Jaramillo


Hi, r472 reverted the half patched js file back to r416, I will take  
a give the new diff attached to the ticked a try.

Cheers
Ronald

On Jan 8, 2006, at 1:30 AM, [EMAIL PROTECTED] wrote:



This is pre-emptive.

CatWalk was inadvertently broken in r460 because half of an unrelated
patch was applied.  It positively won't work with any sort of joins
until this is fixed (there is already a ticket about this, #372).   
From

the looks of it, all the changes in catwalk.js shouldn't be in r460.

Could someone with commit access take a look at this?

The unrelated patch was from ticket #349.  I think I fixed the  
problems

Ronald brought up there, but I'd like to hear back from him before I'd
recommend putting in the other half of the patch as opposed to taking
out the half that's already in there.




Ronald Jaramillo
mail: ronald AT checkandshare DOT com
blog: http://www.checkandshare.com/blog





[TurboGears] Re: IdentityProvider plugins

2006-01-07 Thread Leandro Lucarella

Matthew Bevan, el s�bado  7 de enero a las 16:53 me escribiste:
 Also changed was the default encryption behavior, which includes a
 rot13 tester, and encryption aliases (sha1 vs. sha, etc.).

I don't think adding aliases is a good thing (in this case). Is too simple
to make it complex, what if tomorrow is there a sha2 algorithm and someone
use just sha? It could be confusing and is harder to maintain and document
and there is no real gain in adding aliases IMHO...

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
 .,
  \  GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05 /
   ''
Si por el chancho fuera, se autocomería con chimichurri Worshestershire!


[TurboGears] Re: TurboGears new site look - let's get to it!

2006-01-07 Thread Karl Guertin

For those of you who are following this thread on google, Richard
posted rev 3 in an offshoot thread. Copied and pasted below. I'm happy
with it, so +1 and all that.

On January 6, 2006 Richard wrote:
 hmm, seems somewhat highjacked. I will post this here anyway

 - Designed to fit on 1024 width and centred on the page.
 - I know there is still no mailing list signup box, I'm trying to fit
 it in.

 http://koorb.co.uk/static/images/tglogos/layouts/blue-light-3.png


[TurboGears] IP IPSec Domain Names for Sale

2006-01-07 Thread invest06

These domains would be great for anyone that is starting their own IP
security service.

It would be a perfect namesake for any company or product.

From vulnerability scans to network analysis, these domains would be
great for any information security organization or consultant.


This auction for the Domain Names :

 i p s e c u r a .c o m - expires 9/30/2006

 i p s e c x . c o m - expires 9/30/2006

 i p s t i n g r a y . c o m - expires 9/30/2006

All Domains are registered through GoDaddy.com
No website included.
I will transfer domain ownership upon payment.

ON EBAY: Item number: 5851066170

http://cgi.ebay.com/ISP-IPSec-Router-Firewall-PIX-DOMAIN-NAMES-com_W0QQitemZ5851066170QQcategoryZ11153QQssPageNameZWDVWQQrdZ1QQcmdZViewItem



[TurboGears] Transactions problems, I think

2006-01-07 Thread Mike

Hello all,

Getting the following error after visiting my site, issuing a query on
the picture database, closing window, then re-visiting site.

Traceback (most recent call last):
  File
/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py,
line 271, in run
main()
  File
/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py,
line 502, in main
body = page_handler(*args, **cherrypy.request.paramMap)
  File /home/mikez0r/TG0.9/trunk/turbogears/controllers.py, line 240,
in newfunc
html, fragment, *args, **kw)
  File /home/mikez0r/TG0.9/trunk/turbogears/database.py, line 189, in
run_with_transaction
retval = func(*args, **kw)
  File /home/mikez0r/TG0.9/trunk/turbogears/controllers.py, line 262,
in _execute_func
return _process_output(tg_format, output, html, fragment)
  File /home/mikez0r/TG0.9/trunk/turbogears/controllers.py, line 62,
in _process_output
output = view.render(output, tg_format,
template=template,fragment=fragment)
  File /home/mikez0r/TG0.9/trunk/turbogears/view.py, line 57, in
render
return engine.render(info, format, fragment, template)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 136, in render
return t.serialize(encoding=self.defaultencoding, output=format,
fragment=fragment)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 232, in serialize
return serializer.serialize(self, encoding, fragment)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/serialization.py,
line 51, in serialize
text = list(self.generate(stream, encoding, fragment))
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/serialization.py,
line 316, in generate
stream = iter(stream)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 257, in __iter__
return iter(self.transform())
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 312, in transform
stream = self.pull()
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 271, in pull
self.initialize()
  File
/var/www/localhost/htdocs/gallerytest/gallerytest/templates/howdy.py,
line 19, in initialize
  File
/var/www/localhost/htdocs/gallerytest/gallerytest/templates/master.py,
line 19, in initialize
TypeError: 'NoneType' object is not callable



Currently, the only fix I've found is to re-start the project.

I'm guessing that I'm missing something to close the database
connection, and it's mucking things up.  Any suggestions?

applicable sections from controllers:

class Root(controllers.Root):
@turbogears.expose(html=gallerytest.templates.howdy)
def index(self):
weee='we'
return dict(weee=weee)




# Start pic display section
@turbogears.expose(html=gallerytest.templates.pics)
def pics(self,search_terms='',ppp=9,pagenum=0,loc_sub='',set_id=0):

if search_terms!='':
search_term_list = search_terms.replace(',','')
search_term_list = search_term_list.lower()
search_term_list = search_term_list.split()
union_set=[]
setlist=[]
for term in search_term_list:
idlist=[]
imgsearch=set(list(Searchtable.select(

OR(Searchtable.q.galleryterms.contains(term),
   
Searchtable.q.imageterms.contains(term)
for result in imgsearch:
idlist=idlist+[result.alt_ID]
setlist=setlist+[set(idlist)]
union_set=setlist[0]
for s in setlist:
union_set=union_set  s
idlist=str(union_set)[4:-1]
elif loc_sub!='':
idlist=[]

imgsearch=list(Photoinfo.select(Photoinfo.q.loc_sub==loc_sub))
for result in imgsearch:
idlist+=[result.alt_ID]

pagenum=int(pagenum)
start=pagenum*ppp
end=start+ppp

idlist=str(idlist)
idlist=idlist.strip('[]')
idlist=idlist.replace(',','')
newlist=idlist.split()
idlist=[]
for id in newlist:
idlist=idlist+[int(id)]

imgquery=[]
for id in idlist:
set_id=int(set_id)
set_id=set_id+1
set_id=str(set_id)
imgquery = imgquery + [{
'date':s.date,
 

[TurboGears] KID and Cheetah

2006-01-07 Thread Guyon Morée

What I like to know is what does TG use KID what it can't do with
Cheetah?

I think I've read somewhere that the widgets depend on KID

Are there any other features that do require KID?

cheers,
Guyon Moree
http://gumuz.looze.net/



[TurboGears] Re: Transactions problems, I think

2006-01-07 Thread Ksenia Marasanova

 Getting the following error after visiting my site, issuing a query on
 the picture database, closing window, then re-visiting site.

:(

There are more people who experience the same problem, check the
thread kid templates are a pain to debug.

 Currently, the only fix I've found is to re-start the project.

same here

 I'm guessing that I'm missing something to close the database
 connection, and it's mucking things up.  Any suggestions?

I think it's SQLObject related, but i can't find any solution either.


--
Ksenia


[TurboGears] Improper url mapping in cherryPy?

2006-01-07 Thread Aaron

In light of some of the recent discussions regarding the turbogears
community contributing to other projects I would like some feedback on
a cherryPy issue.

I have been playing with a turbogears based REST interface tp tagging:
http://tasty.python-hosting.com/ and ran into a possible bug in the way
cherryPy handles mapping URLS.

The basic format of the REST url looks like:
GET /service/servicename/user/username/item/itemname/

this works great for tagging my own content, such as
 POST
/service/photo_gallery/user/aaron/item/killington_2005/tag/vacation

but gets a bit ugly when dealing with tagging arbitrary content. For
example lets say I want to tag the following URL:
 http://www.killington.com/podcast/music/

If we take that item to be one part of the url then out url to post the
tags would be something like:

http://localhost:9980/service/test/user/aaron/item/http%3A%2F%2Fwww.killington.com%2Fpodcast%2Fmusic%2F/tag/vacation
   urllib.quote_plus('http://www.killington.com/podcast/music/')
  'http%3A%2F%2Fwww.killington.com%2Fpodcast%2Fmusic%2F'
seems ok, some potentially long URLs will be passed around, but it
looks like a sane plan.

Unfortunately cherryPy does not like that and returns a 404:
NotFound: 404: The path
'/service/test/user/aaron/item/http://www.killington.com
/podcast/music/tag/fred' was not found.
It looks like cherryPy unquotes the incoming URL and then splits it:
around line line 232 of _cphttptools.py
# Unquote the path (e.g. /this%20path - this path).
#
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2
# Note that cgi.parse_qs will decode the querystring for us.
path = urllib.unquote(path)

and a handful of lines later on gets the path
   scheme, location, p, pm, q, f = urlparse(path)
path = path[len(scheme + :// + location):]

 # Save original value (in case it gets modified by filters)
 request.path = request.originalPath = path


so ignoring the fact that I could not use strict rest and go for

http://localhost:9980/service/test/user/aaron?item=http%3A%2F%2Fwww.killington.com%2Fpodcast%2Fmusic%2Ftag=vacation
or md5 sum the item like:
http://del.icio.us/url/8b7fec48fcb35763c9f8e1a8061eb124
or maybe something simpler like soap...


Should cherryPy be patched to support the type of URL encoding I need?
I read the spec and I think cherry Py is actually doing the right thing
but when I run tests in Apache apache seems to not treat %2F as a path
separator.

Any thoughts on this?
1) Can/Should I legally encode urls like this?
2) Should cherryPy be patched?

Thanks,
-Aaron



[TurboGears] TurboGears + XUL ?

2006-01-07 Thread Alagu Madhu

I'm looking for TurboGears + XUL



[TurboGears] Re: TurboGears + XUL ?

2006-01-07 Thread David Stanek
On 1/8/06, Alagu Madhu [EMAIL PROTECTED] wrote:
I'm looking for TurboGears + XULAre you looking to produce XUL as output from a TurboGears app? If so I don't see why this would not work.

-- David