[turbogears-commits] [2033] projects/TGWidgets/trunk: Core widgets (Widget and WidgetRepeater) now use the 'tgwidgets' template engine as a default.

2006-10-30 Thread dangoor
Title: [2033] projects/TGWidgets/trunk: Core widgets (Widget and WidgetRepeater) now use the 'tgwidgets' template engine as a default.








Revision 2033
Author alberto
Date 2006-10-30 11:22:02 -0500 (Mon, 30 Oct 2006)


Log Message
Core widgets (Widget and WidgetRepeater) now use the 'tgwidgets' template engine as a default. This template engine is based on BuffetString and uses string.Template under the hood. Added a retrieve_resources method to widgets for retrieving all resources (both css  js) into a dict keyed by location. This should make inserting required resources into the template more straightforward in other frameworks besides TG.

Modified Paths

projects/TGWidgets/trunk/docs/index.txt
projects/TGWidgets/trunk/setup.py
projects/TGWidgets/trunk/tests/test_base.py
projects/TGWidgets/trunk/tests/test_forms.py
projects/TGWidgets/trunk/tests/test_resources.py
projects/TGWidgets/trunk/tgwidgets/core.py
projects/TGWidgets/trunk/tgwidgets/forms/fields.py
projects/TGWidgets/trunk/tgwidgets/resources.py
projects/TGWidgets/trunk/tgwidgets/view.py


Added Paths

projects/TGWidgets/trunk/tgwidgets/engine_plugin.py




Diff

Modified: projects/TGWidgets/trunk/docs/index.txt (2032 => 2033)

--- projects/TGWidgets/trunk/docs/index.txt	2006-10-29 18:26:05 UTC (rev 2032)
+++ projects/TGWidgets/trunk/docs/index.txt	2006-10-30 16:22:02 UTC (rev 2033)
@@ -25,6 +25,11 @@
 Templating engine which has a ``python.templating.engines`` entry point should be
 recognized.
 
+**UPDATE**: Default template engine for widgets is now 'tgwidgets' which is
+based on BuffetString and uses string.Template under the hood. TGWidgets can still
+use Genshi but they'll need to set their ``engine_name`` to ``genshi`` manually.
+All FormFields in ``tgwidgets.forms`` use Genshi as a default.
+
 Intermixing widgets in different template languages is currently tested for
 `Kid`_, `Genshi`_ and `Cheetah`_.
 
@@ -38,14 +43,12 @@
 run by cd'ing in that directory and running: ``./start-tgsample.py``. The app
 runs on port 8080 of the local host.
 
-TGWidgets has been developed by `Alberto Valverde`_ based on the work of the
+TGWidgets has been developed by `Alberto Valverde González`_ based on the work of the
 many people involved in developing, testing and designing TurboGears's Widgets.
 Specially the great work **Michele Cella** did in the original Widgets.
 
-.. _Alberto Valverde: mailto:[EMAIL PROTECTED]
+TGWidgets is released under the `MIT License`_.
 
-It's released under the MIT License.
-
 Download
 
 
@@ -166,6 +169,8 @@
 still missing. I'd appreciate any colaboration in this area of the project ;) 
 (or in any other).
 
+.. _Alberto Valverde González: mailto:[EMAIL PROTECTED]
+.. _MIT License: http://www.opensource.org/licenses/mit-license.php
 .. _FormEncode: http://formencode.org
 .. _RuleDispatch: http://peak.telecommunity.com/
 .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools


Modified: projects/TGWidgets/trunk/setup.py (2032 => 2033)

--- projects/TGWidgets/trunk/setup.py	2006-10-29 18:26:05 UTC (rev 2032)
+++ projects/TGWidgets/trunk/setup.py	2006-10-30 16:22:02 UTC (rev 2033)
@@ -35,4 +35,8 @@
 namespace_packages = ['tgwidgets', 'tgwidgets.mods'],
 include_package_data=True,
 zip_safe=False,
+entry_points=
+[python.templating.engines]
+tgwidgets = tgwidgets.engine_plugin:TGWidgetsTemplatePlugin
+,
 )


Modified: projects/TGWidgets/trunk/tests/test_base.py (2032 => 2033)

--- projects/TGWidgets/trunk/tests/test_base.py	2006-10-29 18:26:05 UTC (rev 2032)
+++ projects/TGWidgets/trunk/tests/test_base.py	2006-10-30 16:22:02 UTC (rev 2033)
@@ -16,6 +16,7 @@
 py:attrs=dct
 span py:for="" in lst py:replace=i /
 /div
+engine_name = 'genshi'
 lst = []
 dct = {}
 def __init__(self, *args, **kw):
@@ -85,6 +86,7 @@
 xmlns=http://www.w3.org/1999/xhtml
 xmlns:py=http://genshi.edgewall.org/
 h1${foo1}/h1h2${foo2}/h2/div
+engine_name = 'genshi'
 
 def test_default_params(self):
 self.assertInOutput(['h1foo/h1', 'h2foo/h2'])
@@ -132,6 +134,7 @@
 class TestWidget(Widget):
 template = 
 div${children.fs.display(value_for('fs'), **args_for('fs'))}/div 
+engine_name = 'genshi'
 
 class Repeater(WidgetRepeater):
 max_repetitions = 5
@@ -145,6 +148,7 @@
 input id=${id} value=${value} test=${test} /
 
 children = [Inner('foo'),Inner('bar')]
+engine_name = 'genshi'
 template = 
 fieldset id=${id} legend=${legend}
 xmlns=http://www.w3.org/1999/xhtml
@@ -254,6 +258,7 @@
 li py:for="" in children py:replace=c.display(**args_for(c)) /
 /ul
 
+engine_name = 'genshi'
 children = [Inner('foo'),Inner('bar')]
 
 def test_children_receive_args(self):
@@ -275,6 

[turbogears-commits] [2034] branches/1.0/turbogears/qstemplates/quickstart/+package+/model.py_tmpl: clean model import order

2006-10-30 Thread dangoor
Title: [2034] branches/1.0/turbogears/qstemplates/quickstart/+package+/model.py_tmpl: clean model import order








Revision 2034
Author fredlin
Date 2006-10-30 20:47:11 -0500 (Mon, 30 Oct 2006)


Log Message
clean model import order

Modified Paths

branches/1.0/turbogears/qstemplates/quickstart/+package+/model.py_tmpl




Diff

Modified: branches/1.0/turbogears/qstemplates/quickstart/+package+/model.py_tmpl (2033 => 2034)

--- branches/1.0/turbogears/qstemplates/quickstart/+package+/model.py_tmpl	2006-10-30 16:22:02 UTC (rev 2033)
+++ branches/1.0/turbogears/qstemplates/quickstart/+package+/model.py_tmpl	2006-10-31 01:47:11 UTC (rev 2034)
@@ -2,26 +2,26 @@
 from datetime import datetime
 #end if
 #if $sqlalchemy != True
+from turbogears.database import PackageHub
 from sqlobject import *
 #else
+from turbogears.database import metadata, session
 from sqlalchemy import *
 #end if
 #if $identity != none
 from turbogears import identity 
 #end if
+
 #if $sqlalchemy != True
-from turbogears.database import PackageHub
 hub = PackageHub(${package})
 __connection__ = hub
-#else
-from turbogears.database import metadata, session
 #end if
+
 #if $sqlalchemy!=True
-
 # class YourDataClass(SQLObject):
 # pass
+#end if
 
-#end if
 #if $identity==sqlobject
 ###
 # identity models.





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group.  To post to this group, send email to turbogears-commits@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/turbogears-commits  -~--~~~~--~~--~--~---





[turbogears-commits] [2035] trunk/turbogears/qstemplates/quickstart/+package+/model.py_tmpl: merge [2034] from 1.0

2006-10-30 Thread dangoor
Title: [2035] trunk/turbogears/qstemplates/quickstart/+package+/model.py_tmpl: merge [2034] from 1.0








Revision 2035
Author fredlin
Date 2006-10-30 20:48:01 -0500 (Mon, 30 Oct 2006)


Log Message
merge [2034] from 1.0

Modified Paths

trunk/turbogears/qstemplates/quickstart/+package+/model.py_tmpl




Diff

Modified: trunk/turbogears/qstemplates/quickstart/+package+/model.py_tmpl (2034 => 2035)

--- trunk/turbogears/qstemplates/quickstart/+package+/model.py_tmpl	2006-10-31 01:47:11 UTC (rev 2034)
+++ trunk/turbogears/qstemplates/quickstart/+package+/model.py_tmpl	2006-10-31 01:48:01 UTC (rev 2035)
@@ -2,26 +2,26 @@
 from datetime import datetime
 #end if
 #if $sqlalchemy != True
+from turbogears.database import PackageHub
 from sqlobject import *
 #else
+from turbogears.database import metadata, session
 from sqlalchemy import *
 #end if
 #if $identity != none
 from turbogears import identity 
 #end if
+
 #if $sqlalchemy != True
-from turbogears.database import PackageHub
 hub = PackageHub(${package})
 __connection__ = hub
-#else
-from turbogears.database import metadata, session
 #end if
+
 #if $sqlalchemy!=True
-
 # class YourDataClass(SQLObject):
 # pass
+#end if
 
-#end if
 #if $identity==sqlobject
 ###
 # identity models.





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group.  To post to this group, send email to turbogears-commits@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/turbogears-commits  -~--~~~~--~~--~--~---





[turbogears-commits] [2037] projects/TGWidgets/trunk: Removing JS and forms stuff from TGWidgets

2006-10-30 Thread dangoor
Title: [2037] projects/TGWidgets/trunk: Removing JS and forms stuff from TGWidgets








Revision 2037
Author alberto
Date 2006-10-31 01:38:05 -0500 (Tue, 31 Oct 2006)


Log Message
Removing JS and forms stuff from TGWidgets

Modified Paths

projects/TGWidgets/trunk/docs/tgwidgets.txt
projects/TGWidgets/trunk/examples/tgsample/setup.py
projects/TGWidgets/trunk/examples/tgsample/tgsample/templates/master.kid
projects/TGWidgets/trunk/examples/tgsample/tgsample/widgets.py
projects/TGWidgets/trunk/setup.py
projects/TGWidgets/trunk/tests/__init__.py
projects/TGWidgets/trunk/tests/test_base.py
projects/TGWidgets/trunk/tests/test_render.py
projects/TGWidgets/trunk/tests/test_resources.py
projects/TGWidgets/trunk/tgwidgets/api.py
projects/TGWidgets/trunk/tgwidgets/core.py
projects/TGWidgets/trunk/tgwidgets/engine_plugin.py
projects/TGWidgets/trunk/tgwidgets/mods/tg.py
projects/TGWidgets/trunk/tgwidgets/view.py


Added Paths

