[TurboGears] Re: reducing memory usage

2006-12-24 Thread Mike Sarahan


That was very helpful and informative.  Thanks.

Do you all think there is any chance that my threads are getting
multiple counted in the process watcher?  I just can't see how a
quickstart app that consumes ~15MB real ram on my home computer manages
to push me over the 100MB memory cap on the server.  Each thread should
be sharing the resources of the parent process, if I understand
correctly, rather than each one demanding its own resources, right?

-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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] reducing memory usage

2006-12-23 Thread Mike Sarahan


Hi all,

I'm having trouble lately with memory usage on my shared hosting plan
through Dreamhost.  It seems that they have a cap set at ~15MB res, and
100MB virtual.  Here's what their server log says:

2006-11-16 14:16:06   kill  9886mikez0r  start-photogal.
Process
puts user over total memory limit (15.78125 / 100)

I thought that this was just some poor coding on my part, and went in
and ripped out all the caching that sqlobject was doing as a first
attempt at reducing mem usage - to no avail.  Next I tried just running
a default quickstart, but even this gets killed.  I have tried reducing
the number of threads in the thread pool to 1 with both my project and
the quickstart, and they both still get killed.  I am running 1.0b2 in
production mode.

I didn't run into this problem until very recently, possibly when I
upgraded from 0.9a to 1.0.  I'm waiting for a response from Dreamhost
to see if they've recently lowered the amount of memory allocated to
each user.  Any ideas on what else could have caused this problem?
Solutions?

Thanks,
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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: reducing memory usage

2006-12-23 Thread Mike Sarahan


I've investigated this a bit more - I'm running in production mode,
testing just a quickstart project for simplicity's sake.  On my mac, I
only see one process, like it should be.  This process has 5 threads
with the thread_pool set to 1.

On my Dreamhost account (Debian Linux with python 2.4 installed to my
home directory), I see 6 processes in top - all consuming identical
amount of virt and res memory.  I'm a bit new - different PID's means
different processes, right?  Is my multi-threaded process getting split
into multiple single-threaded processes?  If so, this is probably to
source of memory overusage.

Thanks,
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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: autocomplete widget /identity

2006-07-18 Thread Mike Sarahan

Patrick,

Thanks for your help - it's up and running now, and works beautifully.
I've also re-created my database based on the more logical foreign-key
(I had indeed been doing goofier things, matching user names rather
than id's.)


--~--~-~--~~~---~--~~
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] autocomplete widget /identity

2006-07-17 Thread Mike Sarahan

Hi guys,

Here's what I'm trying to do:
I want an upload page based on a widget with 2 fields, one being a file
field, and the other an autocomplete field for users to specify which
folder to put the uploaded file in.  The autocomplete field will draw
its data from my database, listing only directories that the logged-in
user has in their directory.

Here's what I've tried so far:
I have autocomplete working just fine from the example in the trac
docs.
I've tried to modify the example so that it draws the info from my
database.  Here's my code (from controllers.py, located directly above
my root controller):

class UploadFile(controllers.Controller):
def __init__(self):
super(UploadFile,self).__init__()
user=identity.current.user.user_name
folderdblist=list(Folder.select(Folder.q.user==user))
folders=[]
for folder in folderdblist:
folders+=[folder]
self.upload_form=widgets.TableForm(fields=[
widgets.FileField('file',label=File to
upload:),
widgets.AutoCompleteField('folder',
only_suggest=True,
label=Folder to put file in:,
search_controller=search,
search_param=input,
result_name=matches)
],
submit_text=Upload file,
action=/save_file,
method=POST)

@expose(template=photogal.templates.upload)
def index(self):
return dict(upload_form=self.upload_form)

@expose(format = json)
def search(self,input):
input=input.lower()
matches = [folder for folder in self.folders \
if folder.lower().find(input)!=-1]
return dict(matches=matches)

I then mount this controller in my root controller using
upload=UploadFile()

When I try to start my project, I get this message:
turbogears.identity.exceptions.RequestRequiredException: An attempt was
made to use a facility of the TurboGears Identity Management framework
that relies on an HTTP request outside of a request.

I am also not sure that my code is the correct way to do it - I don't
know whether this will work for each user, or just one.  Any
suggestions on how to accomplish this?

Thanks,
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] toolbox/catwalk on shared hosting (dreamhost)

2006-07-04 Thread Mike Sarahan

Hey guys,

Has anyone had any luck getting toolbox/catwalk to work on dreamhost or
any other shared hosts?  I've run into a few problems trying to mount
either of them as an app.  I can't get my server to start when trying
to mount toolbox.

Here's a few dumps at varying stages:

Code in controllers.py:
toolbox = toolbox.Toolbox()
toolbox.catwalk = CatWalk(model)

This gives me a message:
TypeETraceback (most recent call last):
  File ./testing.fcgi, line 97, in ?
tg_init()
  File ./testing.fcgi, line 92, in tg_init
exec('from %s import %s as Root' % (package_name, class_name))
  File string, line 1, in ?
  File
/home/tgtest/testing.elementarycatastrophe.com/tgtest/tgtest/controllers.py,
line 19, in ?
class Root(controllers.RootController):
  File
/home/tgtest/testing.elementarycatastrophe.com/tgtest/tgtest/controllers.py,
line 20, in Root
toolbox = toolbox.Toolbox()
TypeError: __init__() takes exactly 2 arguments (1 given)
rror: __init__() takes exactly 2 arguments (1 given)

Which led me to believe that I should include the project name as an
argument when mounting toolbox.

Here's the result after I did that:

Traceback (most recent call last):
  File ./testing.fcgi, line 97, in ?
tg_init()
  File ./testing.fcgi, line 92, in tg_init
exec('from %s import %s as Root' % (package_name, class_name))
  File string, line 1, in ?
  File
/home/tgtest/testing.elementarycatastrophe.com/tgtest/tgtest/controllers.py,
line 19, in ?
class Root(controllers.RootController):
  File
/home/tgtest/testing.elementarycatastrophe.com/tgtest/tgtest/controllers.py,
line 20, in Root
toolbox = toolbox.Toolbox(tgtest)
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/base.py,
line 95, in __init__
self.require = identity.from_any_host(hostlist)
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/identity/conditions.py,
line 220, in __init__
host_predicates= [from_host(h) for h in hosts]
TypeError: iteration over non-sequence

Trying to mount just catwalk, no toolbox - my app will start up, but
trying to access catwalk gives me this error (which was discussed a
little earlier in this thread, but I couldn't manage to resolve it:
http://groups.google.com/group/turbogears/browse_thread/thread/ba9837166ca8ce60/bcfad378076c3ca8?q=catwalk+dreamhostrnum=2#bcfad378076c3ca8
)

Traceback (most recent call last):
  File
/home/.castor/tgtest/lib/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py,
line 105, in _run
self.main()
  File
/home/.castor/tgtest/lib/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py,
line 254, in main
body = page_handler(*virtual_path, **self.params)
  File string, line 3, in index
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/controllers.py,
line 280, in expose
output = database.run_with_transaction(
  File string, line 5, in run_with_transaction
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/database.py,
line 243, in so_rwt
retval = func(*args, **kw)
  File string, line 5, in _expose
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/controllers.py,
line 297, in lambda
mapping, fragment, *args, **kw)))
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/controllers.py,
line 321, in _execute_func
output = errorhandling.try_call(func, *args, **kw)
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/errorhandling.py,
line 68, in try_call
return func(self, *args, **kw)
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/catwalk/__init__.py,
line 1129, in index
return dict(models=self.models())
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/catwalk/__init__.py,
line 1112, in models
return self.order_models(objs)
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/catwalk/__init__.py,
line 769, in order_models
ordered = self.load_models_order()
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/catwalk/__init__.py,
line 765, in load_models_order
state = self.load_state()
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/catwalk/__init__.py,
line 625, in load_state
if not os.path.exists(self.state_path()): return {}
  File
/home/.castor/tgtest/downloads/turbogears/turbogears/toolbox/catwalk/__init__.py,
line 613, in state_path
catwalk_session_dir =
os.path.join(turbogears.util.get_package_name(),'catwalk-session')
  File /home/tgtest/lib//lib/python2.4/posixpath.py, line 62, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Any help would be much appreciated.

Thanks,
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]

[TurboGears] New python install option for Dreamhost users

2006-04-26 Thread Mike Sarahan

Hi guys,

I found mention of this somewhere by Mark Ramm:
http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python

I had been having problems with Catwalk in the custom python install
that we use, and was looking for alternatives to the python install.
This didn't fix catwalk, but it is a way to use the system python with
your own libs.  I don't see a whole lot of value in it, but maybe
someone else will benefit.

To get it set up, you'll need to do the following:
rm -rf ~/lib
rm -rf ~/bin
rm -rf ~/include

