unit testing best practices
Hello, In my latest project I'm finally implementing unit tests from square one, trying to get as close to 100% test coverage as possible. Being new to unit testing I've noticed that almost all online information, including anything in the Pylons documentation and book, deals with the easy part: how writing unit tests works technically and what tools can help you write them. However, the more interesting (and difficult) question is not how to test, but what to test for. What to test for is something you learn from experience (i.e. testing for similar bugs to what you've encountered in the past or if a supposedly fixed bug might pop up again). Does anyone have any useful experiences or thoughts about the rationale behind their unit tests? It would be interesting to compile some best practices and general patterns for writing unit tests for Pylons-based applications (even if it are just some general tips or ideas, though specific issues you've experienced are very interesting as well). Back to my own project: I'm still working on writing the models and, of course, their unit tests. If you have any ideas about pitfalls to avoid or better ways to test here are the tests as I've written them so far: http://bitbucket.org/fmw/edgar/src/tip/edgar/tests/ My own experiences so far: - the concept of writing tests before you write the actual code from test-driven development is worth sticking to, as it is harder to guarantee the integrity of the tests if you do it the other way around, and, - it is not enough to recreate your tables before running each test, meaning you need to actually clean up model.Session at the same time (i.e. purge open transactions that might still contain remnants from previous tests). My apologies if this is outside of the scope of the list. -Filip --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
modwsgi + Pylons gives segmentation fault
I am trying to setup mod_wsgi + Pylons on my deployment server (a CentOS 5.2 machine), but I get this error message in the apache log files [Tue Feb 24 11:24:32 2009] [notice] child pid 12226 exit signal Segmentation fault (11) a standard wsgi test programs works fine. The myapp.wsgi script is: import os, sys eggcache = '/var/www/vhosts/eggcache' sys.path.append('/home/ruben/myapp') os.environ['PYTHON_EGG_CACHE'] = eggcache from paste.deploy import loadapp application = loadapp('config:/home/ruben/myapp/development.ini') The apache process has write access in the eggcache directory If set debug = false in the development .ini The setup works perfectly on my development machine Any help how to debug --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: modwsgi + Pylons gives segmentation fault
On 24/02/2009, at 9:37 PM, cropr wrote: I am trying to setup mod_wsgi + Pylons on my deployment server (a CentOS 5.2 machine), but I get this error message in the apache log files [Tue Feb 24 11:24:32 2009] [notice] child pid 12226 exit signal Segmentation fault (11) a standard wsgi test programs works fine. I had to disable mod_cache to avoid a clash between it and sqlite causing Apache to segfault. You may want to try this first to make sure you aren't being hit by the same problem. Refs: http://www.mail-archive.com/sqlite-us...@sqlite.org/msg34866.html http://oss.itsystementwicklung.de/trac/pysqlite/ticket/146 Cheers, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: modwsgi + Pylons gives segmentation fault
On Feb 24, 9:37 pm, cropr ruben.dec...@gmail.com wrote: I am trying to setup mod_wsgi + Pylons on my deployment server (a CentOS 5.2 machine), but I get this error message in the apache log files [Tue Feb 24 11:24:32 2009] [notice] child pid 12226 exit signal Segmentation fault (11) a standard wsgi test programs works fine. The myapp.wsgi script is: import os, sys eggcache = '/var/www/vhosts/eggcache' sys.path.append('/home/ruben/myapp') os.environ['PYTHON_EGG_CACHE'] = eggcache from paste.deploy import loadapp application = loadapp('config:/home/ruben/myapp/development.ini') The apache process has write access in the eggcache directory If set debug = false in the development .ini The setup works perfectly on my development machine Any help how to debug Have you read the documentation, in particular the sections which talk about circumstances where crashes can occur. http://code.google.com/p/modwsgi/wiki/InstallationIssues http://code.google.com/p/modwsgi/wiki/ApplicationIssues Because you do not say which version of Python you are using, harder to make a guess at what the issue may be. Normally the problem is going to be a mismatch in shared library versions used by Apache, PHP or some other Apache module and what a Python module uses. In some cases the problem can be because of third party Python modules not designed to run in sub interpreters. Not knowing what your application does and what major Python modules/ packages it uses, again makes it harder to guess. Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Pylons 0.9.7 released
On Mon, Feb 23, 2009 at 8:46 PM, Ben Bangert b...@groovie.org wrote: Pylons 0.9.7 has been released, I've posted a full write-up on it on the PylonsHQ site: http://pylonshq.com/articles/archives/2009/2/pylons_097_released Congratulations Ben, I made no secret of my reservations in the past but I'm truly happy you guys made it. Hope to upgrade our company codebase to the new Pylons as soon as possible. And great experiment (the website with couchdb) by the way -- Lawrence, http://oluyede.org - http://twitter.com/lawrenceoluyede It is difficult to get a man to understand something when his salary depends on not understanding it - Upton Sinclair --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: formbuild.handle missing
I should be able to read through these new docs in the next couple of days, so will provide any feedback if I have any. Thanks, that would be useful. On reflection I'd say there were a couple of things that are obviously missing from the treatmentL i) the introduction of a form token for basic XSS protection, as provided by webhelpers.html.secure_form [1] and ii) a check that when a form is re-rendered on validation failure, any data that was entered in password fields is removed before the form is sent for re-presentation. [1] http://www.pylonshq.com/docs/en/0.9.7/thirdparty/webhelpers/html/html/#webhelpers-html-secure-form --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: 0.9.7 and Elixir
Shabti sounds interesting though I've not looked at it. Here I've updated the pastebin thingy (and deleted the old one): http://pylonshq.com/pasties/e0131b490dafc08b30633c506ca29931 --Isaac --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
translation of the docs to portuguese
Hi all! Pylons has docs localization and looks that the only available language besides english is japanese (http://www.pylonshq.com/docs/ja/0.9.7/). I would like to translate it to portuguese, how should I proceed? Just clone the repository on some place, make the work and request a merge? -- []' - Walter waltercruz.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: 0.9.7 and Elixir
On Feb 24, 3:35 pm, Isaac nerk...@gmail.com wrote: Shabti sounds interesting though I've not looked at it. Here I've updated the pastebin thingy (and deleted the old one):http://pylonshq.com/pasties/e0131b490dafc08b30633c506ca29931 Could you explain the reasoning behind your choice of kwargs to sessionmaker? Are they related to using elixir or are they dictated by the application? ++ # you may want different args to sessionmaker here: ++ Session = orm.scoped_session(orm.sessionmaker(autoflush=False, expire_on_commit=False)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: translation of the docs to portuguese
On Feb 24, 2009, at 8:25 AM, Walter Cruz wrote: Pylons has docs localization and looks that the only available language besides english is japanese (http://www.pylonshq.com/docs/ja/0.9.7/ ). I would like to translate it to portuguese, how should I proceed? Just clone the repository on some place, make the work and request a merge? Yup. Clone the repo on bitbucket, like how the Ukraine and Japanese ones are: http://bitbucket.org/patriotyk/pylons-ukraine/overview/ http://bitbucket.org/knzm/pylons-ja/overview/ Note that you should get familiar with Mercurial named branches, as there are now 2 additional branches. One for further 0.9.7 bug-fix releases (which is where you should be working for 0.9.7 doc translations), one for the upcoming 0.10 backwards compatible release, and the trunk which is for the 1.0 release. Once you're working in the 0.9.7.x branch, clone the pylons/docs/en dir to pylons/docs/po (Or whatever 2 letter i18n goes for Portuguese), and translate away! Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Mako template examples
Hi everyone, I inherited a horrible mess of Myghty templates, most of which are a cut-and-paste disaster. I've decided to undertake refactoring them and converting to Mako. The Mako docs are great and explain all kinds of wonderful things I could do. But never having had a maintainable template system for an app that displays lots of tabular data, I don't really know where I want to go. I downloaded the pydotorg examples from the Mako site, but their system is wy more complicated than I need or want [1]. Anyone know of a free software app that uses Mako, in a pretty direct fashion, and has a nice template structure I could pick apart to learn from? Thanks, Ross [1] Though the approach of using RFC-822 headers in text files that get translated into HTML is probably the most brilliant idea I've ever seen in HTML construction. If that were refactored into a standalone library, I'd use it. It's beautiful, though complicated. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
AuthKit groups and roles
What difference between Authkit Roles and Groups? Looking the SimpleSite (chap 3 in pylonsbook) I'v see users, roles, users_roles, groups tables in DB structure. roles join to users by users_roles.user_uid to users_roles.role_uid. How to connect groups to users? What is Groups? Is it combine of Roles or something else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Accessing callers context from callee method
* ** Accessing callers context from callee method** * when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i Thanks a lot -- Bidegg worlds best auction site http://bidegg.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Authorization with repoze.what in Pylons
I've been trying to go through the repoze.what guide, but when i try and start up my app I get the following: ImportError: No module named what.plugins.quickstart I've installed repoze.what_pylons and repoze.what_quickstart with easy_install and I'm running python 2.5. I can see both packages in my site-packages directory. I've tried to import from a python shell and I get the same error. Also, if I import repoze.what and do a dir (repoze.what.plugins) I don't see quickstart listed. Has anyone seen this before or have any suggestions? As an afterthough, it looks like repoze.what.plugins.sql is doing the same thing. Thanks in advance for any help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Accessing callers context from callee method
It would be possible if foo() was declared inside of func(): def func(): i=10 def foo(): print i foo() On Tue, Feb 24, 2009 at 10:54 AM, mobiledream...@gmail.com wrote: * ** Accessing callers context from callee method** * when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i Thanks a lot -- Bidegg worlds best auction site http://bidegg.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Authorization with repoze.what in Pylons
Hello, I'd make sure they're indeed installed in the current virtualenv: easy_install -U repoze.what-quickstart repoze.what-pylons This is the first time I see this problem, but I'm sure it's in the virtualenv. HTH. -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
project using pylons
Hi, I am a pylons newbies and think it'd be great to learn from projects/ code that are using pylons. I've read through some tutorial pylons projects but still wondering if there are any large-scale open sourced projects using pylons? It'd nice to have a compiled list of projects using pylons. Please advise. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Accessing callers context from callee method
On Feb 24, 10:54 am, mobiledream...@gmail.com wrote: * ** Accessing callers context from callee method** * when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i Thanks a lot May ask why you want to do this? There might be an easier way to accomplish whatever is you're trying to do. I think it is possible, but not without doing some funky magic. You might want to just use a class or pass local vars from func to foo. Maybe foo(**locals())? BTW, what you're calling methods look like functions in your example. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Accessing callers context from callee method
On Tue, Feb 24, 2009 at 12:13 PM, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote: On Feb 24, 10:54 am, mobiledream...@gmail.com wrote: * ** Accessing callers context from callee method** * when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i Thanks a lot May ask why you want to do this? There might be an easier way to accomplish whatever is you're trying to do. I think it is possible, but not without doing some funky magic. You might want to just use a class or pass local vars from func to foo. Maybe foo(**locals())? You can access the execution stack using the ``inspect`` module, or by raising a bogus exception and catching the traceback. However, this is justifiable only in very narrow circumstances, where a generic routine needs to do magic on a wide variety of callers, such as where the ``traceback`` module prints a stack trace, or the equivalent in GUI frameworks and debuggers. The rule of encapsulation argues that a function should operate only on its arguments. So you should pass everything it needs. foo(**locals()) can be paired with def foo(**kw): to get all the local variables in one step. However, if you want to modify data in the caller, you either need to put it in the return value, or pass a mutable argument (such as a list, dict, or instance) that the function can modify in place. Or if these are methods in a class, the method can modify 'self' attributes. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Authorization with repoze.what in Pylons
Thank you so much for the fast response. easy_install -U did the trick. When I ran it I got: repoze.what-xxx is already the active version in easy-install.pth for both packages. It would seem to me that running the command wouldn't have done much. Can you explain why it might have fixed the problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
new pylons site - ArtWeLove.com + Open Source Framework
We just launched ArtWeLove.com Everything but the /news section is in Pylons . The /news section is a customized install of MovableType. Some cookies , PHP , and a whole bunch of postgresql views in Pylons to map the MT structure tie everything together. Its got a few bugs -- we launched a day early, thanks to a partner hitting send on an email blast to 15k people , and needing to be public enough for them. sigh. The system runs on top of a framework called OpenSNS -- something that we had been developing in FindMeOn.com to prototype and deliver our Open Social Network (OpenSN) projects and standards. It's been used in a number of projects that I'm associated with for the past few years and will shortly available to all under the MIT license. ( its friends only MIT until some security issues are worked out, when they are.. its public. if you'd like to be a friend, contact offlist ) Open Social Network gives developers the ability to rapidly prototype and build production-quality web services. It's a series of Python packages and Pylons controllers , along with a standardized Database Schema, that developers can subclass, inherit, override or throw away -- allowing people to take what they need and toss the rest. The design goals were: - handle common tasks - don't enforce any sort of database concept ( everything is handled through sqlalchemy table mapping, and work continues to make column actions configurable ) - allow startups to skip the first 6 weeks of development - allow advertising agencies the ability to create web projects with speed - allow everything to be overridden or thrown away, for people to seamlessly migrate to other frameworks or custom systems to handle their data, by representing data in according to industry best- practices and standards It handles: - account creation , management , lostpassword, forgotpassword, etc - login , logout , preview - u2u relations: friend , follow , contact - profile pages w/s3 storage for images - and a whole other slew of things --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Authorization with repoze.what in Pylons
Looks like I spoke too soon with that last post. So I am now able to import everything properly through the python shell under the virtualenv, but when I try and serve my app or enter the paster shell, I get the error I was getting before: ImportError: No module named what.plugins.quickstart I'm sure this is an issue with the virtualenv, so I removed the line from my code and entered the paster shell and ran the command manually, and it imports just fine. I'm really at a loss with this now. This is the first project I've used the virtualenv with, are there some issues with it? Is it best to just drop it and use the standard environment? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Accessing callers context from callee method
On 02/24/2009 10:54 AM, mobiledream...@gmail.com wrote: * ** Accessing callers context from callee method** * when i call a method foo from another method func. can i access func context variables or locals() from foo so def func(): i=10 foo() in foo, can i access func's local variables on in this case i This is probably a better topic for comp.lang.python or the python commuity list. Regardless... The way to do this is you climb up the calling stack and investigate the caller's locals. import sys def func(): i=10 foo() def foo(): print sys._getframe(1).f_locals['i'] func() Pretty straightforward. I do not recommend you write code like this. I certainly don't recommend you mess around with the locals so your functions can give you surprising results. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: 0.9.7 and Elixir
On Feb 24, 10:26 am, Graham Higgins gjhigg...@googlemail.com wrote: On Feb 24, 3:35 pm, Isaac nerk...@gmail.com wrote: Shabti sounds interesting though I've not looked at it. Here I've updated the pastebin thingy (and deleted the old one):http://pylonshq.com/pasties/e0131b490dafc08b30633c506ca29931 Could you explain the reasoning behind your choice of kwargs to sessionmaker? Are they related to using elixir or are they dictated by the application? ++ # you may want different args to sessionmaker here: ++ Session = orm.scoped_session(orm.sessionmaker(autoflush=False, expire_on_commit=False)) Hi, Well, the best explanation I have is that these values are how I want the Session to behave, which is why I put a comment saying you may want to put something else there. Maybe some other values are more sane for a typical or smaller app than the one I'm working on at the moment (which is not small, and probably not typical). If there is some agreement on that, I'll gladly make a new pastie with a correction. :) I suggest reading http://www.sqlalchemy.org/docs/05/reference/orm/ sessions.html#sqlalchemy.orm.sessionmaker for more explanation of what those options do... try them out, and then decide what's right for your situation/app. HTH. --isaac --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Authorization with repoze.what in Pylons
Alright, problem solved. Unfortunately I've got to attribute this one to my own stupidity. Before i found your guide, I was going through another one that recommended putting the lib/auth functions in a file called repoze located in lib/auth. Of course doing that made the program look into that repoze file when I tried to import the module. Thanks for all your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: translation of the docs to portuguese
On Tue, Feb 24, 2009 at 9:14 AM, Ben Bangert b...@groovie.org wrote: one for the upcoming 0.10 backwards compatible release So there's not going to be an 0.9.8? Are you planning significant changes? I thought @validate and possibly Routes2 were the only things on the agenda. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: translation of the docs to portuguese
On Feb 24, 2009, at 3:11 PM, Mike Orr wrote: So there's not going to be an 0.9.8? Are you planning significant changes? I thought @validate and possibly Routes2 were the only things on the agenda. Decided that more 0.9.x is silly, might as well increment the dang number to 0.10 instead, just like 0.9.7 should've been a minor fix to 0.9.6, not a major increase. Enough abuse of these poor version numbers! :) This means any further 0.9.x releases are *bug-fix* releases, and not a larger update, like 0.10, or 1.0. Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: Authorization with repoze.what in Pylons
On Tuesday February 24, 2009 23:26:58 dw wrote: Thanks for all your help. No worries! I'm glad to know it's working now! ;-) -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
logging setup
It's weird that the default setup in development.ini is: [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic I used log.warn in my controller and it didn't go to stderr. I changed level to INFO so I can see the logging message. Best Regards, -jj -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa http://jjinux.blogspot.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: new pylons site - ArtWeLove.com + Open Source Framework
killer... nicely done. On Tue, Feb 24, 2009 at 5:05 PM, Jonathan Vanasco jonat...@findmeon.comwrote: We just launched ArtWeLove.com Everything but the /news section is in Pylons . The /news section is a customized install of MovableType. Some cookies , PHP , and a whole bunch of postgresql views in Pylons to map the MT structure tie everything together. Its got a few bugs -- we launched a day early, thanks to a partner hitting send on an email blast to 15k people , and needing to be public enough for them. sigh. The system runs on top of a framework called OpenSNS -- something that we had been developing in FindMeOn.com to prototype and deliver our Open Social Network (OpenSN) projects and standards. It's been used in a number of projects that I'm associated with for the past few years and will shortly available to all under the MIT license. ( its friends only MIT until some security issues are worked out, when they are.. its public. if you'd like to be a friend, contact offlist ) Open Social Network gives developers the ability to rapidly prototype and build production-quality web services. It's a series of Python packages and Pylons controllers , along with a standardized Database Schema, that developers can subclass, inherit, override or throw away -- allowing people to take what they need and toss the rest. The design goals were: - handle common tasks - don't enforce any sort of database concept ( everything is handled through sqlalchemy table mapping, and work continues to make column actions configurable ) - allow startups to skip the first 6 weeks of development - allow advertising agencies the ability to create web projects with speed - allow everything to be overridden or thrown away, for people to seamlessly migrate to other frameworks or custom systems to handle their data, by representing data in according to industry best- practices and standards It handles: - account creation , management , lostpassword, forgotpassword, etc - login , logout , preview - u2u relations: friend , follow , contact - profile pages w/s3 storage for images - and a whole other slew of things --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Mako template examples
On 25/02/2009, at 4:26 AM, Ross Vandegrift wrote: I inherited a horrible mess of Myghty templates, most of which are a cut-and-paste disaster. I've decided to undertake refactoring them and converting to Mako. The Mako docs are great and explain all kinds of wonderful things I could do. But never having had a maintainable template system for an app that displays lots of tabular data, I don't really know where I want to go. I downloaded the pydotorg examples from the Mako site, but their system is wy more complicated than I need or want [1]. Anyone know of a free software app that uses Mako, in a pretty direct fashion, and has a nice template structure I could pick apart to learn from? Hi Ross, The Definitive Guide to Pylons has a chapter View Templates that provides a good recommendation for structuring templates. It focusses on mako. http://pylonsbook.com/alpha1/view_templates Cheers, Chris Miles --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: 0.9.7 and Elixir
On Feb 24, 10:20 pm, Isaac nerk...@gmail.com wrote: Well, the best explanation I have is that these values are how I want the Session to behave, which is why I put a comment saying you may want to put something else there. That's what I was following up :-) Maybe some other values are more sane for a typical or smaller app than the one I'm working on at the moment (which is not small, and probably not typical). My reading of the SQLA docs suggests that the default values try to strike a balance between improved operational reliability and increased developer convenience. I just wondered if you thought that your app had some particular characteristics that prompted your choice --- not small, and probably not typical sounds like it fits the bill. I suggest reading http://www.sqlalchemy.org/docs/05/reference/orm/ sessions.html#sqlalchemy.orm.sessionmaker Indeed. But Mike (understandably) barely hints at the operating conditions that might prompt the adoption of a flush/commit strategy other than the default. I write understandably because the complexity introduced by the different characteristics of the various relational persistences supported by SQLA probably places the matter outside the scope of the SQLA docs. try them out, and then decide what's right for your situation/app. That's a long and potentially expensive process. I'm just sculling around trying to get a bead on things. I found this to be a useful 6- or-so scrolling pages: https://rhstack.108.redhat.com/articles/2007/02/09/design-issues-in-high-performance-transactional-applications-using-Java-and-Linux.html (for others' reference) it's fairly well-packed: differences in how databases handle concurrency, whether the database supports native operating system threads (NPTL) or processes., Generally, synthetic keys (sequences, auto-number) are preferred to business keys as primary keys, It is also best if analytical schemas (such as those used for monthly reporting systems) are kept separate from your operational system schemas. Partly answering my own (idle) question: Another thing to watch out for with persistence solutions is when and where they flush. Most persistence solutions gain a performance advantage by scheduling updates and inserts to be sent to the database lazily. By default, in Hibernate, this happens just before a query is executed or just before a transaction actually commits at the database level. The data must be flushed to the database just before a query to assure accurate results. Flushing is expensive. Most solutions do this generically without noticing which entities are actually retrieved. You can potentially gain a performance advantage by toggling the flush mode when you know it's safe (e.g. not on large projects with lots of developers of various skill levels); or by ordering your operations smartly to execute non-dependent queries together before updates (although this may be difficult to muster in a proper object-oriented/service- oriented design). Playing with the flush mode and scheduling queries is also how you can potentially run less sophisticated databases which still use row locking in a lower isolation level (with a lot of specific work) to achieve higher concurrency. I still need to figure out how that plays back into my choice of sessionmaker kwarg values but at least it's no longer an idle question. Thank you, Isaac. Cheer, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: logging setup
On Feb 24, 2009, at 3:49 PM, Shannon -jj Behrens wrote: It's weird that the default setup in development.ini is: [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic I used log.warn in my controller and it didn't go to stderr. I changed level to INFO so I can see the logging message. Works for me. The console handler isn't filtering anything, its level is NOTSET so it should be logging everything that goes through it. The Pylons project's top level package should have its own logger set to DEBUG by default, which means any logger under it, like myapp.controllers.mycontroller, should be sending WARN to the console handler. -- Philip Jenvey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
FileApp error
When using paste.fileapp, I'm getting Internal Server Error instead of 404 Not Found if a nonexistent path is requested. Is this intentional or a bug? File '/home/mso/svn/hazweb/branches/crt-pylons2/crt/controllers/main.py', line 40 in help return app(environ, start_response) File '/home/mso/venv/pylons/lib/python2.5/site-packages/paste/fileapp.py', line 104 in __call__ return self.get(environ, start_response) File '/home/mso/venv/pylons/lib/python2.5/site-packages/paste/fileapp.py', line 209 in get self.update() File '/home/mso/venv/pylons/lib/python2.5/site-packages/paste/fileapp.py', line 189 in update stat = os.stat(self.filename) OSError: [Errno 2] No such file or directory: '/home/mso/svn/hazweb/branches/crt-pylons2/crt/help/MasterData.xml' I guess I gotta look over everywhere else I've used FileApp and make sure it abort(404)'s if the path does not exist. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Authorization with repoze.what in Pylons
On Feb 24, 10:26 pm, dw dwe...@structuralcomponents.net wrote: recommended putting the lib/auth functions in a file called repoze located in lib/auth. Heh, that's exactly what I did too, with exactly the same results. It totally weirded me out for a while. It can be a misleading exception message if you don't zero in on the omitted first path component: what.plugins.quickstart vs repoze.what.plugins.quickstart --- which I didn't until mcdonc from #repoze pointed me in the right direction. Cheers, Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: logging setup
On Tue, Feb 24, 2009 at 4:10 PM, Philip Jenvey pjen...@underboss.org wrote: On Feb 24, 2009, at 3:49 PM, Shannon -jj Behrens wrote: It's weird that the default setup in development.ini is: [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic I used log.warn in my controller and it didn't go to stderr. I changed level to INFO so I can see the logging message. Works for me. The console handler isn't filtering anything, its level is NOTSET so it should be logging everything that goes through it. The Pylons project's top level package should have its own logger set to DEBUG by default, which means any logger under it, like myapp.controllers.mycontroller, should be sending WARN to the console handler. The default level is set to INFO, while the application level is DEBUG (for all modules in the application package). This can lead to debug messages from other modules not showing up. When I'm doing ad-hoc debugging, sometimes I log messages as warn or error to avoid having to change the configuration. I think there might have been a few times I couldn't get WARN messages through but I don't remember the circumstances. If you make a new config file via paster, its default level is INFO throughout. I change that to WARN for production.ini. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: logging setup
On Feb 24, 2009, at 4:52 PM, Mike Orr wrote: The default level is set to INFO, while the application level is DEBUG (for all modules in the application package). This can lead to debug messages from other modules not showing up. When I'm doing ad-hoc debugging, sometimes I log messages as warn or error to avoid having to change the configuration. That's the intention, I think root at DEBUG by default is too chatty for most people. Most probably don't care to see all of the Pylons' internal debug logging by default, for example. SQLAlchemy is super chatty on DEBUG too. It's super easy to switch during development though, --reload also monitors development.ini for changes. If you make a new config file via paster, its default level is INFO throughout. I change that to WARN for production.ini. Yea, WARN would be more appropriate for prod. Let's change it -- Philip Jenvey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: 0.9.7 and Elixir
Graham, Thanks for the thoughtful reply. You indeed intuited something the app is doing... its model is used to run a very lengthy conversion script from an old FileMaker 6 database (the conversion script has more code than the actual app because this database I inherited is structured preposterously even considering what's needed to work around FMP 6's copious limitations). It takes about 6 hours to run, but before I took control of flushing it took around 23 hours. I may change those kwargs when the app starts seeing normal use in a few weeks as the main activity will change to mostly reading instead of mostly writing. --i --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Problems after installing 0.9.7 from 0.9.6
Hello, I installed pylons 0.9.6 with easy_install and now I'm trying to install 0.9.7 with the go-pylons approach in the documentation. I'm getting pkg_resources.DistributionNotFound errors. I have tried cleaning up the install from 0.9.6 by deleting .eggs from site- packages, but I'm still getting the error pkg_resources.DistributionNotFound: PasteScript==1.7.3 Can anyone tell me how to get pylons going again? Thanks, Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Problems after installing 0.9.7 from 0.9.6
On Feb 24, 2009, at 6:21 PM, Frank Henard wrote: Hello, I installed pylons 0.9.6 with easy_install and now I'm trying to install 0.9.7 with the go-pylons approach in the documentation. I'm getting pkg_resources.DistributionNotFound errors. I have tried cleaning up the install from 0.9.6 by deleting .eggs from site- packages, but I'm still getting the error pkg_resources.DistributionNotFound: PasteScript==1.7.3 Can anyone tell me how to get pylons going again? I'm not sure why this happened, but it's likely you'd avoid it by passing --no-site-packages to virtualenv. To track it down we'd have to know what you had installed in global site-packages before running go-pylons, and maybe what go-pylons ended up installing (or not installing). -- Philip Jenvey --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Problems after installing 0.9.7 from 0.9.6
hi! Frank On Wed, Feb 25, 2009 at 7:51 AM, Frank Henard fdhen...@yahoo.com wrote: Hello, I installed pylons 0.9.6 with easy_install and now I'm trying to install 0.9.7 with the go-pylons approach in the documentation. I'm getting pkg_resources.DistributionNotFound errors. I have tried cleaning up the install from 0.9.6 by deleting .eggs from site- packages, but I'm still getting the error pkg_resources.DistributionNotFound: PasteScript==1.7.3 I don't know which OS you are using. But if you are on linux want to do a system wide install of pylons 0.9.7 then the better way is to upgrade from the 0.9.6. easy_install -U pylons will upgrade the pylons to the latest version. If the sqlalchemy is not upgrade to the latest version 0.5.2 by default then you may need to run the following command. easy_install -U sqlalchemy Can anyone tell me how to get pylons going again? Thanks, Frank -- Regards, Arun Tomar blog: http://linuxguy.in website: http://www.solutionenterprises.co.in --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
looking for freelance work (pylons/python)
Hello there, I have about 5 years of experience with Python, mostly web (server-side); for 2,5 years I has been working on various turbogears/pylons project, including one of my own, developers.org.ua. For more information see my linkedin page at http://linkedin.com/in/maksim. I am looking for short-term programming work (days to weeks to few months). You can contact me via ischenko at gmail.com or skype at max.ischenko. I'm in Ukraine (GMT+2). -- Max.Ischenko http://www.developers.org.ua The #1 Ukrainian Software Developers' site News, Companies, Jobs, Events, Talks and more. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: looking for freelance work (pylons/python)
Hello, Sorry, Max, I don't have job offer for you. Just an idea - PylonsHQ (http://pylonshq.com/) could have Pylons job board where people looking for Pylons developers could post their job offers. -- Dalius http://blog.sandbox.lt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: looking for freelance work (pylons/python)
On Wed, Feb 25, 2009 at 6:59 PM, Dalius Dobravolskas dalius.dobravols...@gmail.com wrote: Hello, Sorry, Max, I don't have job offer for you. Just an idea - PylonsHQ (http://pylonshq.com/) could have Pylons job board where people looking for Pylons developers could post their job offers. I think this is an excellent idea. I do hire people for web development from time to time, and would love to see a spot where people highlight their portfolio of experience with Pylons projects. -- Dalius http://blog.sandbox.lt -- Cheers, Noah --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---