projects/TGWidgets/trunk/tgwidgets/testutil.py


Removed Paths

projects/TGWidgets/trunk/tests/test_forms.py
projects/TGWidgets/trunk/tests/test_forms.txt
projects/TGWidgets/trunk/tests/test_js_interface.txt
projects/TGWidgets/trunk/tests/util.py
projects/TGWidgets/trunk/tgwidgets/forms/
projects/TGWidgets/trunk/tgwidgets/js_interface.py
projects/TGWidgets/trunk/tgwidgets/static/
projects/TGWidgets/trunk/tgwidgets/widgets.py




Diff

Modified: projects/TGWidgets/trunk/docs/tgwidgets.txt (2036 => 2037)

--- projects/TGWidgets/trunk/docs/tgwidgets.txt	2006-10-31 06:38:05 UTC (rev 2036)
+++ projects/TGWidgets/trunk/docs/tgwidgets.txt	2006-10-31 06:38:05 UTC (rev 2037)
@@ -3,8 +3,7 @@
 
 Let's start declaring some widgets:
 
- from tgwidgets.api import Widget, WidgetRepeater, engines, Child
- engines.load_all()
+ from tgwidgets.api import Widget, WidgetRepeater, Child
  class MyFieldSet(Widget):
 ... children = [
 ... Child(Widget, foo, d=1),


Modified: projects/TGWidgets/trunk/examples/tgsample/setup.py (2036 => 2037)

--- projects/TGWidgets/trunk/examples/tgsample/setup.py	2006-10-31 06:38:05 UTC (rev 2036)
+++ projects/TGWidgets/trunk/examples/tgsample/setup.py	2006-10-31 06:38:05 UTC (rev 2037)
@@ -18,6 +18,7 @@
 
 install_requires = [
 TurboGears = 0.9a9dev-r1939,
+TGWidgetsForms,
 ],
 scripts = [start-tgsample.py],
 zip_safe=False,


Modified: projects/TGWidgets/trunk/examples/tgsample/tgsample/templates/master.kid (2036 => 2037)

--- projects/TGWidgets/trunk/examples/tgsample/tgsample/templates/master.kid	2006-10-31 06:38:05 UTC (rev 2036)
+++ projects/TGWidgets/trunk/examples/tgsample/tgsample/templates/master.kid	2006-10-31 06:38:05 UTC (rev 2037)
@@ -1,7 +1,7 @@
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
 ?python 
 import sitetemplate 
-from tgwidgets.widgets import dynamic_resources
+from tgwidgets.js_interface import dynamic_resources
 ?
 html xmlns=http://www.w3.org/1999/xhtml xmlns:py=http://purl.org/kid/ns# py:extends=sitetemplate
 


Modified: projects/TGWidgets/trunk/examples/tgsample/tgsample/widgets.py (2036 => 2037)

--- projects/TGWidgets/trunk/examples/tgsample/tgsample/widgets.py	2006-10-31 06:38:05 UTC (rev 2036)
+++ projects/TGWidgets/trunk/examples/tgsample/tgsample/widgets.py	2006-10-31 06:38:05 UTC (rev 2037)
@@ -4,12 +4,11 @@
 from turbogears.validators import *
 
 # Import some stuff we need from the widget API
-from tgwidgets.api import WidgetsList, CSSSource, JSSource, \
-  js_function_adapter, js_function
+from tgwidgets.api import WidgetsList, CSSSource, JSSource
+from tgwidgets.js_interface import js_function_adapter, js_function, mochikit
 
 # Let's import all the form fields so we can play with them
 from tgwidgets.forms import *
-from tgwidgets.widgets import mochikit
 
 
 


Modified: projects/TGWidgets/trunk/setup.py (2036 => 2037)

--- projects/TGWidgets/trunk/setup.py	2006-10-31 06:38:05 UTC (rev 2036)
+++ projects/TGWidgets/trunk/setup.py	2006-10-31 06:38:05 UTC (rev 2037)
@@ -13,7 +13,7 @@
 
 execfile(os.path.join(tgwidgets, release.py))
 
-PACKAGES = ['tgwidgets', 'tgwidgets.forms', 'tgwidgets.mods']
+PACKAGES = ['tgwidgets', 'tgwidgets.mods']
 
 setup(
 name=__PACKAGE_NAME__,
@@ -22,8 +22,6 @@
 long_description = __LONG_DESCRIPTION__,
 install_requires=[
 'RuleDispatch',
-'FormEncode',
-'Genshi',
 'Paste',
 ],
 url = ""
@@ -34,7 +32,6 @@
 packages = PACKAGES,
 namespace_packages = ['tgwidgets', 'tgwidgets.mods'],
 include_package_data=True,
-zip_safe=False,
 entry_points=
 [python.templating.engines]
 tgwidgets = tgwidgets.engine_plugin:TGWidgetsTemplatePlugin


Modified: projects/TGWidgets/trunk/tests/__init__.py (2036 => 2037)

--- projects/TGWidgets/trunk/tests/__init__.py	2006-10-31 06:38:05 UTC (rev 2036)
+++ projects/TGWidgets/trunk/tests/__init__.py	2006-10-31 06:38:05 UTC (rev 2037)
@@ 

[turbogears-commits] [2040] projects/TGWidgetsForms/trunk/setup.py: Forgot to add FormEncode to TGWidegstForms install_requires

2006-10-30 Thread dangoor
Title: [2040] projects/TGWidgetsForms/trunk/setup.py: Forgot to add FormEncode to TGWidegstForms install_requires








Revision 2040
Author alberto
Date 2006-10-31 01:46:26 -0500 (Tue, 31 Oct 2006)


Log Message
Forgot to add FormEncode to TGWidegstForms install_requires

Modified Paths

projects/TGWidgetsForms/trunk/setup.py




Diff

Modified: projects/TGWidgetsForms/trunk/setup.py (2039 => 2040)

--- projects/TGWidgetsForms/trunk/setup.py	2006-10-31 06:38:23 UTC (rev 2039)
+++ projects/TGWidgetsForms/trunk/setup.py	2006-10-31 06:46:26 UTC (rev 2040)
@@ -23,6 +23,7 @@
 install_requires=[
 'TGWidgets',
 'TGWidgetsJS',
+'FormEncode',
 'Genshi',
 ],
 url = ""





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group.  To post to this group, send email to turbogears-commits@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/turbogears-commits  -~--~~~~--~~--~--~---





[turbogears-commits] [2041] projects/TGWidgets/trunk/tgwidgets/core.py: Fixed arg names in adapt_value

2006-10-30 Thread dangoor
Title: [2041] projects/TGWidgets/trunk/tgwidgets/core.py: Fixed arg names in adapt_value








Revision 2041
Author alberto
Date 2006-10-31 01:55:01 -0500 (Tue, 31 Oct 2006)


Log Message
Fixed arg names in adapt_value

Modified Paths

projects/TGWidgets/trunk/tgwidgets/core.py




Diff

Modified: projects/TGWidgets/trunk/tgwidgets/core.py (2040 => 2041)

--- projects/TGWidgets/trunk/tgwidgets/core.py	2006-10-31 06:46:26 UTC (rev 2040)
+++ projects/TGWidgets/trunk/tgwidgets/core.py	2006-10-31 06:55:01 UTC (rev 2041)
@@ -400,9 +400,9 @@
 from the instance or the class.
 
 Any function listed at `params` which can be called without arguments
-will be automatically called to fetch fresh results on every request. Parameters
-not found either on the class, the instance or the keyword args to `display` or
-`render` will be set to None.
+will be automatically called to fetch fresh results on every request. 
+Parameters not found either on the class, the instance or the keyword 
+args to `display` or `render` will be set to None.
 
  class MyWidget(Widget):
 ... params = [foo, bar, null]
@@ -526,18 +526,18 @@
 @adapt_value.when(
 isinstance (value, (dict,list,basestring,int)) or value is None
 )
-def __adapt_value_passthrough(widget, value):
+def __adapt_value_passthrough(self, value):
 return value
 
 @adapt_value.when(strategy.default)
-def __adapt_value_default(widget, value):
+def __adapt_value_default(self, value):
 
 By default, we grab all attributes from value which match the widget's
 child's ids. If no attribute is found no key will be created.
 
 return dict([
 (w._id, getattr(value, w._id)) 
-for w in widget.children if hasattr(value, w._id)
+for w in self.children if hasattr(value, w._id)
 ])
 
 adapt_value = Widget.adapt_value.im_func





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group.  To post to this group, send email to turbogears-commits@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/turbogears-commits  -~--~~~~--~~--~--~---





[tg-tickets] Re: [TurboGears] #1156: Improve error reporting in Genshi templates

2006-10-30 Thread TurboGears
#1156: Improve error reporting in Genshi templates
-+--
 Reporter:  talin|Owner:  anonymous
 Type:  enhancement  |   Status:  new  
 Priority:  normal   |Milestone:   
Component:  genshi   |  Version:  trunk
 Severity:  minor|   Resolution:   
 Keywords:   |  
-+--
Comment (by talin):

 Ugh. I don't have the erroneous template any more. This error (and many
 others like it) occurred as I was trying to migrate my app's old Kid-based
 templates to Genshi, specifically where I was trying to remove the
 ?python blocks that are no longer supported. So I have the old Kid-based
 ones, and the new Genshi based ones, both of which work, but I don't have
 the intermediate ones that produced this particular dump. But if I recall
 correctly, the eventual cause of this error turned out to be a bad 'dot'
 access inside a py:for loop - accessing a series of SQL object foreign
 keys from within a template, where the object being iterated was
 incorrectly set.

 One obsevation I had is that unlike normal template development where
 templates and expressions are built up incrementally, I was taking complex
 pre-existing templates and porting them over wholesale, and it felt like I
 was running into a different set of errors and exceptions than I would
 encounter in normal development, and these exceptions weren't being as
 robustly handled as the other.

 I didn't feel (at the time) that the specifics of the error itself were
 important - the main point is, that while most template errors were
 getting caught by Genshi and reported as template errors (with annotations
 as to line number and template name), a few errors were slipping through
 and propagating all the way to the top, with no annotation information. In
 this particular case, it took me a while to even determine which template
 source file was the cause of the error, let alone what line number.

 I'm sorry I don't have more detail - I might be able to reproduce a
 similar situation if you need it. (I suppose you do - otherwise, there's
 no way to validate the closing of this bug.)

 The version of Genshi was obtained by checking out the TG trunk from svn,
 and then doing an easy_install . (I did have to install TurboJson
 manually however.)

-- 
Ticket URL: http://trac.turbogears.org/turbogears/ticket/1156
TurboGears http://www.turbogears.org/
TurboGears front-to-back web development
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Tickets group.
To post to this group, send email to turbogears-tickets@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~--~~~~--~~--~--~---



[tg-tickets] Re: [TurboGears] #1139: [PATCH] SQLObject bug in handling of non default foreign keys

2006-10-30 Thread TurboGears
#1139: [PATCH] SQLObject bug in handling of non default foreign keys
---+
 Reporter:  trlandet   |Owner:  anonymous
 Type:  defect |   Status:  closed   
 Priority:  normal |Milestone:  1.0b2
Component:  SQLObject  |  Version:  1.0b1
 Severity:  normal |   Resolution:  fixed
 Keywords:  regression, patch  |  
---+
Changes (by trlandet):

  * status:  new = closed
  * resolution:  = fixed

Comment:

 Fixed upstream in SQLObject

-- 
Ticket URL: http://trac.turbogears.org/turbogears/ticket/1139
TurboGears http://www.turbogears.org/
TurboGears front-to-back web development
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Tickets group.
To post to this group, send email to turbogears-tickets@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~--~~~~--~~--~--~---



[tg-trunk] Re: Remember Me patch for identity

2006-10-30 Thread Kevin Horn
On 10/28/06, Nadav Samet [EMAIL PROTECTED] wrote:
Can anyone advice if this is a security risk to accept both encrypted password and the plain-text one?I would advise against it...If the provider accepts an encrypted password, it's pretty much the same as sending a plain-text password. Why bother encrypting the password, if it gets sent over the wire and stored in the database in a form that someone can just grab and use?
This is why Remember Me links are evil...of course that doesn't stop clietns from requesting them.sighYou might try storing some other information in the cookie, like maybe encrypting the encrypted password, or something...but tehre's really not a good way to do this securely AFAIK. If you have Remember Me functionality, security pretty much goes out the window.
Kevin H.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups TurboGears Trunk group.  To post to this group, send email to turbogears-trunk@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/turbogears-trunk  -~--~~~~--~~--~--~---


[tg-trunk] Re: packaging change

2006-10-30 Thread Alastair Houghton

On 29 Oct 2006, at 19:20, Kevin Dangoor wrote:

 People are already running a mix of the old (SQLObject and Kid) and
 the new (SQLAlchemy and Genshi). In the time between the 1.0 and
 (next major) release, the balance will likely shift over time toward
 the new.

 I'd like to start supporting that starting with 1.0b2.

[snip]

 Here's the good bit: tgsetup.py will install TurboGears[standard]
 automatically. tgsetup.py --future will install the future version
 of TurboGears.

 I'd like to see the installation instructions for 1.0b2 change to:

 1. Install Python
 2. Download tgsetup.py
 3. python tgsetup.py

 For this to happen, tgsetup.py needs to grow a little more smarts to
 detect the need for sudo and to install the tg-admin script in the
 right place.

+1

This sounds like an excellent idea.

BTW, as you're talking about detecting the need for sudo and the  
suchlike, on Mac OS X, I tend to prefer setting my PATH to include  
the bin folder in the Python framework, rather than installing the  
binary files that live in there into /usr/local/bin (for instance).   
Maybe some users would like the option to make a symlink, however.

Kind regards,

Alastair.

--
http://alastairs-place.net



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Trunk group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~--~~~~--~~--~--~---



[tg-trunk] Re: packaging change

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 7:21 AM, Alastair Houghton wrote:

 BTW, as you're talking about detecting the need for sudo and the
 suchlike, on Mac OS X, I tend to prefer setting my PATH to include
 the bin folder in the Python framework, rather than installing the
 binary files that live in there into /usr/local/bin (for instance).
 Maybe some users would like the option to make a symlink, however.

My plan would be to default script-dir to /usr/local/bin on macs. It  
can still be overridden in the various ways it can be overridden today.

Kevin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Trunk group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~--~~~~--~~--~--~---



[tg-trunk] Re: packaging change

2006-10-30 Thread Mark Ramm

+1.

I think this is great, and it makes the future transitions even easier
for lots of people.

 1. Install Python
 2. Download tgsetup.py
 3. python tgsetup.py

My only nit pick would be that we probably want to sent people to add:

4. Install and configure a database engine and python drivers

Then we need to make some reasonable docs for step 4 -- ;)