run python2.4 virtual-python.py (from the link above)
add ~/bin to your path.
copy profile.py and pstats.py to ~/lib/python2.4.  You can get these
two files from your old python custom install, they're in the Lib dir
in the un-tarred Python distribution dir.  This step is necessary
because DH uses Debian, which doesn't include this part of python by
default (it's a non-free licensing issue).  If you don't do this,
cherrypy will complain, and things didn't work for me.

New users will need to download a python 2.4 distribution, untar it,
and copy the files from the Lib directory.  If they're not there, you
should run ./configure and then make in the un-tarred python dir.

After all this, install (or re-install) TG and any other python
software you need  (MySQLpython, etc.), as they were removed when you
did the rm -rf stuff.

Would anyone like to confirm that this works for them as well?  How
about anyone suggesting the benefits of this method over the custom
install (or vice-versa)?

-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: insert date in DateTimeCol

2006-04-26 Thread Mike Sarahan

Other people can probably tell you how to do this better, but I'd use
python's datetime module and try something like this when you save a
user:

now = datetime.datetime.today
YourModel(date=now,name=name,etc.)

A while back, I tinkered with these things and resorted to a simple
StringCol for my dates, with strformatted datetime values.  That's
another option, but certainly less elegant.  Mine needed the strings
because my dates were not coming from datetime, they were being parsed
out of jpeg EXIF data, and hence didn't fit as date data.

Good luck.
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: How many of us are gentoo users?

2006-04-25 Thread Mike Sarahan

I'm a gentoo fan also.  I use it for all my desktops.  I am not much of
a developer, but I'd be glad to help with whatever I can.

-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: catwalk problem in recent 0.9 versions (a2-a4, SVN 1160)

2006-04-21 Thread Mike Sarahan

It's definitely a problem with the shared system.  Catwalk works just
fine on a similar install, minus the custom python install and FCGI
garbage necessary for functionality with Dreamhost.


--~--~-~--~~~---~--~~
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: catwalk problem in recent 0.9 versions (a2-a4, SVN 1160)

2006-04-20 Thread Mike Sarahan

I forgot to mention something that's very important.  This is a
non-standard setup.  It's running on a shared system, Dreamhost (they
run Debian Linux on their servers).  I have my own little python
install inside my home folder, and Turbogears lives there, not
/lib/python or whatever.

I hope this helps.

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: Deploying 0.9

2006-04-19 Thread Mike Sarahan

I've got the same error as Elver with version 0.9a4.  I'm going to try
SVN and see what happens.

Ronald, CatWalk is quite an amazing tool, and I really like the
facelift from the old greenish borders to the new blue ones.  Thanks
for your work on it.

-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] catwalk problem in recent 0.9 versions (a2-a4, SVN 1160)

2006-04-19 Thread Mike Sarahan

Hello all,

I recently upgraded to 0.9a4, and was sad to see catwalk kick the
bucket on my installation.  It won't load, and posts the following
output (at end of message).  Getting SVN didn't fix it.  I am
admittedly not very good at bug hunts.

This has been mentioned here:
http://groups.google.com/group/turbogears/browse_thread/thread/9d291a2bf5e178ce/6a865b4c980b532f?lnk=raot#6a865b4c980b532f

But it wasn't related to the other thread it was posted in, and I
didn't want it to get passed over.

Any ideas?  Catwalk is an amazingly helpful tool, thanks for all the
great work on it, Ronald.

-Mike

  File
/home/.castor/mikez0r/download/trunk/turbogears/toolbox/catwalk/__init__
.py, line 1123, in index
return dict(models=self.models())
  File
/home/.castor/mikez0r/download/trunk/turbogears/toolbox/catwalk/__init__
.py, line 1106, in models
return self.order_models(objs)
  File
/home/.castor/mikez0r/download/trunk/turbogears/toolbox/catwalk/__init__
.py, line 763, in order_models
ordered = self.load_models_order()
  File
/home/.castor/mikez0r/download/trunk/turbogears/toolbox/catwalk/__init__
.py, line 759, in load_models_order
state = self.load_state()
  File
/home/.castor/mikez0r/download/trunk/turbogears/toolbox/catwalk/__init__
.py, line 619, in load_state
if not os.path.exists(self.state_path()): return {}
  File
/home/.castor/mikez0r/download/trunk/turbogears/toolbox/catwalk/__init__
.py, line 607, in state_path
catwalk_session_dir =
os.path.join(turbogears.util.get_package_name(),'catwa
lk-session')
  File /home/mikez0r/lib/lib/python2.4/posixpath.py, line 62, in join
elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'


--~--~-~--~~~---~--~~
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: catwalk problem in recent 0.9 versions (a2-a4, SVN 1160)

2006-04-19 Thread Mike Sarahan

Ronald,

I put the line in, but how should I get output from it?  I tried to
access the site, but I just get the 500 message and the dump above.  my
server log also just has the traceback.

running python __init__.py also didn't give me any output.

Thanks for the help!
-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: Identity in 0.9a1

2006-03-14 Thread Mike Sarahan

Didn't we figure out a while back that naming your project test
causes all kinds of namespace conflict issues?

Try a different project name.  something that for sure isn't duplicated
in the framework code, whether in Python (I remember the conflict being
here), or elsewhere.

-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: Identity in 0.9a1

2006-03-13 Thread Mike Sarahan

Benedikt Terhechte wrote:
 Actually, that doesn't work either in the new versions, it should be:

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

Anyone correct me if I'm wrong, but I think that depends on how you do
your imports.  if you

from turbogears.identity import *
or
from turbogears.identity import validators

you don't have to preface the validators with identity.

-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: Identity in 0.9a1

2006-03-13 Thread Mike Sarahan

In my code, I have

from turbogears.identity.conditions import *

just to clarify my previous post.


--~--~-~--~~~---~--~~
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: TypeError: 'NoneType' object is not callable

2006-03-13 Thread Mike Sarahan

Richard,

how are you trying to get the new version?

the best way to get the latest of turbokid is to go into the
plugins/kid dir of your trunk checkout, and run easy_install .

I haven't upgraded since february 20th (if it isn't broken, don't fix
it), and my turbokid version is 0.9.1dev-r787

Also, you might try doing the same thing for kid (but it's in
thirdparty/kid) - I noticed your version is 0.8.  Mine is 0.9.  I
believe the fix has been in turbokid, but this might be something else
to try.

I don't know if the above instructions work with the alpha release.
Haven't tried it yet.  If those folders exist, though, give it a shot.

-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: installing turbogears on rh9..

2006-02-21 Thread Mike Sarahan

to point it to the new python, you probably want to rm
/usr/bin/python, and then do a ln -sf /path/to/new/python
/usr/bin/python