This is the step that seems to catch the most people in my experience.
 And while it's not TurboGears specific, it's still worth making the
hardest part as easy as possible.

-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Trunk group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~--~~~~--~~--~--~---



[TurboGears] script src=....

2006-10-30 Thread Jose Soares

Hi all,

May someone help me calling javascript functions?

In my edit.kid I would like to insert a javascript function like this:
script
  function help(){
 alert ('Ciao')
  }
/script

This one works, but if I move the function to a file into 
myproject/static/javascript/help.js
it doesn't work anymore.

This is my definition in my edit.kid:
head
  script type=text/javascript src=/static/javascript/help.js/script
/head

What's wrong with it?

jo





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread percious

Definitely Cool to see if any of y'all live nearby.  Jorge just posted
up on this but here is the frappr for TG:

http://www.frappr.com/turbogears/map


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Startup/restart time

2006-10-30 Thread Steve Holden

Is it just me, or does CherryPy take a *really* long time to start up 
and restart?

regards
  Steve
-- 
Steve Holden   +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd  http://www.holdenweb.com
Skype: holdenweb   http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: script src=....

2006-10-30 Thread Jorge Godoy

Jose Soares [EMAIL PROTECTED] writes:

 Hi all,

 May someone help me calling javascript functions?

 In my edit.kid I would like to insert a javascript function like this:
 script
   function help(){
  alert ('Ciao')
   }
 /script

 This one works, but if I move the function to a file into 
 myproject/static/javascript/help.js
 it doesn't work anymore.

 This is my definition in my edit.kid:
 head
   script type=text/javascript src=/static/javascript/help.js/script
 /head

 What's wrong with it?

From the snippet above nothing.

Maybe if you send to the list a more complete example we can see what is
wrong. 

-- 
Jorge Godoy  [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: script src=....

2006-10-30 Thread Ian Wilson

What do you mean by doesn't work?  The file isn't being included or
the function has errors?

Ill just guess the file isn't being included.  What happens when you
go directly to the file in the browser?

For example if you are running your server at localhost:8080 then try going to
http://localhost:8080/static/javascript/help.js

The file should show up.  If it does not then the file isn't being
found and maybe you should check that the name and permissions of the
file are correct.

Also I think you should have this in either your app.cfg(mine is
located in /project/config/app.cfg or your dev.cfg/prod.cfg located in
your project's root directory.

[/static]
static_filter.on = True
static_filter.dir = %(top_level_dir)s/static

Good luck.

-Ian

On 10/30/06, Jose Soares [EMAIL PROTECTED] wrote:

 Hi all,

 May someone help me calling javascript functions?

 In my edit.kid I would like to insert a javascript function like this:
 script
   function help(){
  alert ('Ciao')
   }
 /script

 This one works, but if I move the function to a file into
 myproject/static/javascript/help.js
 it doesn't work anymore.

 This is my definition in my edit.kid:
 head
   script type=text/javascript src=/static/javascript/help.js/script
 /head

 What's wrong with it?

 jo





 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: toolbox widget development woes

2006-10-30 Thread Diez B. Roggisch

 I am with Jorge on this one, while you are testing it just use a kid
 page that displays the widget. Automatically solves the reloading and
 too-much-stuff-on-a-page issues. AFAIK there has been discussion about
 putting some pagination on the widget list, but that will be in an
 upcoming release at the earliest.

How to do so? Did you already try a 

tg-admin quickstart -t tgwidget

yourself? If not - you maybe aren't aware that there is no start-script 
whatsoever, you basically create an egg. 

Of course I can create a new webapplication just for testing my widget 
project. But first of all, the toolbox widget list mechanisms already _allow_ 
for convenient, self-embedded rendering. There is everything available 
already. And as my answer to my own post says, obviously somebody also felt 
the need to restrict the display of widgets to just one. And second, it would 
render the whole approach somewhat moot if I need a special webapp to test a 
widget, then I'd just go for the webapp.

Beside that, both approaches won't help with the 
reloading-on-code-change-issue, if I'm not  mistaken. Because a type 
tgwidget-application is basically a deployed egg, and just as touching any 
file in the python distro doesn't trigger a reload, changing the egg-contents 
won't do that as well (unless one takes special measures).

To summarize: I think having a convenient testbed for widget development would 
be a good idea. I don't care too much about where it lives, but if it _is_ 
integrated in the toolbox, the advantage to me clearly is that a developer is 
more encouraged to package her widget to be usable out-of-the-box.

Diez

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Row level security in sqlobject

2006-10-30 Thread Jorge Godoy

Gregor Horvath [EMAIL PROTECTED] writes:

 I have the need for such a row level security in my current project, so
 I implemented a thin layer above sqlobject. (There is no change in
 SQLObject itself)

 If someone is interested, I am willing to share the code.

I am.  :-)  You can use TG's wiki to share content like this.

 It's implemented like the Unix access file rights.
 Each database row has an owner and a group and read/write access rights
 for the owner/group/others.

 If you don't have the proper rights, selects don't return the row (like
 in Oracles row level security).

I see.  And it should be easily adaptable to something like auto-filtering by
customer_id, project_id, etc., right?  I believe that both use cases are very
similar... 

 If a turbogears identity is present the user and groups information is
 taken from there, if not the information is required in the select's
 call. But there is no integration with TG's permissions.

So it's a cascade: 

   - TG's permissions apply first to allow acessing classes / methods
   - row level ACLs are applied to allow retrieving that row

 It's not complete but a beginning and enough for my current project.

Will you implement INSERT / UPDATE / DELETE?  From the above I am supposing
you just have it for SELECTs... 

Those would be cool to have and might make adjusting permissions easier... 


/me dreams of SGID tables...  :-)


-- 
Jorge Godoy  [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread John M Camara

Sounds like we need a small TG app on the TurboGears web site for
people to meet each other.  An app that integrates Google maps, a
forum, and similar to meetup.com.

This could be a nice project for the upcoming TurboGears Jam -
http://mindview.net/Conferences/TurboGearsJam/.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread John M Camara

No.  It's not just you.  I started to collect some profile data the
other day to see what I could do but found out that I need to get a
little more familiar with TG/CherryPy internals first.  From looking at
the data it looks like there are many opportunities for improvements as
some of the call counts are astronomically high.

As time permits I will continue to investigate and submit some patches.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Install problem on Windows XP

2006-10-30 Thread cwurld

Hi,

I tried posting this a few hours ago, but it did not appear, so I will
try again. Sorry if it appears twice.

I am trying to install Turbogears 1.0b1 on windows XP. This is a new
install. I already had python 2.4. Everything seems to install.
tg-admin.exe appears in the scripts folder. But when I run tg-admin
info from the command line the disk drive whirls for a few seconds,
but there is no output and I end up back at the command prompt.

Any suggestions?

Thanks,
cwurld


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] FileField not preserving value after error

2006-10-30 Thread Sanjay

I have a form with a FileField. After a validation error or exception
occurs, the field is not preserving the old path name, but is becoming
blank. Pondering whether it the expected behaviour, or I might be
missing something...

thanks
sanjay


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Another spammer on the list?

2006-10-30 Thread Jorge Vargas

yesterday I reply to a couple of messages and I got this from all of
them. I know my messages did go to the list because Adam reply to this
one today.

is anyone else getting this too?

-- Forwarded message --
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Oct 30, 2006 1:30 AM
Subject: Error Mail
To: [EMAIL PROTECTED]


The original message was received at 200610301430553
[EMAIL PROTECTED]
We failed to deliver mail. Recipient suspend the service. [EMAIL PROTECTED]



Final-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.1



-- Forwarded message --
From: Jorge Vargas [EMAIL PROTECTED]
To: turbogears@googlegroups.com
Date: Mon, 30 Oct 2006 05: 29: 43 +
Subject: [TurboGears] Re: toolbox widget development woes

On 10/29/06, Diez B. Roggisch [EMAIL PROTECTED] wrote:

 Hi,

 I'm trying to develop a standalone-widget for the first time, and I'm
 having some difficulties.

 Embedding my new widget automatically within the toolbox widget browser
 works fine. However, 2 things annoy me:

   - there is no automatic cherrypy-restart when altering my widget's
 code. So I have to restart often.

I don't undestand why you need this widget browser is supposed to be a
demo of all the widgets for other people.

   - I always have to load the whole widget list, even though I'm only
 interested in _one_ widget

what will be the point of using the widget browser if you only want one widget?

 So is there a way to restrict the display of the widgets to just one (or
 maybe several, though I'm not to keen about that)

 And can the cherrypy reloading-support be configured for widget testing
 as well?

why don't you just make a kid file that will have only one line to
call widget.display() ?

 Thanks,

 Diez

 



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] how to retrieve cherrypy REQUEST informations

2006-10-30 Thread Jose Soares

Hi all,

I would like to know how to retrieve the cherrypy informations like
the query_string of url, the server_url, the authenticated_user, 
cookies, etc.
Something like the Zope REQUEST.
---
QUERY_STRING'PIPPO=ASSNOME=ASASAS'
AUTHENTICATED_USER  jojo
URL 'http://www.matreco.com//matreco/my'
URL2'http://www.matreco.com/'
VirtualRootPhysicalPath ('',)
SERVER_URL  'http://www.matreco.com/'
AUTHENTICATION_PATH ''
URL1'http://www.matreco.com//matreco'
BASE1   'http://www.matreco.com/'
URL0http://www.matreco.com//matreco/my
BASE0   http://www.matreco.com/

HTTP_X_FORWARDED_SERVER 'www.matreco.com'
HTTP_COOKIE 'tip=; daavt=; marclne=; not=; key=; csc=; 
dtpa=; mod=0'
HTTP_ACCEPT_LANGUAGE'it-it,it;q=0.8,en-us;q=0.5,en;q=0.3'
REQUEST_METHOD  'GET'
PATH_INFO   '/matreco/my'
SERVER_PROTOCOL 'HTTP/1.1'
QUERY_STRING'PIPPO=ASSNOME=ASASAS'
HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.0.5) 
Gecko/20060731 Ubuntu/dapper-security Firefox/
SERVER_NAME 'bandon.sofonia.com'
REMOTE_ADDR '127.0.0.1'
PATH_TRANSLATED '/matreco/my'
SERVER_PORT '8080'
HTTP_HOST   'localhost:8080'
GATEWAY_INTERFACE   'CGI/1.1'
HTTP_X_FORWARDED_HOST   'www.matreco.com'
HTTP_ACCEPT_ENCODING'gzip,deflate'



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] frappr map Was: [TurboGears] trying to meet python/turbogears users in my area

2006-10-30 Thread Jorge Vargas

Hello I just remember about this

http://www.frappr.com/turbogears/map

it's old from the 0.8 days or something

you may want to check it out see ya :)

On 10/29/06, Michael Steinfeld [EMAIL PROTECTED] wrote:
 Hi,

 It's probably a long shot, but I am in Sarasota Florida (hour south of
 Tampa) and would like to form a users group or even just meet for coffee
 with other people interested in TurboGears and Python.

 If you are interested please let me know.



 --
 -mike


  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread gasolin

After traced code I found tgquickstart() just import 'all' cherrypy and
turbogears modules instead of import 'required' modules only, maybe its
one of the problems


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Dianne Marsh

John,

I agree!  I think that's a FABULOUS idea for the TurboGears Jam!

Hope to see you there!
Dianne


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] how to retrieve cherrypy REQUEST informations

2006-10-30 Thread Jose Soares

Hi all,

I would like to know how to retrieve the cherrypy informations like
the query_string of url, the server_url, the authenticated_user, 
cookies, etc.
Something like the Zope REQUEST.
---
QUERY_STRING'PIPPO=ASSNOME=ASASAS'
AUTHENTICATED_USER  jojo
VirtualRootPhysicalPath ('',)
AUTHENTICATION_PATH ''

HTTP_COOKIE 'tip=; daavt=; marclne=; not=; key=; csc=; 
dtpa=; mod=0'
HTTP_ACCEPT_LANGUAGE'it-it,it;q=0.8,en-us;q=0.5,en;q=0.3'
REQUEST_METHOD  'GET'
PATH_INFO   '/matreco/my'
SERVER_PROTOCOL 'HTTP/1.1'
QUERY_STRING'PIPPO=ASSNOME=ASASAS'
HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.0.5) 
Gecko/20060731 Ubuntu/dapper-security Firefox/
SERVER_NAME 'bandon.sofonia.com'
REMOTE_ADDR '127.0.0.1'
PATH_TRANSLATED '/matreco/my'
SERVER_PORT '8080'
HTTP_HOST   'localhost:8080'
GATEWAY_INTERFACE   'CGI/1.1'
HTTP_ACCEPT_ENCODING'gzip,deflate'

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] SQLObject and func

2006-10-30 Thread Patrick Coleman

Hi,

[Apologies if this is a double post, I don't think the first one made
it]

I need to run the PASSWORD() function on the database server and
retrieve the result. I have managed to get this working, with the
following code:

import model
from sqlobject.sqlbuilder import Select, func

conn = model.Users._connection
result =
conn.queryAll(conn.sqlrepr(Select(func.PASSWORD('foo'[0][0]

Where Users is a table in my database. This solution seems
unnecessarily complicated, though - is there a simpler way to do it?

Cheers,

Patrick


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: How to use SQLObject classes defined in model.py outside TG?

2006-10-30 Thread Jorge Vargas

I have added that to
http://docs.turbogears.org/1.0/RoughDocs/DocumentationWishList

On 10/29/06, Matt Wilson [EMAIL PROTECTED] wrote:

 Thanks for the hint.  I just found this page on the trac wiki:

 http://trac.turbogears.org/turbogears/wiki/UsingModelsOutsideTurboGears

 That seems to be exactly what I was looking for.


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] TurboEntity

2006-10-30 Thread Jonathan LaCour

For those of you who haven't seen yet:

http://turboentity.ematia.de/

Its a declarative layer on top of SQLAlchemy a'la ActiveMapper (and
apparently heavily inspired by ActiveMapper according to the source).
It feels much more like SQLObject than ActiveMapper, has documentation,
and examples.  In all respects, it seems like an excellent replacement
for ActiveMapper (and SQLObject, for that matter).

Also, the web site specifically mentions that it was built with
TurboGears in mind, and even includes an example for providing an
identity model for turbogears.  Very exciting news, and I have already
contacted the author about the possibility of supplanting ActiveMapper
as the recommended declarative layer for SQLAlchemy.

Check it out, and I hope I didn't steal the author's thunder :)

--
Jonathan LaCour
http://cleverdevil.org




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Breaking get_project get_package and get_model.

2006-10-30 Thread Jorge Vargas

On 10/29/06, Elvelind Grandin [EMAIL PROTECTED] wrote:

 Is there somebody that uses these in their projects? If not they will
 be changed in the next released to a Project class.

I have some code that depends on get_model it's my hackish way of
tg-admin sql drop,tg-admin sql create, put sample data. it goes like
this.

for item in turbogears.util.get_model().__dict__.values():
if inspect.isclass(item) and issubclass(item,sqlobject.SQLObject) and \
item != sqlobject.SQLObject and item != InheritableSQLObject:
item.dropTable(ifExists=True)
item.createTable()

I guess that can be broken since it's not production code.

also I plan to make a real tg-admin command for this so I can write
if after the changes.


what exactly are you planning?
 --
 cheers
 elvelind grandin

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Christopher Arndt

Michael Steinfeld schrieb:
 It's probably a long shot, but I am in Sarasota Florida (hour south of
 Tampa) and would like to form a users group or even just meet for coffee
 with other people interested in TurboGears and Python.

I'll chime in here too: I'm in Cologne/Germany. I would even drive as far as
Frankfurt for occasional meetings.

BTW, I'm also trying to organize a general Python meet-up in Köln, more here
(in German): http://article.gmane.org/gmane.comp.python.general.german/5483

Chris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread isaac

Chicago, anyone?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: script src=....

2006-10-30 Thread jo

Ian Wilson wrote:
 What do you mean by doesn't work?  The file isn't being included or
 the function has errors?

 Ill just guess the file isn't being included.  What happens when you
 go directly to the file in the browser?

 For example if you are running your server at localhost:8080 then try going to
 http://localhost:8080/static/javascript/help.js

Here the output

500 Internal error
The server encountered an unexpected condition which prevented it from
fulfilling the request.
Traceback (most recent call last):
  File
/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py,
line 103, in _run
applyFilters('before_main')
  File
/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/filters/__init__.py,
line 151, in applyFilters
method()
  File