Be careful, though.  you should just rename it to start out (mv
/usr/bin/python /usr/bin/pythonbackup), and delete the backup if
nothing else breaks (someone had mentioned in your other post that
other things depend on python 2.2.  They may or may not work after this
change.

You could also have a dedicated TG-user on your system, with a
PYTHONPATH variable set in .bash_profile.  That would be the most
non-disruptive to the RH nonsense, I think.

Good luck,
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: svn 645 sitetemplate not found error coming up again

2006-02-20 Thread Mike Sarahan

Hello all,

I found the source of this error and I thought I'd share, just in case
anyone runs into it (unlikely, considering the source).  It was
cropping up because I had some leftover junk in my kidsupport.py file
from when we were playing with doing either import_template or
load_template a long time ago, in efforts to fix the nonetype error.

To fix my problem, I just removed all files in plugins/kid/turbokid (I
had about 4 diff. versions of kidsupport.py), and re-checked out svn.

site is back up.

Thanks to everyone for their work on TG - I thought about trying other
things, but they just excite me like TG.  It really is the best, IMHO.

-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: SVN 791 CP problems

2006-02-20 Thread Mike Sarahan

Matt, I got mine worked out, though I don't know if this will work for
you since yours seems different.  Basically all I did was switch it to
production mode. I also upgraded to the latest SVN, and it had changed
by one or two version numbers.  Dev mode was still broken for me after
the upgrade, but switching to prod mode made everything peachy.
Switching meaning editing config.py, and also renaming setup.py so that
the startup script would load the prodcfg.py file rather than the
devcfg.py file.

good luck,
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: Running SVN version on windows?

2006-02-20 Thread Mike Sarahan

Yannick,

I had been running into this error with FastCGI deployment behind
Apache on dreamhost (debian linux).  I don't have a good explanation
for you as to why it comes up, but I fixed mine by updating SVN today
(2/20/06), and changing all my server settings to production.  i.e.
edit config.py, and rename/delete setup.py so that prodcfg.py gets
used.  It's something to try, at least, and I hope it works for you.
Sorry I can't give you a better, more certain fix.

-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: Running SVN version on windows?

2006-02-20 Thread Mike Sarahan

Yannick,

I don't understand what's going on well.  Here's what I am thinking is
happening:

urls are getting re-written with tg_fastcgi.fcgi before the url.  so
http://www.mysite.com becomes tg_fastcgi.fcgihttp://www.mysite.com ?

mine turns into http://www.mysite.com/tg_fastcgi.fcgi/

On my site, the tg_fastcgi.fcgi is before any and all
sub-folders/methods (minus static, which the .htaccess rule takes care
of).  It doesn't break anything, and though it bothered me at first,
I've learned to just ignore it because it's functional.

but you seem to say that yours doesn't work.  What errors come up?

-Mike

Yannick wrote:
 Jorge, Mike,

 Thanks for the help.

 I've decided to give a try to FastCGI, and I am going a little bit
 further but it still isn't working as expected.
 The problem I am now facing is that the url are requested to cherrypy
 with a tg_fastcgi.fcgi prefix. This is due to the rewriting rules in
 my .htaccess:
 RewriteEngine On
 RewriteBase /
 RewriteRule ^(tg_fastcgi\.fcgi/.*)$ - [L]
 RewriteRule !^stat - [C]
 RewriteRule ^(.*)$ tg_fastcgi.fcgi/$1 [L]

 If I use the server.webpath=/tg_fastcgi.fcgi setting in my config
 file, it effectively strips out the tg_fastcgi.fcgi from the incoming
 requests, but it also prepends tg_fastcgi.fcgi to all the outgoing
 url! Which doesn't really improve the situation...
 
 Any ideas?
 
 Thanks,
 Yannick


--~--~-~--~~~---~--~~
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: TypeError: 'NoneType' object is not callable

2006-02-17 Thread Mike Sarahan

Keith,

run tg-admin info anywhere to see what all you have installed.
Also, Turbokid is in plugins/kid, not thirdparty/kid (kid is there).

I'm also running into this error, with TurboKid 0.9.0 and kid 0.8.  Kid
0.9 gives me a bizarre sitetemplate error that I've been unable to
track down.  Just upgraded to turbokid 0.9.1, so I'm hoping it'll clear
up.

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: Identity Introspection

2006-02-17 Thread Mike Sarahan

If I understand what you're trying to do, maybe this will help:

The way I do it is in the kid templates - links don't show up unless a
person has the proper qualifications.  I use py:if's for this.  Here's
an example from one of my pages:

a py:if=not std.identity.anonymous
href=${std.url('/edit',alt_ID=img['alt_ID
'])}Edit Description of this picture/abr/

That lets anyone who's logged access my edit method, but you could also
make it more restrictive for only allowing certain users, groups, or
permission-holding users through.

Hope this helps.
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] SVN 791 CP problems

2006-02-17 Thread Mike Sarahan

I just updated, and CP seems to be having problems.  It's tough to tell
what the problem is, though - no meaningful output in any log files,
only a traceback to the CTRL-C that I use to kill the server.

It's on dreamhost, behind FastCGI.  running the fastcgi script from the
TG on dreamhost guide does not work - it just never ends and does not
output the desired page to stdout.log.  I've waited 10 minutes for it
to die.

Here's a traceback just in case it has something I missed:

17/Feb/2006:09:03:14 CONFIG INFO Server parameters:
17/Feb/2006:09:03:14 CONFIG INFO   server.environment: development
17/Feb/2006:09:03:14 CONFIG INFO   server.log_to_screen: True
17/Feb/2006:09:03:14 CONFIG INFO   server.log_file:
/home/mikez0r/elementarycatastrophe.com/server.log
17/Feb/2006:09:03:14 CONFIG INFO   server.log_tracebacks: True
17/Feb/2006:09:03:14 CONFIG INFO   server.log_request_headers: True
17/Feb/2006:09:03:14 CONFIG INFO   server.protocol_version: HTTP/1.0
17/Feb/2006:09:03:14 CONFIG INFO   server.socket_host:
17/Feb/2006:09:03:14 CONFIG INFO   server.socket_port: 80
17/Feb/2006:09:03:14 CONFIG INFO   server.socket_file:
17/Feb/2006:09:03:14 CONFIG INFO   server.reverse_dns: False
17/Feb/2006:09:03:14 CONFIG INFO   server.socket_queue_size: 5
17/Feb/2006:09:03:14 CONFIG INFO   server.thread_pool: 5
2006-02-17 09:03:15,418 turbogears.visit INFO Visit Tracking starting
2006-02-17 09:03:16,294 turbogears.visit INFO Visit filter initialised
2006-02-17 09:03:16,385 turbogears.identity INFO Identity starting
2006-02-17 09:03:16,386 turbogears.identity DEBUG Loading provider from
plugin: sqlobject
2006-02-17 09:03:16,389 turbogears.identity INFO Succesfully loaded
turbogears.identity.soprovider.TG_User
2006-02-17 09:03:16,390 turbogears.identity INFO Succesfully loaded
turbogears.identity.soprovider.TG_Group
2006-02-17 09:03:16,390 turbogears.identity INFO Succesfully loaded
turbogears.identity.soprovider.TG_Permission
2006-02-17 09:03:16,395 turbogears.identity INFO Identity visit plugin
initialised
2006-02-17 09:03:16,395 turbogears.identity DEBUG Loading provider from
plugin: sqlobject
2006-02-17 09:03:16,397 turbogears.identity INFO Succesfully loaded
turbogears.identity.soprovider.TG_User
2006-02-17 09:03:16,397 turbogears.identity INFO Succesfully loaded
turbogears.identity.soprovider.TG_Group
2006-02-17 09:03:16,398 turbogears.identity INFO Succesfully loaded
turbogears.identity.soprovider.TG_Permission
17/Feb/2006:09:03:56 ENGINE INFO Ctrl-C hit: shutting down
autoreloader
2006-02-17 09:03:56,380 turbogears.visit INFO Visit Tracking shutting
down
2006-02-17 09:03:56,417 turbogears.identity INFO Identity shutting down
17/Feb/2006:09:03:56 ENGINE INFO Ctrl-C hit: shutting down
autoreloader
17/Feb/2006:09:03:56 ENGINE INFO CherryPy shut down
17/Feb/2006:09:03:56  INFO Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cpwsgi.py,
line 68, in wsgiApp
environ['wsgi.url_scheme'])
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cpengine.py,
line 168, in request
raise cherrypy.NotR17/Feb/2006:09:03:56 ENGINE INFO CherryPy shut
down
17/Feb/2006:09:03:56  INFO Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cpwsgi.py,
line 68, in wsgiApp
environ['wsgi.url_scheme'])
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cpengine.py,
line 168, in request
raise cherrypy.NotReady(The CherryPy server has stopped.)
NotReady: The CherryPy server haseady(The CherryPy server has
stopped.)
NotReady: The CherryPy server has stopped.

Status: 500 Internal Server Error
Content-Type: text/plain
Content-Length: 478

Unrecoverable error in the server.
Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cpwsgi.py,
line 68, in wsgiApp
environ['wsgi.url_scheme'])
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cpengine.py,
line 168, in request
raise cherrypy.NotReady(The CherryPy server has stopped.)
NotReady: The CherryPy server has stopped.
 stopped.


--~--~-~--~~~---~--~~
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: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-10 Thread Mike Sarahan

Anyone correct me if I'm wrong, but I think you could also run
easy-install . in any directory you want to compile from the source
that's there.  (plugins/kid, etc.)

Elvelind, thanks for all the great tips and tricks lately on using TG
more effectively.

-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: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-09 Thread Mike Sarahan

Kevin,

I think there may be a problem with upgrading from 0.8 - things are
working fine for me now that I removed everything and started over only
installing SVN.

That might help explain the odd line numbers.  Perhaps it was using the
ealier version of either TurboGears or TurboKid.  Still, it seems like
the debug output indicated that it was going to the correct version...

Dreamhost's fastcgi support leaves much to be desired - my site is down
until it randomly decides to work again (generally a day or two), but
I'll let you all know if I still encounter the nonetype error once it
comes up again.

-Mike



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-09 Thread Mike Sarahan

Drew, after this error comes up for you, does the rest of your site
remain functional, or do you have to restart TG?

Sometimes for me some of the pages will continue to work, while others
stay broken after that comes up, and other times it just breaks
everything kid-related.



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-08 Thread Mike Sarahan

Kevin,