/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/filters/staticfilter.py,
line 53, in before_main
raise cherrypy.WrongConfigValue(msg)
WrongConfigValue: StaticFilter requires an absolute final path. Make
static_filter.dir, .file, or .root absolute.


 The file should show up.  If it does not then the file isn't being
 found and maybe you should check that the name and permissions of the
 file are correct.

 Also I think you should have this in either your app.cfg(mine is
 located in /project/config/app.cfg or your dev.cfg/prod.cfg located in
 your project's root directory.

 [/static]
 static_filter.on = True
 static_filter.dir = %(top_level_dir)s/static

In my dev.cfg I have:
[/static]
static_filter.on = True
static_filter.dir = sicer

where sicer is my project name.



 Good luck.

 -Ian

 On 10/30/06, Jose Soares [EMAIL PROTECTED] wrote:
 
  Hi all,
 
  May someone help me calling javascript functions?
 
  In my edit.kid I would like to insert a javascript function like this:
  script
function help(){
   alert ('Ciao')
}
  /script
 
  This one works, but if I move the function to a file into
  myproject/static/javascript/help.js
  it doesn't work anymore.
 
  This is my definition in my edit.kid:
  head
script type=text/javascript src=/static/javascript/help.js/script
  /head
 
  What's wrong with it?
 
  jo
 
 
 
 
 
  
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Karl Guertin

I'm amused that there's a whole lot of posting here and nobody is even
remotely close to each other.

Cambridge, MA fwiw

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Install problem on Windows XP

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 12:57 PM, cwurld wrote:

 I tried posting this a few hours ago, but it did not appear, so I will
 try again. Sorry if it appears twice.

To eliminate spam (and we toss out a fair bit), new members are  
moderated. (I flip that bit after I let a message through.)

 I am trying to install Turbogears 1.0b1 on windows XP. This is a new
 install. I already had python 2.4. Everything seems to install.
 tg-admin.exe appears in the scripts folder. But when I run tg-admin
 info from the command line the disk drive whirls for a few seconds,
 but there is no output and I end up back at the command prompt.

I've never heard of that. Very odd, and hard to figure out where to  
start. Can you run python from the command prompt?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Robin Haswell

Anyone for United Kingdom, especially Yorkshire-area?

-Rob


Michael Steinfeld wrote:
 Hi,
 
 It's probably a long shot, but I am in Sarasota Florida (hour south of
 Tampa) and would like to form a users group or even just meet for coffee
 with other people interested in TurboGears and Python.
 
 If you are interested please let me know.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 5:46 AM, Steve Holden wrote:


 Is it just me, or does CherryPy take a *really* long time to start up
 and restart?

It's not you (and I don't think it's CherryPy). We've got a lot of  
code that gets imported when you import turbogears. I've been  
thinking about ways to deal with that, but I'm not sure if it can be  
done in a backwards-compatible manner. And, of course, the more of TG  
that you use, the more that your app will need to import at startup  
time.

At times, I have thought about some pretty radical solutions to this  
problem, because it's one that I'd like to see fixed. However, I  
should note that my own development tends to be partly shielded from  
this because I do test driven development and run my tests more often  
than update code on a running server process.

Kevin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Ian Wilson

Ha yeah seriusoly did you look at that link to the map though?  There
are people all over.  Maybe TG users are just naturally territorial.

Anyways, San Luis Obispo, CA for me.

-Ian


On 10/30/06, Karl Guertin [EMAIL PROTECTED] wrote:

 I'm amused that there's a whole lot of posting here and nobody is even
 remotely close to each other.

 Cambridge, MA fwiw

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Adam Jones


Karl Guertin wrote:
 I'm amused that there's a whole lot of posting here and nobody is even
 remotely close to each other.

 Cambridge, MA fwiw

I think that says good things ... namely that i18n support here is
better than it is in other projects. Granted, I know embarrassingly
little about internationalization, but from what I do know TG seems to
be more helpful than usual.

-Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Announcing TurboSetup 0.2 -- Revenge of the Mailing List Spam

2006-10-30 Thread Adam Jones

TurboSetup 0.2 is out and available from pypi. Notable features in this
version:

* Widgets to display and edit a configuration, dynamically built from
the config file or a given dictionary

* A database uri handling object that provides validation of uri
parameters and builds uri strings for you.

* A preliminary database connection test system. Note that I do not use
SQLAlchemy, so the testing support for that is entirely theoretical.

::Additional Project Notes::

You can access the svn for TurboSetup from:

http://recursivethought.googlecode.com/svn/turbosetup

Until I have something that is more useful than an incomplete gathering
of components, additional updates will be posted at the following
address(es) to cut down on mailing list spam:

http://www.recursivethought.com/blog/tags/view/turbosetup
http://groups.google.com/group/turbogears-announce

-Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: TurboEntity

2006-10-30 Thread percious

Two questions.

With TurboEntity work with tg-admin sql create

~and~

Can the author provide better documentation on the use of select
queries?  IE select(id50 and id100)

Otherwise, looks great.

Thanks!
-chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread fumanchu

Steve Holden wrote:
 Is it just me, or does CherryPy take a *really* long time to start up
 and restart?

How long is *really* long? Longer than 1.5 seconds?

C:\Python24\Lib\site-packagespython cherrypy\test\hello.py
[30/Oct/2006:09:12:25] HTTP Serving HTTP on http://localhost:8080/
1.5623624
[30/Oct/2006:09:12:25] ENGINE CherryPy shut down
[30/Oct/2006:09:12:26] HTTP HTTP Server shut down
2.6643433

import os
##import pyconquer
##tr = pyconquer.Logger(cherrypy)
##tr.out = open(os.path.join(os.path.dirname(__file__), startup.log),
wb)
try:
##tr.start()
import time
start = time.time()
import cherrypy
class HelloWorld:
def index(self):
return Hello world!
index.exposed = True
cherrypy.tree.mount(HelloWorld())
cherrypy.server.quickstart()
cherrypy.engine.start(blocking=False)
print time.time() - start
cherrypy.engine.stop()
cherrypy.server.stop()
print time.time() - start
finally:
pass
##tr.stop()
##tr.out.close()


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: FileField not preserving value after error

2006-10-30 Thread Christopher Arndt

Sanjay schrieb:
 I have a form with a FileField. After a validation error or exception
 occurs, the field is not preserving the old path name, but is becoming
 blank. Pondering whether it the expected behaviour, or I might be
 missing something...

Yes, this is normal for input type=file / elements. You cannot pre-fill
such a field from you code as a security measure.

As a workaround, if the error in the form was not related to the file upload,
i.e. you received a valid file, you can save it to a temporary space (e.g. the
cherrypy session) and stick it's name into an additional hidden field and
somehow inform the user that the file is already uploaded.

This is a very crude hack I used in one of my projects ('upload' is the name of
the file-input form field, 'attachment' is the name of the hidden form field):

def handle_upload(self, **values):

[... do validation here or with a decorator]

# handle file upload: if there is an upload, store it in the session
upload = values.get('upload')
if getattr(upload, 'filename', None):
filedict = dict(
data = upload.file.read(),
filename = upload.filename,
type = upload.type
)
values['attachment'] = upload.filename
del values['upload']
cherrypy.session['upload'] = filedict

# if there is a filename, look in the session data if we have
# a matching file object stored there and use that
elif values.get('attachment'):
upload = cherrypy.session.get('upload', {})
if upload.get('filename') != values.get('attachment'):
errors['upload'] = _(
  u'Specified file does not exist on server. Upload it first.')
del values['attachment']

[...]

Chris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread John M Camara


Kevin Dangoor wrote:
 However, I
 should note that my own development tends to be partly shielded from
 this because I do test driven development and run my tests more often
 than update code on a running server process.

 Kevin

Kevin,

I don't believe startup time in production is the issue but rather in
development when server restarts are required for some code changes to
take effect.  This is when long startup times hurt.  I have 2
applications that take 7 seconds and another that takes 24 seconds to
start up.  Even if I start a new quick start application it takes 7
seconds.

John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread m h

On 10/30/06, Kevin Dangoor [EMAIL PROTECTED] wrote:

 On Oct 30, 2006, at 5:46 AM, Steve Holden wrote:

 
  Is it just me, or does CherryPy take a *really* long time to start up
  and restart?

 It's not you (and I don't think it's CherryPy). We've got a lot of
 code that gets imported when you import turbogears. I've been
 thinking about ways to deal with that, but I'm not sure if it can be
 done in a backwards-compatible manner. And, of course, the more of TG
 that you use, the more that your app will need to import at startup
 time.

 At times, I have thought about some pretty radical solutions to this
 problem, because it's one that I'd like to see fixed. However, I
 should note that my own development tends to be partly shielded from
 this because I do test driven development and run my tests more often
 than update code on a running server process.

 Kevin

You've probably already heard of it, but bazaar (bzr) is using lazy
imports to improve startup time.  The latest release, 0.12, cut
startup time by 50%.

(Beware though, it's GPL code ;) )

-matt

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Jorge Godoy

Steve Holden [EMAIL PROTECTED] writes:

 Is it just me, or does CherryPy take a *really* long time to start up and
 restart?

In development mode it does take a while.  In production mode it is very
fast.  Of course if you have other slow things they'll impact in the startup
time (e.g. if it is slow to stablish the connection with your database, if
you're loading some slow library in your code, etc.). 

-- 
Jorge Godoy  [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Jorge Godoy

fumanchu [EMAIL PROTECTED] writes:

 Steve Holden wrote:
 Is it just me, or does CherryPy take a *really* long time to start up
 and restart?

 How long is *really* long? Longer than 1.5 seconds?

Is this CP 3 code or CP 2.X (TG compatible) code? 

I got an error for quickstart...


Traceback (most recent call last):
  File testing.py, line 15, in ?
cherrypy.server.quickstart()
AttributeError: 'Server' object has no attribute 'quickstart'


-- 
Jorge Godoy  [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread John M Camara

Below is a few lines from profiling a new quick start application.  All
I did was create an app via quick start, modified the startup file to
enable profiling, started the server, viewed the home page of the app,
and then hit the browser refresh button 6 times.

The line that starts with 23118 number of calls was the first item that
jumped out to me for investigation.  So I opened the code (listed
next).  Now it seams a little absurd that it would be necessary to
retrieve sys.modules 23118 times (takes 0.2 seconds) when TG starts up.
 The reloader_thread function monkey patches CherryPy and I have to be
honest I didn't look into this particular issue any further as I
started to look through other areas.

Any way after looking into other areas I felt I needed to dig in a
little deeper into both TG and CherryPy to get a better understanding
of the internals before trying to make optimizations but it was clear
that many opportunities seam to exist.


def reloader_thread(freq):
Monkeypatch for the reloader provided by CherryPy.

This reloader is designed to reload a single package. This is
more efficient and, more important, compatible with zipped
libraries that may not provide access to the individual files.

def archive_selector(module):
if hasattr(module, '__loader__'):
if hasattr(module.__loader__, 'archive'):
return module.__loader__.archive
return module

mtimes = {}
package = turbogears.config.get(autoreload.package, None)
if package is None:
print \
TurboGears requires autoreload.package to be set. It can be an empty
value, which will use CherryPy's default behavior which is to check
every module. Setting an actual package makes the check much faster.
return
while cherrypy.lib.autoreload.RUN_RELOADER:
if package:
modnames = filter(lambda modname:
modname.startswith(package), sys.modules.keys())
modlist = [sys.modules[modname] for modname in modnames]
else:
modlist = map( archive_selector, sys.modules.values())
for filename in filter(lambda v: v, map(lambda m: getattr(m,
__file__, None), modlist)): # = line 49
if filename.endswith(.kid) or filename == string:
continue
orig_filename = filename
if filename.endswith(.pyc):
filename = filename[:-1]
try:
mtime = os.stat(filename).st_mtime
except OSError, e:
if orig_filename.endswith('.pyc') and e[0] == errno.ENOENT:
# This prevents us from endlessly restarting if there 
is an old .pyc
lying around
# after a .py file has been deleted
try: os.unlink(orig_filename)
except: pass
sys.exit(3) # force reload
if filename not in mtimes:
mtimes[filename] = mtime
continue
if mtime  mtimes[filename]:
sys.exit(3) # force reload
time.sleep(freq)




==Begin Profile Data==
 286628 function calls (280258 primitive calls) in 12.944 CPU
seconds



   Ordered by: internal time, call count



   ncalls  tottime  percall  cumtime  percall filename:lineno(function)

   932.6680.0293.1790.034 string:1(?)

864821.2690.0002.2260.000
\trentm\as\apps\activepython-devel\build\py2_4-win32-ix86\python\modules\pyexpat.c:849(Default)

   491.0770.0223.3110.068
g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py:318(_buildForeign)

864820.9580.0000.9580.000
g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py:434(_default)

  702/1320.2370.0000.5830.004
g:\python24\lib\sre_parse.py:374(_parse)

   480.2300.0050.2300.005
g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\template_util.py:2(?)

   480.2240.0050.5410.011
g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\__init__.py:9(?)

231180.2020.0000.2020.000
g:\python24\lib\site-packages\turbogears-1.0b1-py2.4.egg\turbogears\startup.py:49(lambda)
==End Profile Data==


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Tim Lesher

On 10/30/06, Steve Holden [EMAIL PROTECTED] wrote:

 Is it just me, or does CherryPy take a *really* long time to start up
 and restart?

Yes, same here.  I really didn't notice until I went back to some old
Spyce-based code and remembered that it didn't have the same issue.

-- 
Tim Lesher [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: toolbox widget development woes

2006-10-30 Thread Alberto Valverde

Hi,

On Oct 30, 2006, at 11:31 AM, Diez B. Roggisch wrote:
 (...)
 Of course I can create a new webapplication just for testing my widget
 project. But first of all, the toolbox widget list mechanisms  
 already _allow_
 for convenient, self-embedded rendering. There is everything available
 already. And as my answer to my own post says, obviously somebody  
 also felt
 the need to restrict the display of widgets to just one. And  
 second, it would
 render the whole approach somewhat moot if I need a special webapp  
 to test a
 widget, then I'd just go for the webapp.

 Beside that, both approaches won't help with the
 reloading-on-code-change-issue, if I'm not  mistaken. Because a type
 tgwidget-application is basically a deployed egg, and just as  
 touching any
 file in the python distro doesn't trigger a reload, changing the  
 egg-contents
 won't do that as well (unless one takes special measures).

 To summarize: I think having a convenient testbed for widget  
 development would
 be a good idea. I don't care too much about where it lives, but if  
 it _is_
 integrated in the toolbox, the advantage to me clearly is that a  
 developer is
 more encouraged to package her widget to be usable out-of-the-box.

When developing a widget I usually create a widget egg skeleton with  
tg-admin quickstart -tgwidget, quickstart a new app and set  
autoreload.package to a blank value so it autoreloads whenever any  
module is modified. If you install the widget dist. in develop mode  
(python setup.py develop) the app will reload whenever your edit the  
widget's sources (or anything imported by your app) without needing  
to install it.

I personally see the widget browser as a show-case for widgets you  
plan to distribute (to free your users from repeating those steps and  
to provide some documentation) and I only write a WidgetDesc once the  
widget is ready.

On the other hand, an autoreloading toolbox would be cool, those easy  
steps are still time consuming... However, I've tried to patch the  
toolbox to autoreload like a quickstarted app does but it crashed  
crashed when launched:

Index: turbogears/command/base.py
===
--- turbogears/command/base.py  (revision 1996)
+++ turbogears/command/base.py  (working copy)
@@ -307,7 +307,8 @@
  server.socket_port : self.port,
  server.environment : development,
  server.log_to_screen : True,
-autoreload.on : False,
+autoreload.on : True,
+autoreload.package : ,
  server.package : turbogears.toolbox,
  log_debug_info_filter.on : False,
  identity.failure_url : /noaccess

If anyone comes up with a solution that works I'm +1 for it if no  
other nasty-side effects are caused.

Alberto


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Gregor Horvath

Steve Holden schrieb:

 Is it just me, or does CherryPy take a *really* long time to start up 
 and restart?

I noticed that if I have no network connection the start up time is
considerably/annoying higher than with a connection.
Maybe some timeout ?

--
Greg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Preventing simultaneous database access from replicated TG servers

2006-10-30 Thread Stuart Clarke

OK, here's my problem:

I have a script which accesses the DB, and which can be started in the
background from my TG web application (The script also uses my app's
model).  I want to prevent this script from being simultaneously
executed more than once.  Problem is, the web app may be replicated
across a number of load-balanced servers.  So, what mechanism can I use
to prevent simultaneous execution.  The only things shared by my
replicated apps would be the DB server, and memcached.

Does SQLObject contain any facilities at all for setting up these sort
of locks (other than discreet test and set operations on a DB row)?
Does memcached?

Thanks,

Stuart


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: how to retrieve cherrypy REQUEST informations

2006-10-30 Thread Bob Ippolito

On 10/30/06, Jose Soares [EMAIL PROTECTED] wrote:

 I would like to know how to retrieve the cherrypy informations like
 the query_string of url, the server_url, the authenticated_user,
 cookies, etc.
 Something like the Zope REQUEST.

Googling for cherrypy request would've answered your question.

http://docs.cherrypy.org/api-reference#request

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: TurboEntity

2006-10-30 Thread Karl Guertin

On 10/30/06, percious [EMAIL PROTECTED] wrote:
 With TurboEntity work with tg-admin sql create

I'm not 100% sure but I'd be surprised if it didn't.

 Can the author provide better documentation on the use of select
 queries?  IE select(id50 and id100)

Syntax is the same as standard sqlalchemy. The select is the same as
used in ActiveMapper and assign_mapper:

TableName.select(and_(TableName.c.id  50, TableName.c.id  100))

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Mark Ramm

On 10/30/06, John M Camara [EMAIL PROTECTED] wrote:

 No.  It's not just you.  I started to collect some profile data the
 other day to see what I could do but found out that I need to get a
 little more familiar with TG/CherryPy internals first.  From looking at
 the data it looks like there are many opportunities for improvements as
 some of the call counts are astronomically high.

 As time permits I will continue to investigate and submit some patches.

You may also want to take a look at CherryPy 3.0, which is
significantly faster than 2.2.  Robert Brewer has done a lot of good
work there, and some benchmarks show a 3x improvement!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Michele Cella

I don't think that CP is the problem but rather TG that imports a lot
of things on startup even if usually you don't need *all* of them.

CP itself is pretty fast, at least here...

Ciao
Michele

Steve Holden wrote:
 Is it just me, or does CherryPy take a *really* long time to start up
 and restart?

 regards
   Steve
 --
 Steve Holden   +44 150 684 7255  +1 800 494 3119
 Holden Web LLC/Ltd  http://www.holdenweb.com
 Skype: holdenweb   http://holdenweb.blogspot.com
 Recent Ramblings http://del.icio.us/steve.holden


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Preventing simultaneous database access from replicated TG servers

2006-10-30 Thread Jorge Godoy

Stuart Clarke [EMAIL PROTECTED] writes:

 I have a script which accesses the DB, and which can be started in the
 background from my TG web application (The script also uses my app's
 model).  I want to prevent this script from being simultaneously
 executed more than once.  Problem is, the web app may be replicated
 across a number of load-balanced servers.  So, what mechanism can I use
 to prevent simultaneous execution.  The only things shared by my
 replicated apps would be the DB server, and memcached.

Use a table with a flag.  Check that before starting and if it's there, abort
the execution.  If it's not, then start your operation by setting the flag so
that no other instance of the script can be run.


-- 
Jorge Godoy  [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Preventing simultaneous database access from replicated TG servers

2006-10-30 Thread Stuart Clarke

On Mon, 2006-10-30 at 22:26 -0300, Jorge Godoy wrote:
 Stuart Clarke [EMAIL PROTECTED] writes:
 
  I have a script which accesses the DB, and which can be started in the
  background from my TG web application (The script also uses my app's
  model).  I want to prevent this script from being simultaneously
  executed more than once.  Problem is, the web app may be replicated
  across a number of load-balanced servers.  So, what mechanism can I use
  to prevent simultaneous execution.  The only things shared by my
  replicated apps would be the DB server, and memcached.
 
 Use a table with a flag.  Check that before starting and if it's there, abort
 the execution.  If it's not, then start your operation by setting the flag so
 that no other instance of the script can be run.

*** The test-and-set operation isn't atomic though, is it?  Which still
leaves the door (slightly) open for simultaneous executions.

Might be the best possible solution, however.

Thanks,

Stuart


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: kid drives me crazy

2006-10-30 Thread Stuart Clarke

Is anyone planning to write a memcached caching mechanism for Genshi?

I love the whole templates are correct XHTML and editable in insert
name of favourite web editor here factor.  But until I can memcached
from these templating systems, I'll be using Cheetah.

Stuart


On Mon, 2006-10-30 at 11:19 -0600, isaac wrote:
 Genshi rocks, I'm using it for everything now (the 0.3.x stable branch
 from svn). Converting the templates is not hard... it's several X
 faster, and it actually tells you what line# in your template is
 causing a problem.
 
 Kid has its strengths, but Genshi is wy better, IMO. I've yet to
 hear of a downside to switching, aside from the small amount of work
 to convert existing templates.
 
 The difficulty of debugging kid templates is a huge pain, and probably
 a very discouraging experience for newbies.
 
 --i
 
  
 
-- 
Stuart Clarke [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Preventing simultaneous database access from replicated TG servers

2006-10-30 Thread Jorge Godoy

Stuart Clarke [EMAIL PROTECTED] writes:

 *** The test-and-set operation isn't atomic though, is it?  Which still
 leaves the door (slightly) open for simultaneous executions.

It depends how you're doing it.  I'd try locking the table for update,
updating it and then starting the process.  If you were doing a
SELECT/UPDATE without locking then it would be easier to have problems. 

 Might be the best possible solution, however.

I believe so.  Sharing something through NFS is unreliable as well...  I
believe that memcached also has the non-atomic behavior.

-- 
Jorge Godoy  [EMAIL PROTECTED]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Preventing simultaneous database access from replicated TG servers

2006-10-30 Thread Bob Ippolito

On 10/30/06, Stuart Clarke [EMAIL PROTECTED] wrote:

 On Mon, 2006-10-30 at 22:26 -0300, Jorge Godoy wrote:
  Stuart Clarke [EMAIL PROTECTED] writes:
 
   I have a script which accesses the DB, and which can be started in the
   background from my TG web application (The script also uses my app's
   model).  I want to prevent this script from being simultaneously
   executed more than once.  Problem is, the web app may be replicated
   across a number of load-balanced servers.  So, what mechanism can I use
   to prevent simultaneous execution.  The only things shared by my
   replicated apps would be the DB server, and memcached.
 
  Use a table with a flag.  Check that before starting and if it's there, 
  abort
  the execution.  If it's not, then start your operation by setting the flag 
  so
  that no other instance of the script can be run.

 *** The test-and-set operation isn't atomic though, is it?  Which still
 leaves the door (slightly) open for simultaneous executions.

 Might be the best possible solution, however.

It depends on how your DB works and what your workers are supposed to do.

For example:

[A] BEGIN;
[B] BEGIN;
[A] SELECT locked FROM locktable; (false)
[A] UPDATE locktable SET locked='t';
[B] SELECT locked FROM locktable; (false)
[B] UPDATE locktable SET locked='t'; (BLOCKED)
[A] -- Do some work
[A] UPDATE locktable SET locked='f';
[A] COMMIT;
[B] -- locked is set to 't' because B is no longer blocked
[B] -- Do some work
[B] COMMIT;

The work ends up done twice, because [B] can not know that the lock
was ever acquired. It does see a consistent view of the database
though, because it had to wait for the row lock to be released by [A]
before it has a chance to do its update. Which view of the database it
sees depends on the isolation level though.

If you want [B] to fail you need to use two transactions. One to
acquire the lock, one to do the work. You also need to use a locking
select or they'll *both* succeed in updating the lock table and bad
things will happen.

[A] BEGIN;
[B] BEGIN;
[A] SELECT locked FROM locktable FOR UPDATE; (false)
[B] SELECT locked FROM locktable FOR UPDATE; (BLOCKED)
[A] UPDATE locktable SET locked='t';
[A] COMMIT;
[B] -- SELECT returns 't' so we can bail here
[B] COMMIT;
[A] BEGIN;
[A] -- Do work
[A] UPDATE locktable SET locked='f';
[A] COMMIT;

Using something other than a boolean in there can make sense so you
can track which process performed the lock and when, so you can
force-release the lock eventually. [A] might not have completed the
transaction.

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread fumanchu

Jorge Godoy wrote:
 fumanchu [EMAIL PROTECTED] writes:

  Steve Holden wrote:
  Is it just me, or does CherryPy take a *really* long time to start up
  and restart?
 
  How long is *really* long? Longer than 1.5 seconds?

 Is this CP 3 code or CP 2.X (TG compatible) code?

 I got an error for quickstart...


 Traceback (most recent call last):
   File testing.py, line 15, in ?
 cherrypy.server.quickstart()
 AttributeError: 'Server' object has no attribute 'quickstart'

3, but startup times for CP 2 are similar on my box.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 7:18 PM, m h wrote:

 You've probably already heard of it, but bazaar (bzr) is using lazy
 imports to improve startup time.  The latest release, 0.12, cut
 startup time by 50%.

Yes, lazy imports is specifically one area that I've considered. I  
don't think I can do it adequately, though, without some breaking api  
changes. The trick is also doing it without impacting performance of  
production systems.

Kevin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 7:56 PM, John M Camara wrote:


 Below is a few lines from profiling a new quick start application.   
 All
 I did was create an app via quick start, modified the startup file to
 enable profiling, started the server, viewed the home page of the app,
 and then hit the browser refresh button 6 times.

 The line that starts with 23118 number of calls was the first item  
 that
 jumped out to me for investigation.  So I opened the code (listed
 next).  Now it seams a little absurd that it would be necessary to
 retrieve sys.modules 23118 times (takes 0.2 seconds) when TG starts  
 up.
  The reloader_thread function monkey patches CherryPy and I have to be
 honest I didn't look into this particular issue any further as I
 started to look through other areas.

Actually, the first two things on the list seem far more interesting  
than the 0.2 seconds of requests for sys.modules.

My read on that is that if we handle the widget Kid templates in a  
lazier manner, we can shave several seconds off of the startup time.

 ==Begin Profile Data==
  286628 function calls (280258 primitive calls) in 12.944 CPU
 seconds



Ordered by: internal time, call count



ncalls  tottime  percall  cumtime  percall filename:lineno 
 (function)

932.6680.0293.1790.034 string:1(?)

 864821.2690.0002.2260.000
 \trentm\as\apps\activepython-devel\build\py2_4-win32-ix86\python 
 \modules\pyexpat.c:849(Default)

491.0770.0223.3110.068
 g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py:318 
 (_buildForeign)

 864820.9580.0000.9580.000
 g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py:434 
 (_default)

   702/1320.2370.0000.5830.004
 g:\python24\lib\sre_parse.py:374(_parse)

480.2300.0050.2300.005
 g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid 
 \template_util.py:2(?)

480.2240.0050.5410.011
 g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\__init__.py:9(?)

 231180.2020.0000.2020.000
 g:\python24\lib\site-packages\turbogears-1.0b1-py2.4.egg\turbogears 
 \startup.py:49(lambda)
 ==End Profile Data==



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: how to retrieve cherrypy REQUEST informations

2006-10-30 Thread Kevin Dangoor

import cherrypy
cherrypy.request

http://docs.cherrypy.org/api-reference#request

On Oct 30, 2006, at 4:52 PM, Jose Soares wrote:


 Hi all,

 I would like to know how to retrieve the cherrypy informations like
 the query_string of url, the server_url, the authenticated_user,
 cookies, etc.
 Something like the Zope REQUEST.
 ---
 QUERY_STRING'PIPPO=ASSNOME=ASASAS'
 AUTHENTICATED_USER  jojo
 VirtualRootPhysicalPath ('',)
 AUTHENTICATION_PATH ''

 HTTP_COOKIE 'tip=; daavt=; marclne=; not=; key=; csc=;
 dtpa=; mod=0'
 HTTP_ACCEPT_LANGUAGE'it-it,it;q=0.8,en-us;q=0.5,en;q=0.3'
 REQUEST_METHOD  'GET'
 PATH_INFO   '/matreco/my'
 SERVER_PROTOCOL 'HTTP/1.1'
 QUERY_STRING'PIPPO=ASSNOME=ASASAS'
 HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
 HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.0.5)
 Gecko/20060731 Ubuntu/dapper-security Firefox/
 SERVER_NAME 'bandon.sofonia.com'
 REMOTE_ADDR '127.0.0.1'
 PATH_TRANSLATED '/matreco/my'
 SERVER_PORT '8080'
 HTTP_HOST   'localhost:8080'
 GATEWAY_INTERFACE   'CGI/1.1'
 HTTP_ACCEPT_ENCODING'gzip,deflate'

 


--
Kevin Dangoor
TurboGears / Zesty News

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Install problem on Windows XP

2006-10-30 Thread cwurld

Thanks for your efforts filtering spam.

Yes, I can run python from the command line. I can run other
executables that are in the python scripts folder from the command
line.

I am wondering if I should remove TG and start the install over. During
the install, I had a few crashes because I was missing some software
(easy_install). Eventually the install ran without error. But maybe all
the restarts created a strange state. If I were to try starting over,
do you have any recommendations for uninstalling what I have?

Thanks

On Oct 30, 5:10 pm, Kevin Dangoor [EMAIL PROTECTED] wrote:
 On Oct 30, 2006, at 12:57 PM, cwurld wrote:

  I tried posting this a few hours ago, but it did not appear, so I will
  try again. Sorry if it appears twice.To eliminate spam (and we toss out a 
  fair bit), new members are  
 moderated. (I flip that bit after I let a message through.)

  I am trying to install Turbogears 1.0b1 on windows XP. This is a new
  install. I already had python 2.4. Everything seems to install.
  tg-admin.exe appears in the scripts folder. But when I run tg-admin
  info from the command line the disk drive whirls for a few seconds,
  but there is no output and I end up back at the command prompt.I've never 
  heard of that. Very odd, and hard to figure out where to  
 start. Can you run python from the command prompt?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] last chance for PyCon talks!

2006-10-30 Thread Kevin Dangoor

Tomorrow (Halloween) is that last day to submit talk proposals for  
PyCon 2007 (in Dallas)! It's a great event, and I'd certainly  
recommend it. Good crowd to hang around with lots of smart people who  
know all kinds of stuff. You won't believe the things you learn just  
by being in the same room as Bob Ippolito. Or Phillip Eby. Or Ian  
Bicking. If we're lucky, the elusive but wonderfully prolific Mike  
Bayer might be in attendance. So, hopefully some folks will propose  
talks, but it would be good for you to at least be there!

Kevin

--
Kevin Dangoor
TurboGears / Zesty News

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Announcing TurboSetup 0.2 -- Revenge of the Mailing List Spam

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 6:36 PM, Adam Jones wrote:

 Until I have something that is more useful than an incomplete  
 gathering
 of components, additional updates will be posted at the following
 address(es) to cut down on mailing list spam:

 http://www.recursivethought.com/blog/tags/view/turbosetup
 http://groups.google.com/group/turbogears-announce

Actually, I'd recommend spamming this mailing list more than  
turbogears-announce. turbogears-announce is designed to be the lower- 
traffic list (for folks who don't want to wade through 1,000 messages  
a month. turbogears-announce is an appropriate place for the same  
kinds of announcements that show up on python-announce-list.

Kevin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread mr.b

A possible longer shot -- N. Charlotte, Winston Salem and points west
in North Carolina.  I live
west of Winston Salem, have some TG experience and long-term Python
experience (Zope2, some
Twisted, etc).

Let's have a coffee @ with some wireless (downtown W-S or maybe
Charlotte?).

thank you,
mark

Michael Steinfeld wrote:
 Hi,

 It's probably a long shot, but I am in Sarasota Florida (hour south of
 Tampa) and would like to form a users group or even just meet for coffee
 with other people interested in TurboGears and Python.
 
 If you are interested please let me know.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: TurboEntity

2006-10-30 Thread Doug Woos

On 10/30/06, Karl Guertin [EMAIL PROTECTED] wrote:

 On 10/30/06, percious [EMAIL PROTECTED] wrote:
  With TurboEntity work with tg-admin sql create

 I'm not 100% sure but I'd be surprised if it didn't.


The website says that automatic table creation works as normal.

This looks intriguing- I think I'll use it to make the switch to SQLAlchemy.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Install problem on Windows XP

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 7:39 PM, cwurld wrote:


 Thanks for your efforts filtering spam.

 Yes, I can run python from the command line. I can run other
 executables that are in the python scripts folder from the command
 line.

 I am wondering if I should remove TG and start the install over.  
 During
 the install, I had a few crashes because I was missing some software
 (easy_install). Eventually the install ran without error. But maybe  
 all
 the restarts created a strange state. If I were to try starting over,
 do you have any recommendations for uninstalling what I have?

I don't *think* you're likely to be in a strange state. Try this:

python

  import pkg_resources as pr
  pr.require(TurboGears)

and see what you get

Kevin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: trying to meet python/turbogears users in my area

2006-10-30 Thread Andrew Grover

On 10/29/06, Adam Jones [EMAIL PROTECTED] wrote:
 Same for Portland, OR.

Hey me too! Cool. -- Andy

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: TurboEntity

2006-10-30 Thread Kevin Dangoor

On Oct 30, 2006, at 11:06 AM, Jonathan LaCour wrote:


 For those of you who haven't seen yet:

 http://turboentity.ematia.de/

 Its a declarative layer on top of SQLAlchemy a'la ActiveMapper (and
 apparently heavily inspired by ActiveMapper according to the  
 source).
 It feels much more like SQLObject than ActiveMapper, has  
 documentation,
 and examples.  In all respects, it seems like an excellent replacement
 for ActiveMapper (and SQLObject, for that matter).

Sounds like a good project, though I haven't looked at the details.  
There's certainly a lot that can be done in that area, and the  
featurelist is good.

 Also, the web site specifically mentions that it was built with
 TurboGears in mind, and even includes an example for providing an
 identity model for turbogears.  Very exciting news, and I have already
 contacted the author about the possibility of supplanting ActiveMapper
 as the recommended declarative layer for SQLAlchemy.

Shh... we've got a book coming out in a few days that has a chapter  
on using ActiveMapper ;)

Kevin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Install problem on Windows XP

2006-10-30 Thread cwurld



On Oct 30, 9:19 pm, Kevin Dangoor [EMAIL PROTECTED] wrote:
 On Oct 30, 2006, at 7:39 PM, cwurld wrote:



  Thanks for your efforts filtering spam.

  Yes, I can run python from the command line. I can run other
  executables that are in the python scripts folder from the command
  line.

  I am wondering if I should remove TG and start the install over.  
  During
  the install, I had a few crashes because I was missing some software
  (easy_install). Eventually the install ran without error. But maybe  
  all
  the restarts created a strange state. If I were to try starting over,
  do you have any recommendations for uninstalling what I have?I don't 
  *think* you're likely to be in a strange state. Try this:

 python

   import pkg_resources as pr
   pr.require(TurboGears)

 and see what you get

 Kevin

Here is what I get:

turbogears 1.0b1
nose 0.9.1
configobj 4.3.2
ruledispatch 0.5a0.dev-r2115
setuptools 0.6c3
formencode 0.6
celementtree 1.0.5-20051216
pastescript 1.0
elementtree 1.2.6-20050316
simplejson 1.4
sqlobject 0.7.1
cherrypy 2.2.1
turbokid 0.9.9
turbocheetah 0.9.5
turbojson 0.9.9
pyprotocols 1.0a0dev-r2082
cheetah 2.0rc7
pastedeploy 1.0
paste 1.0
formencode 0.6
kid 0.9.3
cheetah 2.0rc7
elementtree 1.2.6-20050316

Thanks,
Chuck


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Startup/restart time

2006-10-30 Thread John M Camara

The reason why I had looked at that example first was the fact it was
the first TG code listed.  Anyway I looked into the issue a little
deeper and I realized now it will not effect start up time but felt it
was still worth optimizing.  I found that there were some indentation
via tabs which added some overhead but didn't cause any errors even
though the code was not executing as intended and I could use list
comprehension to remove the lambda.  Anyway the function is now 100
times faster with this change and should allow TG to increase the
number of pages it can serve per second.

The while loop in reloader_thread should become

while cherrypy.lib.autoreload.RUN_RELOADER:
if package:
modlist = [module for modname, module in
sys.modules.items() if modname.startswith(package)]
else:
modlist = map( archive_selector, sys.modules.values())
for filename in filter(lambda v: v, map(lambda m: getattr(m,
__file__, None), modlist)):
if filename.endswith(.kid) or filename == string:
continue
orig_filename = filename
if filename.endswith(.pyc):
filename = filename[:-1]
try:
mtime = os.stat(filename).st_mtime
except OSError, e:
if orig_filename.endswith('.pyc') and e[0] ==
errno.ENOENT:
# This prevents us from endlessly restarting if
there is an old .pyc lying around
# after a .py file has been deleted
try: os.unlink(orig_filename)
except: pass
sys.exit(3) # force reload
if filename not in mtimes:
mtimes[filename] = mtime
continue
if mtime  mtimes[filename]:
sys.exit(3) # force reload
time.sleep(freq)

I'll create a patch for this and create a ticket when I'm on a computer
that has SVN access.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Announcing TurboSetup 0.2 -- Revenge of the Mailing List Spam

2006-10-30 Thread Adam Jones


Kevin Dangoor wrote:
 On Oct 30, 2006, at 6:36 PM, Adam Jones wrote:

  Until I have something that is more useful than an incomplete
  gathering
  of components, additional updates will be posted at the following
  address(es) to cut down on mailing list spam:
 
  http://www.recursivethought.com/blog/tags/view/turbosetup
  http://groups.google.com/group/turbogears-announce

 Actually, I'd recommend spamming this mailing list more than
 turbogears-announce. turbogears-announce is designed to be the lower-
 traffic list (for folks who don't want to wade through 1,000 messages
 a month. turbogears-announce is an appropriate place for the same
 kinds of announcements that show up on python-announce-list.

I will do that then. I didn't really consider this release to have
enough to be worth mentioning here, but I wanted to put out links to
the svn and update pages.

-Adam


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: TurboEntity

2006-10-30 Thread gasolin

I think we should create a doc to collect those candidates in an arena
:-D

Till now we have three candidates for default SA:

1. ActiveMapper
2. plain SA definitions
3. TurboEntity

Lee McFadden has checked in [1997] to replace ActiveMapper with plain
SA definitions.

Though plain SA makes SA users feel comfortable that they can take full
advantage of SA with turbogears, it doen't make sense for sqlobject
users that they could do the same thing with half size of code.

Though to use 'turboentity' class to specify the 'tablename' doesn't
make sense to me,
it did a good job for support 'Self-referential' field that SQLObject
did not (without magic
)

Here's  a list of  how TurboEntity, SQLObject, Active Mapper specify
their table name:

TurboEntity:

class turboentity:
tablename = tg_user

SQLObject:

class sqlmeta:
table = tg_user

Active Mapper:

class mapping:
   __table__ = tg_user


Kevin Dangoor wrote:
 On Oct 30, 2006, at 11:06 AM, Jonathan LaCour wrote:

 
  Also, the web site specifically mentions that it was built with
  TurboGears in mind, and even includes an example for providing an
  identity model for turbogears.  Very exciting news, and I have already
  contacted the author about the possibility of supplanting ActiveMapper
  as the recommended declarative layer for SQLAlchemy.

 Shh... we've got a book coming out in a few days that has a chapter
 on using ActiveMapper ;)
 
 Kevin


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: kid drives me crazy

2006-10-30 Thread Sylvain Hellegouarch


 Is anyone planning to write a memcached caching mechanism for Genshi?

 I love the whole templates are correct XHTML and editable in insert
 name of favourite web editor here factor.  But until I can memcached
 from these templating systems, I'll be using Cheetah.


er. Why don't you undertake that task then? :)

- Sylvain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: last chance for PyCon talks!

2006-10-30 Thread [EMAIL PROTECTED]

Dang all those dudes are going to be there? What about the other
turbogears crew they all coming? I mean cherrypy and etc.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: how to retrieve cherrypy REQUEST informations

2006-10-30 Thread jose

Thank you very much to Kevin Dangoor and Bob Ippolito for this important link.  
:-) 