Here's a traceback after I ran both easy_install . and python setup.py
develop/install in plugins/kid and in thirdparty/kid:

Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 99, in _run
self.main()
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 247, in main
body = page_handler(*virtual_path, **self.params)
  File string, line 3, in index
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r694-py2.4.egg/turbogears/controllers.py,
line 188, in expose
func, tg_format, html, fragment, *args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r694-py2.4.egg/turbogears/database.py,
line 193, in run_with_transaction
retval = func(*args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r694-py2.4.egg/turbogears/controllers.py,
line 205, in _execute_func
return _process_output(tg_format, output, html, fragment)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r694-py2.4.egg/turbogears/controllers.py,
line 68, in _process_output
fragment=fragment)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r694-py2.4.egg/turbogears/view.py,
line 60, in render
return engine.render(info, format, fragment, template)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 88, in render
tclass = self.load_template(template)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 42, in load_template
self.load_template(self.stname, True)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 56, in load_template
mod = kid.load_template(classname)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/kid-0.9a0-py2.4.egg/kid/__init__.py,
line 112, in load_template
raise Exception, Template not found: %s (in %s) % (
Exception: Template not found:
turbogears.fastdata.templates.sitetemplate (in
/home/.castor/mikez0r/elementarycatastrophe.com, /)

Same TurboKid line numbers...

I'll try a re-install later today.  Is the best path still to install
0.8, and then upgrade?  That's what I've been doing, but if it might
introduce problems, I'll just go through the dep's and get to SVN
directly.

-Mike



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-07 Thread Mike Sarahan

Lee,

You're amazingly good at blind guesses.  That bin/python/bin dir is a
shortcut dir linked to the python binary.  I have to set it up this way
because it's running on dreamhost - not on one of my boxes.  I have an
installation of python that's hopefully being used over their install
(2.3).  I think that's working ok, because running python gives me my
version 2.4.2, and the interpreter line of the script I run TG from is
pointed to the proper python binary (~/bin/python/bin/python).

I moved $HOME/lib/lib/python2.4/... to the beginning, but still no
luck.  Just to check, I made sure that the
turbogears/fastdata...sitetemplate exists in the egg folder, and it
does, so I don't know where it's getting caught up.

I was poking around with google, and thought it might help to set a
PYTHONPATH variable.  I set that to:
export PYTHONPATH=$HOME/lib/lib/python2.4/:$PATH

Still won't import the sitetemplate, but check out what I get when I
run
import sys
print sys.path

['', '/home/mikez0r/lib/lib/python2.4',
'/home/mikez0r/lib/lib/python2.4/site-packages/TurboGears0.9a0dev_r646-py2.4.egg',
'/home/mikez0r/bin/python/bin', '/home/mikez0r/lib/bin',
'/usr/local/bin', '/usr/bin', '/bin', '/usr/bin/X11', '/usr/games',
'/home/mikez0r/lib/lib/python24.zip',
'/home/mikez0r/lib/lib/python2.4/plat-linux2',
'/home/mikez0r/lib/lib/python2.4/lib-tk',
'/home/mikez0r/lib/lib/python2.4/lib-dynload',
'/home/mikez0r/lib/lib/python2.4/site-packages',
'/home/mikez0r/lib/lib/python2.4/site-packages/PIL',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TestGears-0.2-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/FormEncode-0.4-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/cElementTree-1.0.5_20051216-py2.4-linux-i686.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/elementtree-1.2.6-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/json_py-3.4-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/nose-0.8.6-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/PyProtocols-1.0a0-py2.4-linux-i686.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/RuleDispatch-0.5a0-py2.4-linux-i686.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/PasteScript-0.4.2-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/simplejson-1.1-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/Cheetah-1.0-py2.4-linux-i686.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/PasteDeploy-0.4-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/Paste-0.4.1-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/kid-0.9a0-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg',
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r646-py2.4.egg']

Sure looks like it is looking in the proper dir.  Why on earth can't it
find that sitetemplate?



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-07 Thread Mike Sarahan

importing other turbogears stuff worked just fine, still nothing on the
sitetemplate.  Here's the ls in
$HOME/lib/lib/python2.4/site-packages/TurboGears.../turbogears/fastdata/templates

total 28
-rw-rw-r--  1 mikez0r pg4915910 2006-02-06 18:33 __init__.py
-rw-rw-r--  1 mikez0r pg491591  210 2006-02-06 18:33 __init__.pyc
-rw-rw-r--  1 mikez0r pg491591 1171 2006-02-06 18:33 datagrid.kid
-rw-rw-r--  1 mikez0r pg491591  435 2006-02-06 18:33 form.kid
-rw-rw-r--  1 mikez0r pg491591  599 2006-02-06 18:33 item.kid
-rw-rw-r--  1 mikez0r pg491591  432 2006-02-06 18:33 list.kid
-rw-rw-r--  1 mikez0r pg491591  774 2006-02-06 18:33 master.kid
-rw-rw-r--  1 mikez0r pg491591  732 2006-02-06 18:33 sitetemplate.kid



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-07 Thread Mike Sarahan

Kevin,

here's the output:

 import pkg_resources
 pkg_resources.resource_filename(turbogears.fastdata.templates,sitetemplate.kid)
'/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r646-py2.4.egg/turbogears/fastdata/templates/sitetemplate.kid'


I know you're busy - thanks for taking some time for this.

-Mike



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-07 Thread Mike Sarahan

As for TG appearing twice, it's because it comes up once when I have it
manually set in the PATH variable, and again when I set the PYTHONPATH.
 I'll fix that.



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-07 Thread Mike Sarahan

Kevin (or anyone else),

Any idea on a fix?  How do I go about turning on kid's import hook?

I tried running kidc on each of the kid files in that folder, and it
generated the pyc files, but it still dies with the same error.

-Mike



[TurboGears] Re: Database / config problems

2006-02-07 Thread Mike Sarahan

Mike,

I don't have answers to everything (or very much at all, really), but
here's what I know:

SVN anything is going to use the devcfg.py/prodcfg.py files, not the
dev.cfg - That switch happened sometime in the 500's, I think.

I don't know about the notrans issues you're having, sorry.

Some magic for the config files to recognize which server you're on
would be wonderful.  I run Postgres at home, and MySQL on the
webserver, so I agree, having a simple switch rather than having to go
in, comment/uncomment would be nice.  As it is, I keep 2 copies of my
config file, and append -local or -remote to the end of the filename,
and cp whichever is appropriate into devcfg.py, overwriting whichever
version might be there.  You could put local/remote at the beginning to
be more auto-complete friendly.

SQLite:  have you tried just setting the path to be a relative path to
your db?  I don't know if it will work, but it is worth a shot.

that's it, sorry I couldn't help more.

-Mike



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-06 Thread Mike Sarahan

Good idea, Lee, but unfortunately, it didn't work.  Same sitetemplate
error showing up.



[TurboGears] svn 645 sitetemplate not found error coming up again

2006-02-05 Thread Mike Sarahan

Hi all,

Here's the error, if it tells you anything.  I have gone into the
plugins/kid directory and run python setup.py develop and python
setup.py install.  Neither changed it.  I had it working with 645
earlier today, but now even a complete reinstall of python and
everything else always repeats this error.  I had been trying to get
rid of the nonetype not callable error, which is still a huge issue
for me.

Did the fix in turbokid 0.8 get lost in 0.9a?

-Mike

Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 99, in _run
self.main()
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 247, in main
body = page_handler(*virtual_path, **self.params)
  File string, line 3, in index
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r645-py2.4.egg/turbogears/controllers.py,
line 218, in expose
func, tg_format, html, fragment, *args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r645-py2.4.egg/turbogears/database.py,
line 193, in run_with_transaction
retval = func(*args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r645-py2.4.egg/turbogears/controllers.py,
line 253, in _execute_func
return _process_output(tg_format, output, html, fragment)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r645-py2.4.egg/turbogears/controllers.py,
line 66, in _process_output
fragment=fragment)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r645-py2.4.egg/turbogears/view.py,
line 60, in render
return engine.render(info, format, fragment, template)
  File
/home/.castor/mikez0r/download/trunk/plugins/kid/turbokid/kidsupport.py,
line 88, in render
tclass = self.load_template(template)
  File
/home/.castor/mikez0r/download/trunk/plugins/kid/turbokid/kidsupport.py,
line 42, in load_template
self.load_template(self.stname, True)
  File
/home/.castor/mikez0r/download/trunk/plugins/kid/turbokid/kidsupport.py,
line 56, in load_template
mod = kid.load_template(classname)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/kid-0.9a0-py2.4.egg/kid/__init__.py,
line 112, in load_template
raise Exception, Template not found: %s (in %s) % (
Exception: Template not found:
turbogears.fastdata.templates.sitetemplate (in
/home/.castor/mikez0r/elementarycatastrophe.com, /)



[TurboGears] Re: svn 645 sitetemplate not found error coming up again

2006-02-05 Thread Mike Sarahan

Fixed somehow in 646, with complete re-install



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-05 Thread Mike Sarahan

This error is still a showstopper for my site, even with SVN 646.
David, if you'd like, I will give you the login for my dreamhost site,
if it will help you track down the bug.

Mike



[TurboGears] Re: Found the source of Kid's TypeError: 'NoneType' object is not callable error

2006-02-05 Thread Mike Sarahan

Also, running a python setup.py develop in plugins/kid brings up the
sitetemplate not found error:

Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 99, in _run
self.main()
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 247, in main
body = page_handler(*virtual_path, **self.params)
  File string, line 3, in index
  File
/home/.castor/mikez0r/download/trunk/turbogears/controllers.py, line
218, in expose
func, tg_format, html, fragment, *args, **kw)
  File /home/.castor/mikez0r/download/trunk/turbogears/database.py,
line 193, in run_with_transaction
retval = func(*args, **kw)
  File
/home/.castor/mikez0r/download/trunk/turbogears/controllers.py, line
253, in _execute_func
return _process_output(tg_format, output, html, fragment)
  File
/home/.castor/mikez0r/download/trunk/turbogears/controllers.py, line
66, in _process_output
fragment=fragment)
  File /home/.castor/mikez0r/download/trunk/turbogears/view.py, line
60, in render
return engine.render(info, format, fragment, template)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 88, in render
tclass = self.load_template(template)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 42, in load_template
self.load_template(self.stname, True)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 56, in load_template
mod = kid.load_template(classname)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 108, in load_template
raise Exception, Template not found: %s (in %s) % (
Exception: Template not found:
turbogears.fastdata.templates.sitetemplate (in
/home/.castor/mikez0r/elementarycatastrophe.com, /)

I noticed that the kid version there is 0.8, so I ran python setup.py
develop in thirdparty/kid

That gives the same error, with the kid version changing to 0.9.



[TurboGears] Re: Stumped with SVN/dreamhost

2006-02-01 Thread Mike Sarahan

Oddly enough, this also shows up on my linux box with nothing taking
port 80 - so it must not be related to that.

I'm quite confused now.  Any help at all would be greatly appreciated.



[TurboGears] Re: Open Source applications

2006-01-25 Thread Mike Sarahan

If anyone is interested in working with my photo gallery app, they are
welcome to the source.

It's just a personal project currently, but someone could make it into
something more if they wanted to.  I'd imagine somewhere along the
lines of the PHP app Gallery

http://www.elementarycatastrophe.com

Can someone advise me on the best way to share source?

-Mike



[TurboGears] Re: cherrypy.request.paramMap

2006-01-25 Thread Mike Sarahan

Lee,

Thanks for your help.  You got it closer - now the edit page no longer
spits that error out.  I don't think I understand how the
cherrypy.request.paramMap works, though, because what's happening now
is that I'm getting addresses like this:

http://www.elementarycatastrophe.com/tg_fastcgi.fcgi/album?pathadd=2002?alt_ID=34

So it's getting the parameters for both the referring page (album gets
pathadd) and the edit page (gets alt_ID).

The cherrypy.request.paramMap is in the edit method, and the
previous_url string we constructed gets passed to a save_edits method
not unlike the wiki tutorial, which then uses that string for the
redirect.  This redirect is getting caught up on the funky string
above.

Why would it be picking up parameters from the edit method?

I've discovered that this has nothing to do with identity - using my
code, it gives the same error whether the method has the identity
decorator or not.



[TurboGears] Re: cherrypy.request.paramMap

2006-01-25 Thread Mike Sarahan

Lee,

This effectively got rid of the pathadd part, but the unfortunate thing
is that that is the part I wanted to keep.

I figured I'd just use

previous_url=previous_url[52:]

since it seems to construct the correct url, and though I don't
understand why it works, it works nevertheless and I'm not going to
complain until it breaks again.  Ignorance is bliss, so long as things
work?

Upon further exploration, the cherrypy.request.paramMap is unneccessary
for anyone who uses the GET method for their forms - if the items are
in the url, then it has been my observation that
cherrypy.request.headerMap.get(Referer, /) will pick up everything.

I have simplified my code to:
previous_url = cherrypy.request.headerMap.get(Referer, /)
previous_url = previous_url[52:]

And that works for me.
-Mike

PS for anyone following - check the penultimate line above, should be
%s?%s, not (...)



[TurboGears] Re: As of SVN rev. 579, sitetemplate is non-functional.

2006-01-25 Thread Mike Sarahan

I can confirm this.  When I updated to 579, my site ceased to work,
with errors citing sitetemplate being the reason.



[TurboGears] Re: howto configure server start page

2006-01-24 Thread Mike Sarahan

A hackish way to do it: You could put in a redirect in controllers.py

i.e.

@turbogears.expose()
def index(self):
raise cherrypy.HTTPRedirect(turbogears.url('/static/index.html'))

-Mike



[TurboGears] Re: templates in subdirectories

2006-01-24 Thread Mike Sarahan

can you give examples of what the sub dir's are called and how you are
trying to refer to them?

-Mike



[TurboGears] cherrypy.request.paramMap

2006-01-24 Thread Mike Sarahan

Hi guys,

I have some code added to my logout method so that it redirects users
to the page they were last looking at rather than back to the root of
the site.  The code is below.

@turbogears.expose()
def logout( self ):
identity.current.logout()
previous_url =
cherrypy.request.headerMap.get(Referer, /)
original_parameters=cherrypy.request.paramMap
itemlist='?'
for name,value in original_parameters.items():
itemlist=itemlist+'%s=%s' % name,value
itemlist=itemlist[:-1]
previous_url=previous_url[52:]+itemlist
raise turbogears.redirect(previous_url)

**As a side note, anyone who wants to use this code should change the
52 in brackets to the length of your base url.  This is my lame hack to
fix a problem with the entire web address being repeated twice. **

This works just fine in the logout method, but I've tried to copy it
into another section (my edit section, where people can edit
descriptions of pictures), and I get an error from identical code.  The
only difference between the two methods is that one has an
@identity.require (the edit method), and the other (the logout method)
doesn't.  I'm lost as to why this error is popping up from similar
code.  Any ideas?

The error:

  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
-py2.4.egg/cherrypy/_cphttptools.py, line 98, in _run
self.main()
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta
-py2.4.egg/cherrypy/_cphttptools.py, line 246, in main
body = page_handler(*virtual_path, **self.params)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0de
v_r544-py2.4.egg/turbogears/controllers.py, line 240, in newfunc
html, fragment, *args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0de
v_r544-py2.4.egg/turbogears/database.py, line 189, in
run_with_transaction
retval = func(*args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0de
v_r544-py2.4.egg/turbogears/controllers.py, line 257, in _execute_func
output = func(self, *args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0de
v_r544-py2.4.egg/turbogears/identity/conditions.py, line 230, in
_wrapper
return fn( self, *args, **kwargs )
  File
/home/.castor/mikez0r/elementarycatastrophe.com/photogal/photogal/contro
llers.py, line 416, in edit
itemlist=itemlist+'%s=%s' % name,value
TypeError: not enough arguments for format string

Thanks,
Mike



[TurboGears] Re: model and controller help

2006-01-24 Thread Mike Sarahan

for a model, it might be easier to define a separate column for Case
ID, rather than use the id column.

example:

class HPD_helpDesk(SQLObject):
Case_ID=IntCol(alternateID=True)
Priority=IntCol()(Could also be StringCol, for matching
'Low','Medium','High')
anything else

Have you looked into the wiki tutorial?  It will give you a better idea
of how things work.

-Mike



[TurboGears] Re: model and controller help

2006-01-24 Thread Mike Sarahan

The error seems to indicate that you haven't set up your database
properly.  Have you got a database installed, and have you done the
proper uncommenting/editing of dev.cfg/devcfg.py or
prod.cfg/prodcfg.py?

the .cfg files are for TG 0.8, the .py files are for SVN, use whatever
file is there...

Your query will look like this:

for all results:
results=list(HPD_HelpDesk.select())

for individual levels:
results = list(HPD_HelpDesk.select(HPD_HelpDesk.q.priority==1))

you could also do comparison with  or =, to get all priorities
greater than a given level.

Clear enough?

-Mike



[TurboGears] Re: model and controller help

2006-01-24 Thread Mike Sarahan

If your model has a class ticket,  then make one adjustment to my
above code:

results = list(HPD_HelpDesk.select(HPD_HelpDesk.q.priority==1))

should be:

results = list(HPD_HelpDesk.select(HPD_HelpDesk.ticket.q.priority==1))



[TurboGears] Re: model and controller help

2006-01-24 Thread Mike Sarahan

Go ahead and post your model, too, for reference's sake.  One thing
about it isn't clear to me - Is ticket a class or not?  It makes a
difference on how that query is constructed.



[TurboGears] Re: model and controller help

2006-01-24 Thread Mike Sarahan

was that hub not defined in your quickstart?

It is defined in a quickstart for me, but I'm running SVN.  I seem to
remember it being there for 0.8 as well.  Whatever, so long as you have
it now.

In order for your tables to work, you need to run

tg-admin sql create

in your project directory.  That might clear up the MS SQL error.



[TurboGears] MySQL sqlobject query

2006-01-21 Thread Mike Sarahan

Hi guys,

My queries worked just fine on Postgres, but now that I've moved to
dreamhost (MySQL), they don't return any results.  Here's my code:

  imgsearch=set(list(Searchtable.select(
OR(Searchtable.q.galleryterms.contains(term),
  Searchtable.q.imageterms.contains(term)

I've also tried this:


imgsearch=set(list(Searchtable.select(Searchtable.galleryterms LIKE
term OR Searchtable.imageterms LIKE term)))

but with that one, it doesn't recognize term as the variable that it
is.

Any suggestions on a better way to construct this query, or mangle/add
to term so that results get returned?  In playing with phpMyAdmin, I
realized that % wildcards are necessary for a successful query, but
changing term with the following line still doesn't return results:
term = '%'+term+'%'

I have verified that records are in the database with phpMyAdmin, and
that they match the criteria I'm looking for, I just think I'm not
using the right code to query/select.

Thanks,
Mike



[TurboGears] Re: MySQL sqlobject query

2006-01-21 Thread Mike Sarahan

This sure looks right to me,

 1/Select  :  SELECT searchtable.id, searchtable.galleryterms,
searchtable.imageterms, searchtable.alt__id FROM searchtable WHERE
((searchtable.galleryterms LIKE '%toronto%') OR (searchtable.imageterms
LIKE '%toronto%'))

Thinking that the OR might be confusing it somehow, I reduced the
complexity to one section:

 1/Select  :  SELECT searchtable.id, searchtable.imageterms,
searchtable.alt__id FROM searchtable WHERE (searchtable.imageterms LIKE
'%2002%')

Still nothing, although issuing a similar select from phpMyAdmin gives
the result that I expect.

phpMyAdmin SQL query:
SELECT *
FROM `searchtable`
WHERE `imageterms` LIKE CONVERT( _utf8 '%2000%'
USING latin1 )
COLLATE latin1_swedish_ci
LIMIT 0 , 30



[TurboGears] Re: Q: For debugging, how do I turn on .py output from Kid?

2006-01-21 Thread Mike Sarahan

from this thread:
http://groups.google.com/group/turbogears/browse_thread/thread/a306f55771b67bae/d72fb280d92edf05?q=kid+.py+output;

To turn on .py generation just have KID_OUTPUT_PY=true in your
server's environment.

-Mike



[TurboGears] Re: MySQL sqlobject query

2006-01-21 Thread Mike Sarahan

Ksenia, good idea - they don't look exactly the same, I agree.  I
copied/pasted the query from SQLObject debug into phpMyAdmin - and I
get the same results as with the phpMyAdmin query - so it looks as if
something isn't right with my database connection string or something
therein.  Other parts of the page that depend on the same database are
functional, though - just this search query is broken.  Hence my
confusion.



[TurboGears] Re: Error from TurboGears==0.9a0dev-r550

2006-01-21 Thread Mike Sarahan

this is a stab in the dark, and juding from the fact you've got that
egg there, probably won't fix anything, but have you run python
setup.py develop in your trunk directory?



[TurboGears] Re: MySQL sqlobject query

2006-01-21 Thread Mike Sarahan

Fixed it - no bug here, other than the ones crawling in my head,
destroying my ability to notice glaring programming errors.

-Mike



[TurboGears] Re: asking TG/CP what the project folder is

2006-01-20 Thread Mike Sarahan

Thanks guys,

I had hoped to find a way to do it without eggs, but I think eggs will
make it easier to distribute the project in the end, it may just take
people a bit longer to figure out how to install it.  Thanks for the
suggestions!

-Mike



[TurboGears] SVN on dreamhost - more problems

2006-01-20 Thread Mike Sarahan

Hi guys,

Here's the latest hitch I've run into with dreamhost:
The tg_fcgi.fcgi script uses the following to load config files:

if exists(join(code_dir, setup.py)):
turbogears.update_config(configfile=join(code_dir,
devcfg.py),modulename=PROJECTNAME.config)
else:
turbogears.update_config(configfile=join(code_dir,
prodcfg.py),modulename=PROJECTNAME.config)

Using that, it gets the configfile just fine, but the modulename gives
it trouble, because the tg_fcgi.fcgi script and project folder are in
different locations, i.e.:

/home/mikez0r/webpath/tg_fcgi.fcgi
/home/mikez0r/TGapps/photogal

How can I reconcile this difference in the modulename part of the code?

Thanks,
Mike



[TurboGears] Re: SVN on dreamhost - more problems

2006-01-20 Thread Mike Sarahan

Robin,

Here's the error:

Traceback (most recent call last):
  File ./tg_fastcgi.fcgi, line 58, in ?
tg_init()
  File ./tg_fastcgi.fcgi, line 47, in tg_init

turbogears.update_config(configfile=join(code_dir,devcfg.py),modulename=p
hotogal.config)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0de
v_r544-py2.4.egg/turbogears/config.py, line 119, in update_config
modfile = pkg_resources.resource_filename(packagename, modname +
.py)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/setuptools-0.6a9-p
y2.4.egg/pkg_resources.py, line 676, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/setuptools-0.6a9-p
y2.4.egg/pkg_resources.py, line 119, in get_provider
__import__(moduleOrReq)
ImportError: No module named photogal

Just to check something with you - /home/mikez0r/TGapps/photogal is the
base of my project - that's where devcfg.py etc. are.  I agree - it
should be able to find the file... but there's the error.

Thanks for the help,
Mike



[TurboGears] Re: SVN on dreamhost - more problems

2006-01-20 Thread Mike Sarahan

Both those files are there, but __init__.py is empty.  I did a fresh
quickstart, and the file is empty in that too, so I don't think
anything is especially wrong there.

Thanks for thinking on it.

In the meantime, I found a workaround.  It seems to be something about
code_dir not working - if I move my project dir into the webfolder, and
change any PROJECTNAME.xxx references to PROJECTNAME.PROJECTNAME.xxx
references, it works.

I'll see if I can find the glitch later.



[TurboGears] Re: SVN 532 server barf

2006-01-19 Thread Mike Sarahan

This worked well on my gentoo linux box, but on dreamhost, I get the
following error:

IndentationError: expected an indented block
[compton]$ python setup.py install
Traceback (most recent call last):
  File setup.py, line 2, in ?
from turbogears.finddata import find_package_data
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r535-py2.4.egg/turbogears/__init__.py,
line 14, in ?
from turbogears import controllers
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r535-py2.4.egg/turbogears/controllers.py,
line 12, in ?
import view
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r535-py2.4.egg/turbogears/view.py,
line 259, in ?
engine = entrypoint.load()
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/setuptools-0.6a9-py2.4.egg/pkg_resources.py,
line 1625, in load
entry = __import__(self.module_name, globals(),globals(),
['__name__'])
  File
/home/.castor/mikez0r/download/trunk/plugins/kid/turbokid/kidsupport.py,
line 53
 .mine
^
IndentationError: expected an indented block

The lines giving problems were:
 .mine
==
 .r535

Looking at the code, it seems like those lines are probably comments.
I commented the 3 lines out, and everything works ok now.  FYI...



[TurboGears] Re: dreamhost, fastcgi, and .htaccess

2006-01-19 Thread Mike Sarahan

I understand this a little better now, and would make the following
changes:

1) Since the TG on dreamhost doc says it's not a good idea to have your
TG app in the webfolder, I moved mine to TGapps.  All that changes is a
line in tg_fastcgi.fcgi.

2) static files can remain in webfolder/static, or move elsewhere to be
less easily accessible to wanderers, just make sure static setting in
config.py/dev.cfg/prod.cfg/whatever is correct.

3) only one .htaccess file is necessary, and it goes in the webfolder.
I've updated it to read:

RewriteEngine   On
RewriteRule !^stat   -
 [C]
RewriteRule ^(tg_fastcgi\.fcgi/.*)$ -   [L]
RewriteRule !^stat   -
 [C]
RewriteRule ^(.*)$   tg_fastcgi.fcgi/$1
 [L]

This way, the analog stats are also still accessible, as well as the
static folder being served by apache, if it is in the webfolder.

Let me know how this works for you, if you use it.



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

2006-01-19 Thread Mike Sarahan

Sean,

I would greatly appreciate your help in troubleshooting my setup.  I'm
running into the same error that Sarah was.  I have followed the
instructions closely.

Here's what I'm working with:
Dreamhost
SVN 537
Dreamhost's MySQL database
I have downloaded and installed the mysql python libraries that were in
the directions on the trac.

I have edited the tg_fastcgi.fcgi script as we discussed in the thread
http://groups.google.com/group/turbogears/browse_thread/thread/b069b5e867d572aa/3f8470f09f1d930a?q=dreamhostrnum=1#3f8470f09f1d930a

when I run ./tg_fastcgi.fcgi, the proper output goes to stdout.log, but
when I try to access the site or run python tg_fastcgi.fcgi, I get the

WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!

errors.

any ideas?

Thanks,
Mike



[TurboGears] SVN 532 server barf

2006-01-18 Thread Mike Sarahan

Hi guys,

Ran into this this morning after updating to 532 from 518:

Page handler: bound method Root.index of photogal.controllers.Root
object at 0xb749f3ac
Traceback (most recent call last):
  File
/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 98, in _run
self.main()
  File
/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 246, in main
body = page_handler(*virtual_path, **self.params)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/controllers.py,
line 240, in newfunc
html, fragment, *args, **kw)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/database.py,
line 189, in run_with_transaction
retval = func(*args, **kw)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/controllers.py,
line 262, in _execute_func
return _process_output(tg_format, output, html, fragment)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/controllers.py,
line 62, in _process_output
output = view.render(output, tg_format,
template=template,fragment=fragment)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/view.py,
line 57, in render
return engine.render(info, format, fragment, template)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 70, in render
tclass = self.load_template(template)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 34, in load_template
self.load_template(self.stname, True)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 47, in load_template
mod = kid.import_template(classname)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 71, in import_template
mod = __import__(name)
  File /usr/lib/python2.4/ihooks.py, line 405, in import_module
m = self.load_tail(q, tail)
  File /usr/lib/python2.4/ihooks.py, line 456, in load_tail
m = self.import_it(head, mname, m)
  File /usr/lib/python2.4/ihooks.py, line 495, in import_it
m = self.loader.load_module(fqname, stuff)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/importer.py,
line 117, in load_module
return ihooks.ModuleLoader.load_module(self, name, stuff)
  File /usr/lib/python2.4/ihooks.py, line 274, in load_module
m = self.hooks.load_package(name, filename, file)
  File /usr/lib/python2.4/ihooks.py, line 174, in load_package
return imp.load_module(name, file, filename, (, ,
PKG_DIRECTORY))
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/fastdata/__init__.py,
line 1, in ?
from datacontroller import DataController, AjaxDataController
  File /usr/lib/python2.4/ihooks.py, line 404, in import_module
q, tail = self.find_head_package(parent, str(name))
  File /usr/lib/python2.4/ihooks.py, line 440, in find_head_package
q = self.import_it(head, qname, parent)
  File /usr/lib/python2.4/ihooks.py, line 495, in import_it
m = self.loader.load_module(fqname, stuff)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/importer.py,
line 117, in load_module
return ihooks.ModuleLoader.load_module(self, name, stuff)
  File /usr/lib/python2.4/ihooks.py, line 270, in load_module
m = self.hooks.load_source(name, filename, file)
  File /usr/lib/python2.4/ihooks.py, line 168, in load_source
return imp.load_source(name, filename, file)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/fastdata/datacontroller.py,
line 9, in ?
class DataGrid(widgets.Widget):
  File
/usr/lib/python2.4/site-packages/FormEncode-0.4-py2.4.egg/formencode/declarative.py,
line 84, in __new__
cls.__classinit__(cls, new_attrs)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/widgets/base.py,
line 56, in __classinit__
cls.template = kid.load_template(t, name=modname).Template
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 121, in load_template
mod = importer._create_module(code, name, filename, store=cache)
  File
/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/importer.py,
line 92, in _create_module
exec code in mod.__dict__
  File string, line 1, in ?
  File /usr/lib/python2.4/ihooks.py, line 403, in import_module
parent = self.determine_parent(globals)
  File /usr/lib/python2.4/ihooks.py, line 423, in determine_parent
parent = self.modules[pname]
KeyError: 'turbogears.fastdata.datacontroller.DataGrid'



[TurboGears] Re: SVN 532 server barf

2006-01-18 Thread Mike Sarahan

Server info:

happening on both:
x86 Gentoo Linux/Postgres

and
Dreamhost/mysql



[TurboGears] Re: dreamhost, fastcgi, and .htaccess

2006-01-18 Thread Mike Sarahan

I'm also wondering about this.  Setting the staticFilter.dir does not
seem to work as it should with DH.  In addition, does anyone know if
it's at all possible to not include the tg_fastcgi.fcgi as part of the
URL?

I'm thinking not, but I'd like very much if it is possible.  Should we
start petitioning DH to add mod_python support?  I never got it working
on my home server, so does anyone with experience with it recommend it
over fastcgi?



[TurboGears] Re: SVN 532 server barf

2006-01-18 Thread Mike Sarahan

OK,

in plugins/kid/turbokid/kidsupport.py, I changed:
kid.import_template to kid.load_template

After re-running python setup.py install in plugins/kid, and killing
all server processes, then restarting, here's the output:

Page handler: bound method Root.index of photogal.controllers.Root
object at 0x409ae80c
Traceback (most recent call last):
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 98, in _run
self.main()
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/_cphttptools.py,
line 246, in main
body = page_handler(*virtual_path, **self.params)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/controllers.py,
line 240, in newfunc
html, fragment, *args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/database.py,
line 189, in run_with_transaction
retval = func(*args, **kw)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/controllers.py,
line 262, in _execute_func
return _process_output(tg_format, output, html, fragment)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/controllers.py,
line 62, in _process_output
output = view.render(output, tg_format,
template=template,fragment=fragment)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboGears-0.9a0dev_r532-py2.4.egg/turbogears/view.py,
line 57, in render
return engine.render(info, format, fragment, template)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 70, in render
tclass = self.load_template(template)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 34, in load_template
self.load_template(self.stname, True)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 47, in load_template
mod = kid.load_template(classname)
  File
/home/.castor/mikez0r/lib/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/__init__.py,
line 108, in load_template
raise Exception, Template not found: %s (in %s) % (
Exception: Template not found:
turbogears.fastdata.templates.sitetemplate (in
/home/.castor/mikez0r/elementarycatastrophe.com, /)

So it's looking for the sitetemplate in the wrong place?



[TurboGears] Re: Does anybody do webproject with frames/framesets on TurboGears?

2006-01-18 Thread Mike Sarahan

instead of frames, I've got layered templates.

Content extends menu extends master

It works well enough for me, so long as the content doesn't get too
long.  I do like how frames always keep some content in view.



[TurboGears] Re: dreamhost, fastcgi, and .htaccess

2006-01-18 Thread Mike Sarahan

Jeremy,

Try this:
Move your static dir to the root of your web folder.  Move all TG files
into another deeper folder, if they're in the web folder.

Example:
elementarycatastrophe.com/projectname/

move all static content into static folder in web folder

and here's the .htaccess:
RewriteEngine On
RewriteRule !^static   - [C]
RewriteRule (.*) projectname/$1   [L]



[TurboGears] Re: dreamhost, fastcgi, and .htaccess

2006-01-18 Thread Mike Sarahan

be careful,  I seem to have just killed about 1.5 gigs of uploaded junk
by trying to move that static folder.

A simple
mv static /home/mikez0r/webaddress

copied over only favicon and a new file named empty
None of my uploaded stuff got moved.

Has DH seemed a bit flaky to you?



[TurboGears] Re: dreamhost, fastcgi, and .htaccess

2006-01-18 Thread Mike Sarahan

Jeremy,

I am betting you're attentive and knowledgeable enough to know that you
should move your original .htaccess file in with your other turbogears
files, but just in case, and for anyone else who might need more
details...

make sure you do that, rather than editing the old fastcgi one.



[TurboGears] Re: Does anybody do webproject with frames/framesets on TurboGears?

2006-01-18 Thread Mike Sarahan

I've thought about this some more.  I don't think it'd be hard.  My
first idea of implementation would be a static frameset index.htm
(doesn't have to be, could be template, but it would be pretty much all
static anyway), with everything else working normally, and using target
to pick frames.  I bet it would work more or less just like regular
html, but some of the URL work might get mucked up.  Example -
HTTPRedirects would likely break the frames, and take people directly
to pages.



[TurboGears] Re: How to set up a database script ?

2006-01-18 Thread Mike Sarahan

I don't think so - just put the URI where he's got the parentheses.
What else is in the config files that you need?

Just make sure you use the correct URI for the database you want to
massage.



[TurboGears] Re: How to set up a database script ?

2006-01-18 Thread Mike Sarahan

Sorry, a better answer:

yes, I think it does ignore config files, but I don't think you need
anything but the db URI from them.  So, it will work anyway, with a
string for the db URI rather than importing that string from a config
file.



[TurboGears] Re: How to set up a database script ?

2006-01-18 Thread Mike Sarahan

Thanks Karl,

that improved the portability of my project enormously.



[TurboGears] Re: dreamhost, fastcgi, and .htaccess

2006-01-18 Thread Mike Sarahan

One other detail to pay attention to when using the rewrite recipe
above:

You have to change either devcfg.py or prodcfg.py server.webpath to
accurately reflect where tg_fastcgi.fcgi is

ie
/projectname/tg_fastcgi.fcgi
instead of
/tg_fastcgi.fcgi



[TurboGears] Re: Dreamhost and new .py config files

2006-01-17 Thread Mike Sarahan

Thanks Sean!

-Mike



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

2006-01-12 Thread Mike Sarahan

Jared,

Mine cleared up - can't really explain why.  I noticed that after
wiping out all TG-related eggs in site-packages, then re-running python
setup.py develop in trunk, then running python setup.py install in
plugins/kid, it worked for a little while.  So whenever it would break,
I'd just go through that process.  I keep on expecting it to break
again, but it's been running smoothly for a couple of days now, despite
my best efforts.

Mike



[TurboGears] identity and templates

2006-01-11 Thread Mike Sarahan

Hi all, but especially Jeff Watkins -

I've noticed that for identity-restricted methods, the new,
less-specific means of identifying the template to be used (i.e.
.templates.templatename) doesn't work.  I must still specify
projectname.templates.templatename, otherwise I get an error about
module templates not existing.

-Mike



[TurboGears] Re: How to move app from one machine to the other?

2006-01-11 Thread Mike Sarahan

I'm not familiar with what Sysgen-Test-DB is.  Google says nothing
about it.  It looks to me like it might be one of your databases that
you're trying to use, whether intentionally or accidentally.

I suggest you check a couple of things:

1.  Make sure your path to your database (in devcfg.py or dev.cfg) is
set properly, for the database that you have installed.
2.  Make sure that no other URI paths are uncommented.

If nothing else works, you can try to copy/paste your important files
(controllers.py, model.py, templates, anything else you know of) into a
new quickstart on your pc.  And if that doesn't work, try to merge the
mac files with the pc ones manually.

On your pc, somehow search through the text of your TG directory for
Sysgen-Test-DB.  I'm a linux guy, I'd use grep.  I don't know what the
mac/windows equivalent is.

On linux:
grep -R 'Sysgen-Test-DB' *

Good luck.
-Mike



[TurboGears] Re: Templates not loading?

2006-01-10 Thread Mike Sarahan

Thanks! that's a big improvement.



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

2006-01-10 Thread Mike Sarahan

This problem (or something very much like it) cropped up for me again.

I get it only when trying to access my query methods/templates, not on
any of my static methods/templates that just serve as html.  Once it
breaks, the static methods remain functional, but none of the dynamic
content templates work anymore.

Here's the first error:

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


If I then refresh the page, I get a second error:

Traceback (most recent call last):
  File
/usr/lib/python2.4/site-packages/CherryPy-2.1.1-py2.4.egg/cherrypy/_cphttptools.py,
line 271, in run
main()
  File
/usr/lib/python2.4/site-packages/CherryPy-2.1.1-py2.4.egg/cherrypy/_cphttptools.py,
line 502, in main
body = page_handler(*args, **cherrypy.request.paramMap)
  File /home/mikez0r/TG0.9/trunk/turbogears/controllers.py, line 240,
in newfunc
html, fragment, *args, **kw)
  File /home/mikez0r/TG0.9/trunk/turbogears/database.py, line 189, in
run_with_transaction
retval = func(*args, **kw)
  File /home/mikez0r/TG0.9/trunk/turbogears/controllers.py, line 262,
in _execute_func
return _process_output(tg_format, output, html, fragment)
  File /home/mikez0r/TG0.9/trunk/turbogears/controllers.py, line 62,
in _process_output
output = view.render(output, tg_format,
template=template,fragment=fragment)
  File /home/mikez0r/TG0.9/trunk/turbogears/view.py, line 57, in
render
return engine.render(info, format, fragment, template)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 123, in render
tclass = self.load_template(template)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 97, in load_template
mod = _freshen_template(package, basename, tfile, classname)
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 45, in _freshen_template
if _freshen_bases(bases, saved_ctime) or saved_ctime  mtime:
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 23, in _freshen_bases
if _freshen_bases(base.__bases__, saved_ctime):
  File
/usr/lib/python2.4/site-packages/TurboKid-0.9.0-py2.4.egg/turbokid/kidsupport.py,
line 29, in _freshen_bases
mtime = os.stat(sys.modules[modname].__file__).st_mtime
KeyError: 'kid.util.template_0x3E44F9BL'


Tried to fix by getting latest SVN, running python setup.py develop,
and also running python setup.py install in the plugins/kid directory.



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

2006-01-10 Thread Mike Sarahan

All right, things have switched around.  I cleaned out all TG-related
folders in my python/site-packages.  Updated SVN to 502.  Ran python
setup.py develop in my trunk dir.

Now only my dynamic-data templates will load.

Same error message as the first one above, and refreshing this time
only results in the same error, not a different one.



[TurboGears] Re: Proposal: TurboGears extensions

2006-01-10 Thread Mike Sarahan

Jeff,

I think this is a good idea, especially considering how different
people's needs/wants have proven to be so far.  One thought I have is
to somehow tie in default config files for a given set of extensions -
maybe concatenate them to a standard skeleton config file, or replace
the skeleton config file with a more full-featured file.  I say this
because I know that I would likely try to enable something that may not
be installed, and then wonder why it wouldn't work.  If the config
shows up automatically with extension installation, it might be nice.

I realize most options are self-explanatory, but I especially like
Gentoo Linux's approach to config files - the default config files are
usually very simple, but there are example config files with most or
all options shown as examples.

Perhaps complete example config files could be included as part of the
extension, for the user to integrate with or overwrite the default
config.

-Mike



[TurboGears] Re: quickstart and config changes

2006-01-10 Thread Mike Sarahan

It's probably better that you still have them - that way you can copy
any config that may not be in the default files.  For example, I use
the access log feature of cherrypy, and have to look it up.



[TurboGears] Re: tg-admin sql create no longer creates identity or visitor tables

2006-01-09 Thread Mike Sarahan

Jeff,

I think what you're working towards is a functioning identity doohickey
pretty much immediately after enabling it in dev.cfg, without config
anywhere else.  A commendable idea, I think, but it's not there yet.
With a fresh quickstart, dev.cfg edits, and python test-start.py,

I get the following error when trying to access the site:

Traceback (most recent call last):
  File
/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py,
line 269, in run
applyFilters('beforeMain')
  File
/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py,
line 641, in applyFilters
method()
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r485-py2.4.egg/turbogears/visit.py,
line 80, in beforeMain
plugin.record_request( visit.id )
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r485-py2.4.egg/turbogears/identity/visitor.py,
line 134, in record_request
identity= self.identity_from_request(visit_id)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r485-py2.4.egg/turbogears/identity/visitor.py,
line 58, in identity_from_request
identity= source(visit_id)
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r485-py2.4.egg/turbogears/identity/visitor.py,
line 94, in identity_from_visit
return self.provider.load_identity( visit_id )
  File
/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r485-py2.4.egg/turbogears/identity/soprovider.py,
line 156, in load_identity
visit= TG_VisitIdentity.by_visit_id( visit_id )
  File string, line 1, in lambda
  File
/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py,
line 1266, in _SO_fetchAlternateID
result, obj = cls._findAlternateID(name, dbName, value, connection)
  File
/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/main.py,
line 1262, in _findAlternateID
value), None
  File
/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py,
line 585, in _SO_selectOneAlt
return self.queryOne(SELECT %s FROM %s WHERE %s = %s %
  File
/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py,
line 748, in queryOne
return self._dbConnection._queryOne(self._connection, s)
  File
/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py,
line 339, in _queryOne
self._executeRetry(conn, c, s)
  File
/usr/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/dbconnection.py,
line 295, in _executeRetry
return cursor.execute(query)
ProgrammingError: ERROR:  relation tg_visit_identity does not exist

SELECT id, visit_id, user_id FROM tg_visit_identity WHERE visit_id = 1


I don't think the auto-generation of tables on application start is
working yet.

-Mike



[TurboGears] Re: tg-admin sql create no longer creates identity or visitor tables

2006-01-09 Thread Mike Sarahan

One more thought, though I feel bad for tacking on this many messages
at once:  Could it be that the tables are getting generated properly,
but the relations aren't?  I'll look up how to use Postgres a little
better and find out what's in the database.

-Mike



[TurboGears] Re: Templates not loading?

2006-01-09 Thread Mike Sarahan

Sorry, I am officially an idiot - I had renamed my project, but
neglected to rename every single template reference in my controllers
file.

Thanks if you had read this and intended on trying to help me.