Kevin Dangoor wrote:

import cherrypy
cherrypy.request

http://docs.cherrypy.org/api-reference#request

On Oct 30, 2006, at 4:52 PM, Jose Soares wrote:

  

Hi all,

I would like to know how to retrieve the cherrypy informations like
the query_string of url, the server_url, the authenticated_user,
cookies, etc.
Something like the Zope REQUEST.
---
QUERY_STRING'PIPPO=ASSNOME=ASASAS'
AUTHENTICATED_USER  jojo
VirtualRootPhysicalPath ('',)
AUTHENTICATION_PATH ''

HTTP_COOKIE 'tip=; daavt=; marclne=; not=; key=; csc=;
dtpa=; mod=0'
HTTP_ACCEPT_LANGUAGE'it-it,it;q=0.8,en-us;q=0.5,en;q=0.3'
REQUEST_METHOD  'GET'
PATH_INFO   '/matreco/my'
SERVER_PROTOCOL 'HTTP/1.1'
QUERY_STRING'PIPPO=ASSNOME=ASASAS'
HTTP_ACCEPT_CHARSET 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_USER_AGENT 'Mozilla/5.0 (X11; U; Linux i686; it; rv:1.8.0.5)
Gecko/20060731 Ubuntu/dapper-security Firefox/
SERVER_NAME 'bandon.sofonia.com'
REMOTE_ADDR '127.0.0.1'
PATH_TRANSLATED '/matreco/my'
SERVER_PORT '8080'
HTTP_HOST   'localhost:8080'
GATEWAY_INTERFACE   'CGI/1.1'
HTTP_ACCEPT_ENCODING'gzip,deflate'





--
Kevin Dangoor
TurboGears / Zesty News

email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com





  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Another spammer on the list?

2006-10-30 Thread [EMAIL PROTECTED]

not here


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Row level security in sqlobject

2006-10-30 Thread Gregor Horvath

Jorge Godoy schrieb:
If someone is interested, I am willing to share the code.
 
 I am.  :-)  You can use TG's wiki to share content like this.

I've putted it on the sqlobjects wiki, since it belongs/depends more to SO.
http://wiki.sqlobject.org/rowlevelsecurity.html

 
 I see.  And it should be easily adaptable to something like auto-filtering by
 customer_id, project_id, etc., right?  I believe that both use cases are very
 similar... 

A customer_id or project_id would be a access group, like in Unix.

 
 So it's a cascade: 
 
- TG's permissions apply first to allow acessing classes / methods
- row level ACLs are applied to allow retrieving that row

exactly.

 Will you implement INSERT / UPDATE / DELETE?  From the above I am supposing
 you just have it for SELECTs... 

Well, I do always a select before an update and delete in SO. You have
to specify in the select if you want write access rights (like in
opening a file on unix). So there is basic protection. But you are
correct this is not Fort Knox .. yet :-)

 Those would be cool to have and might make adjusting permissions easier... 

Patches are welcome :-)

--
Greg

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---