Re: I can't do i18n work.
On Jan 11, 2013, at 4:09 AM, Luis Aguirre wrote: * Go to http://127.0.0.1:6543?_LOCALE_=en and doesn't work at all! What happens? -- 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: Logging, again...
On Sep 11, 2012, at 3:41 PM, Vlad K. wrote: Hi all, I'm having a bit of an issue with logging. I did this (a trick I picked up from a site to enable logging under uwsgi): __init__.py def main(global_config, **settings): Main WSGI application. logging.config.fileConfig(settings[logging.config]) development.ini logging.config = %(here)s/development.ini ... # Begin logging configuration [loggers] keys = root,sqlalchemy [handlers] keys = console [formatters] keys = generic [logger_root] level = DEBUG handlers = console [logger_sqlalchemy] level = INFO handlers = qualname = sqlalchemy.engine # level = INFO logs SQL queries. # level = DEBUG logs SQL queries and results. # level = WARN logs neither. (Recommended for production systems.) [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s # End logging configuration Now, if I include logging.config.fileConfig() line in __init__ I have to specifically enable loggers for namespaces in development.ini, the root logger won't catch all. For example, I've disabled debugtoolbar in dev, and in case of exceptions I get nothing on the console unless I add a [logger_waitress] section (with logger key set, qualname, etc...). If I remove that line (basically, disable logging configuration), logging under Waitress shows root logger catching all (that is not overriden). What am I doing wrong? It's not apparent to me what's wrong. With a root logger set to DEBUG you should probably be seeing those messages. You may want to try using the logging_tree package as a visual aid: http://pypi.python.org/pypi/logging_tree -- 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: Pyramid and Python 3.3.0 beta 2
On Aug 13, 2012, at 11:44 AM, Luke D wrote: I realize that this version was just released over the weekend, but thought I'd put things I've noticed, questions, and issues out here. Noticed --- - New virtual environment venv is handy - There is a new packaging module that deprecates distutils packaging was actually removed in an earlier release, because it's unfinished. - Namespace Packages Questions - Are there any known issues with pyramid and the new virtual environment There shouldn't be - Will namespace packages eliminate the need for config.scan? I don't see how this would eliminate that need. Plus we already have namespace packages, this is really just a better, official impl of them. Issues - - I'm getting an error on Mac OSX Lion when I pserve a standard scaffold ( AttributeError: 'SourceFileLoader' object has no attribute 'etc') in venusian/__init__.py line 181 Could you post a new bug with a full traceback? Major parts of Python's import system were rewritten for 3.3 (including SourceFileLoader). -- 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: Pyramid instructor needed for PyGotham (NYC Python conference this Saturday 6/9)
On Jun 11, 2012, at 7:50 AM, Paul Winkler wrote: In case anybody is wondering, Daniel Hoth stepped up and filled in. Thanks a million Daniel! Awesome! Thanks Daniel! -- 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: SQLAlchemy, left outer join query taking a very long time (SQLite)
On Nov 4, 2011, at 12:48 PM, Joel wrote: I have a Pylons application using SQLAlchemy to interact with a SQLite db. When one of my searches results in an OUTER LEFT JOIN query, the system takes a VERY long time to return results (i.e., several minutes). The puzzling thing is that if I run an equivalent query at the SQLite command line there is no problem. Also, when the RDBMS is MySQL the query does not take a long time. This sounds like SQLite's fault -- you can confirm that by running the *exact* query via the command line tool as well. -- 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: GAE support
On Aug 10, 2011, at 5:33 PM, Chris McDonough wrote: In the meantime, GAE has become basically the only reason to support Python 2.5 in Pyramid. FYI this would also affect Jython. Work has started on 2.6 support, but it's been pretty slow. -- 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: Akhet 1.0 released
On Apr 5, 2011, at 12:10 AM, Mike Orr wrote: Akhet 1.0 is here. It's an application skeleton (application template) for Pyramid that's closer to the Pylons 1 style than Pyramid's built-in skeletons. The manual also tries to be a gentler introduction to Pyramid for those from a Pylons-ish background. Woohoo, thanks Mike! -- 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: Programmatically shutting down Pylons server
On Apr 30, 2010, at 7:12 AM, Alec Munro wrote: Ok, the problem seems to be that fact that the file being run is a batch file. I printed out the resulting java call, and used that instead, and it works. However, now I need to modify my script to handle some of what jython.bat does. Ah well. It's probably just an oddity of Windows, maybe it kills the bat process but the child process is unaffected. The bat file runs java via: cmd.exe /c exit /b java. Maybe there's another way to invoke it that would work better? Eventually the Jython .bat file launcher will be replaced with a native .exe launcher -- if not by Jython 2.5.2 then likely the next release. That should solve this issue among other things: http://bugs.jython.org/issue1491 -- 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-disc...@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: Programmatically shutting down Pylons server
On Apr 22, 2010, at 12:36 AM, Alec Munro wrote: Hi List, I have a Java class that I need to access from Python, and my solution for the time being is to wrap it in a Jython web service, using Pylons. I'm using subprocess.Popen to start this server, but I need a good way to stop it. Using any of the kill functionality from subprocess or the win32 modules always leaves me with dangling processes. I'm hoping that I can simply expose a web service call that will shutdown Pylons. However, short of sys.exit(), I haven't been able to find anything, and I'm not even sure if that will work. Do you mean you're running a Pylons web service in Jython, and having another Python process start it up via subprocess? If so I'm not sure why sending the subprocess a kill/terminate signal would cause it to dangle, it could depend on what the parent process is doing. You may need to pass close_fds=True to Popen. Can you kill it normally when it's ran outside of your other process? A web service call to shutdown Pylons via sys.exit could work, but I'd want to know why the process was dangling when killed. It may even zombie after calling sys.exit() on itself due to the same issue. -- 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-disc...@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: Memory Release
On Feb 10, 2010, at 9:48 PM, BrandonE wrote: Hello all, I am converting one of my CGI Python applications to Pylons. Part of it contains displaying a JSON encoded tree generated from a Python list. It is a huge tree. It loads very quickly the first time I load the page. The second time however, it seemed to be going slower. The third, it didn't even complete. To investigate, I looked at the memory usage in my control panel (Testing locally on a Windows 7 computer, but the original case happened on one using Linux). It seemed that the first time, it took up 116,000KB of memory. Although one might argue that my script should never use that amount of memory to begin with, I consider that to be relatively reasonable. However, when I load it the second time, it doubles. I wonder, why is that? That is when I discovered this link: http://effbot.org/pyfaq/why-doesnt-python-release-the-memory-when-i-delete-a-large-object.htm So, it seems that Python frees up memory, but not to the OS. OK, that seems fairly reasonable. However, unlike CGI, Pylons runs constantly, even after a page has been loaded. That makes sense to me, but it seems like Pylons isn't accessing the memory that it just allocated in the previous load. I wonder why that is. There's a memory leak -- something is holding on to the previous request's memory. The Dozer WSGI app can help you find what's holding onto it, e.g.: http://amix.dk/blog/post/19420 Although this could potentially be an issue with Python, WSGI, or Pylons, I figure this is the best place to post it as it is the specific possible factor in this malfunction, and that the experts here will know about the former two. Although some might want to tell me to use less memory altogether, I would like to mention that the same increase occured in other Pylons instances with much smaller consumption, although the increase was proportional. -- 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-disc...@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 sqlalchemy.url value from config file (i.e., development.ini)
On Feb 9, 2010, at 9:55 AM, Joel wrote: 4. use regular expressions to filter my orm queries, i.e., be able to write x = page_q.filter(model.Page.title.op('regexp')(searchTerm) Such a filter works on MySQL without alteration, but with SQLite it seems I need to define a regexp function. I've found out how to write such a function: import re def regexp(expr, item): r = re.compile(expr) return r.match(item) is not None I've also found out that when using sqlalchemy's SQL Expression API, I can give sqlite this function with the following: connection = engine.connect() connection.connection.create_function('regexp', 2, regexp) So: is it possible to use sqlalchemy's Object Relational API and still give sqlite the regexp function? My attempt to do this was to change my app's model/__init__.py init_model(engine) function to the following: def init_model(engine): connection = engine.connect() connection.connection.create_function('regexp', 2, regexp) meta.Session.configure(bind=connection) meta.engine = engine I can do this and I can setup my app (paster setup-app development.ini) and I can serve my app, but when I try to do a search I get the following error: ProgrammingError: (ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 139951621744368 and this is thread id 139951533046032 None [{}] So what am I doing wrong? Is it even possible to create an RDBMS- specific function while using sqlalchemy's ORM? It sounds like SQLite requires you define your regexp function in every different thread/connection used. In that case you'd want SQLAlchemy's connection pool to create your function every time it establishes a new connection to SQLite. You can do that via a PoolListener: http://www.sqlalchemy.org/docs/reference/sqlalchemy/interfaces.html?highlight=poollistener#sqlalchemy.interfaces.PoolListener It might look something like this: class SQLiteSetup(PoolListener): def connect(self, conn, conn_record): conn.create_function('regexp', 2, regexp) And in your load_environment: engine = engine_from_config(config, 'sqlalchemy.', listeners=[SQLiteSetup]) -- 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-disc...@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 Optimizing on Multiprocessor Server?
On Nov 15, 2009, at 2:03 PM, kevbaker wrote: I am working on optimizing our Pylons servers for better performance. Currently I am getting what I would consider pretty poor performance. I have some data and questions. = Questions 1. Does Pylons take advantage of multiple processors on my server? Yes, it generally runs via a multi-threaded web server like Paste http server, CherryPy, or mod_wsgi Apache, or even J2EE containers under Jython. Of course how much parallelism you can really get is hindered by Python's Global Interpreter Lock. 2. Other than shutting off debugging what can I do to improve performance? The easiest gain is to serve the static files (in the public/ directory) via a faster frontend server like Apache, nginix, or a CDN. To really reap the benefits of this, you must switch the static_files flag in the ini file to false. Then Pylons no longer checks if URLs are for a static files (which takes precedent over everything else) during every request. 3. Are there any other options outside of Paster and Cherrypy? Which should I use? There's also FAPWS, Spawning, and some others. Try mod_wsgi if you're trying to squeeze out every bit of performance. = Configuration - Pylons 0.9.6.2 - Amazon EC2 c1.medium, 1.7 GB Ram, 5 EC2 Compute Units (2 virtual cores) - Ubuntu 8.04.3 = Data - Running Apache Benchmark to get usable numbers to measure performance improvements after config changes. All tests were using ab -n 400 -c 10 {MY URL} - Pylons direct, no proxy, load static file - response:36.86 - Pylons direct, no proxy, load template file with a few variables - resp/sec:30.28 - Pylons direct, no proxy, load template with database query - resp/ sec:16.06 Regardless of what you do with Pylons your database is the larger bottleneck in at least some cases. On the Pylons side, assuming you're using SQLAlchemy, you can speedup some operations by using the SQL expression layer directly instead of the ORM layer, to avoid its object creation. However the data i/o is probably a larger hit. Consider caching some of it. More important than anything I've said is to benchmark your app and go by the numbers. -- 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: WebOb API
On Nov 1, 2009, at 5:39 PM, Ian Bicking wrote: On Sun, Nov 1, 2009 at 5:47 PM, Ben Bangert b...@groovie.org wrote: On Oct 29, 2009, at 1:22 PM, Ian Bicking wrote: So, it's about time that WebOb came to 1.0. For 1.0 I'd like to settle the API as much as possible. But I'd also like to move further to getting WebOb used for more frameworks. I don't expect that to happen before 1.0, but if there are API changes that will make that easier later, then maybe we can get those in. What happened to getting all the fixes and improvements Armin had for the Request/Response in Werkzeug into Webob? Is that a 1.1 thing? Could we at least get the API more similar for 1.0 even if the bug fixes from Werkzeug's Request object aren't pulled in? I'm not really aware of what those fixes are, or if they apply to WebOb (I suspect they don't). If there are specific API differences where they could be unified, well... we can discuss them. Talking with Armin, his biggest concerns have been around handling the request body (which is tricky at best; Wekzeug is more naive but less likely to be unperformant; rather it just won't work in these difficult situations). If there are nasty situations, I hope they can be fixed in WebOb, though I'd like to make everything Work, even in cases that aren't a priority for Wekzeug (mostly related to contention for the request body, as with middleware). Another thing Armin specifically mentioned is that he doesn't like that all WebOb requests are mutable. He prefers the Werkzeug setup where the base request object is basically read-only, and there is a subclass that can be written to. First, that would be rather hard to do with WebOb (maybe a read-only flag would be possible, but the functionality would be there regardless, only explicitly disabled via a flag), and secondly I don't particular agree with him on this matter, and I don't think there's a strong justification for removing this functionality (I am of a mind that if you don't want to modify the request, then don't do it). There's at least some good arguments for immutability: o Request object becomes much simpler with way less code (see Werkzeug) o Becomes easier to cache attributes and avoid property overhead (see Werkzeug) o You can still change environ you just have to do it manually o One step towards Werkzeug possibly adopting WebOb (when the aforementioned goal was being adopted by more frameworks) The drawbacks are we lose that sometimes handy functionality and that WebTest relies on it. How much does WebTest really rely on it though (it doesn't really seem like much)? And just to clarify, the Werkzeug wrappers aren't totally immutable, you can still modify their attributes and add your own attributes. Its exposed data structures (like MultiDicts) are immutable and it doesn't write to environ. A middle ground might be what Werkzeug does now but allowing writes to data structures like MultiDicts -- just not propagating the changes to environ. If there are other things I'm not aware of them; you'll have to list them more specifically. Werkzeug also has some pieces of functionality separated out via Mixins, this mainly makes the code cleaner. It doesn't actually have a mutability Mixin, that's just a proposal by Armin to find a middle ground with WebOb. One big difference is it stores file uploads in a different container than the main request.POST multidict, and more importantly doesn't use cgi.FieldStorage for those file objects or for parsing the form. With that alternative form parser you can also easily limit the size of form posts/file uploads. The other API differences are probably mostly naming of attributes, existence of more or less shortcuts, things we probably don't differ very much on. Armin also claimed WebOb doesn't handle invalid cookies as well as Werkzeug. -- 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: [tg-trunk] TurboGears Black Friday Sprint (11/27/2009)
On Nov 13, 2009, at 1:02 PM, percious wrote: If you are from the US, you may be familiar with the custom of racing to your local commercialization hub before the sun rises and beating your fellow man over the head to get that cute little fifi doll your daughter wants for christmas. This endeavor is often fueled by the previous day’s binge on tryptophan-laced poultry. TurboGears wants you to know there _is_ an alternative to this ruckus behavior. While it may not offer a method of transference of the latest flu virus strain, you may come hang out with the leaders of our community on irc://#turboge...@irc.freenode.net . and ask questions and help your fellow man. In the spirit of thanksgiving, you may decide it would be good to return the 1000s of lines of code contributed by helping us document that mess*! November 27, 2009 starting around 9am MST, ending when Chris passes out, we will convene and work on the 134 todo items left in our documentation. If some of you are near Denver/Boulder, CO that day, I would be happy to organize an on-site meetup, please let me know. So, the day after thanksgiving, why not act gluttonous for one more day (with your writing) and lets see if we cant close another 60 todo Items as we did on the last doc push. Be you an advanced super 37173 user, or someone completely new to TG, we have got something for you to do! Lets work together to make the formal 2.1 release of TG the best yet so far, with the highest level of completed documentation evar! Plus I hear those 134 todo items are 20% off and include a free tote bag* * Only to the first 25 customers. Offer not valid in Bavaria. -- 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: Building EGGs
On Nov 10, 2009, at 7:33 AM, gsandorx wrote: Hi, When building egg packages, do I need to run the command “python setup.py bdist_egg” with every python executable corresponding to my desired supported versions? Doing so would require me to have virtual enviroments for at least 3 python versions (2.4, 2.5, 2.6), wouldn’t? Isn’t there an easy way? (I’m currently using python26) Pretty much, but as Tom mentions you rare should need to do this, sdist should be enough. Otherwise I've done this on OS X using MacPorts installations of Python, which will install the non-default Python as python2.x. Then I've just ran python setup.py bdist_egg, python2.3 setup.py bdist_egg, etc -- 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: Caching templates
On Nov 9, 2009, at 12:40 AM, alex_zh wrote: Hello. I have a problem with caching of templates. Sometimes users get the pages, that opened before. I don't khow the reason. Is it possible to turn off all the caching in whole pylons project? You can set cache_enabled = False in the ini file to disable @beaker_cache caching -- 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 -~--~~~~--~~--~--~---
pylonshq.com back up Was: Re: pylonshq.com down?
Sorry about that, we had some flakey issues with trac that was causing the entire main website to stop responding, which happened a number of times over the past few days. It should all be taken care of now. We also fixed problems with uploading attachments to trac. -- 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: View Template Error
On Oct 2, 2009, at 1:17 PM, Dan06 wrote: I started pylons today and I'm following along with the pylons book. I'm trying to render a simple template but continue to get: OSError: [Errno 13] Permission denied: '/var/pylons_projects/bin/HelloWorld/ data' Pylons sets mako and Beaker to write out its data to the data/ directory in the root directory of your Pylons project. Obviously you don't have permissions to write to it for whatever reason. Fix the permissions problem or change the directory used in the ini file. -- 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: Beaker error
On Mar 2, 2009, at 11:24 AM, Mike Orr wrote: I've started getting an intermittent Beaker error. It happens in the base controller when I pass ``session.id`` to a generic logging routine. However, I have three sites with the same logging code, and it's only happening on one of the sites. It occurs on a variety of URLs. Here's the exception: Module beaker.synchronization:260 in do_acquire_write_lock return False else: fcntl.flock(filedescriptor, fcntl.LOCK_EX) return True fcntl.flock(filedescriptor, fcntl.LOCK_EX) TypeError: argument must be an int, or have a fileno() method. FYI I narrowed this problem down today, it should be fixed in Beaker trunk. It's due to a CPython bug =[ http://www.pylonshq.com/project/pylonshq/ticket/645 -- 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: Heads up: Pylons wiki down for maintenance tonight, 9:30pm-10:30pm PDT
On Sep 5, 2009, at 3:02 AM, Mike Orr wrote: On Fri, Sep 4, 2009 at 10:38 PM, Philip Jenveypjen...@underboss.org wrote: On Sep 4, 2009, at 4:37 PM, Philip Jenvey wrote: It'll be going down for for a well needed upgrade. It's back now, note that the popular metadata-list plugin is currently incompatible with Confluence 3, hopefully a newer version will be released soon. What's a metadata-list plugin, and what are we missing without it? It's the one that usually shows some stats at the top of pages and I guess adds some metadata to the Confluence index: http://confluence.atlassian.com/display/CONFEXT/Metadata+Plugin E.g.: http://wiki.pylonshq.com/display/pylonscookbook/ZSI+Client+for+SOAP+Controller+with+Optio%27s+Soaplib+and+SQLAlchemy -- 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: Heads up: Pylons wiki down for maintenance tonight, 9:30pm-10:30pm PDT
On Sep 4, 2009, at 4:37 PM, Philip Jenvey wrote: It'll be going down for for a well needed upgrade. It's back now, note that the popular metadata-list plugin is currently incompatible with Confluence 3, hopefully a newer version will be released soon. -- 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: Adding Pylons 0.9.7 breaks 0.9.6 projects
On Aug 14, 2009, at 9:59 PM, Jorge Vargas wrote: On Fri, Aug 14, 2009 at 7:50 PM, kochharkochhar...@gmail.com wrote: Hi all, Hi, I have a package repository which contains packages for pylons 0.9.6.1 After adding pylons 0.9.7 and it's dependent packages, my 0.9.6.1 projects stopped working. From looking at the requires.txt in pylons 0.9.6 egg it appears that pylons is specifying it's dependencies in the FooPackage = x.y.z format. Consequently, when I re-create my project environments, they get newer versions of their dependencies which are not compatible with 0.9.6.1 (Notably Routes and WebHelpers) It seems bad practice for pylons to specify it's dependencies in the FooPackage=x.y.z format; it's too easy to break something. Is there a way around this so I don't need to create separate package repositories for 0.9.6.1 and 0.9.7 I don't see this as bad format as a newer version is (in general a better less buggy version) that said they are two ways of fixing this. 1- releasing 0.9.6.2 with a setup.py that excludes the new incompatible versions 2- using something like pip and it's requirements.txt file to fix such issue. Another alternative is to install both eggs with the -m (multi- version) option of easy_install, then explicitly require whatever version the app needs as early as possible during the app's initialization (like in middleware.py, or load_environment) -- 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: Anyone besides me using stored procedures?
On Aug 25, 2009, at 7:15 PM, Jamie wrote: It seems that most people who adopt a MVC framework are in love with the ORM stuff. I'm just wondering if I'm the only one who insists on hand-writing my queries and sticking them in stored procedures? I guess it's because I come from a DBA/RDBMS development background and tend to make heavier use of the procedural logic available in a RDBMS, whereas most web developers use the DB purely as a bit bucket. I've tried to use a few ORMs, but have found them to be too magical and they get in the way of how I'm used to doing things. (In fact the primary reason I've adopted Pylons is because I can use it without an ORM). Is there any compelling reason why I should force myself to use SQLAlchemy? Stored procedures' popularity have mostly waned because they're not portable across dbs ORMs are a different issue entirely. I can understand having issue with ORMs for generating sub-standard schemas and queries. You shouldn't have that problem with SQLAlchemy -- it avoids being too magical and at heart its interests are aligned with yours as a DBA. The marketing material on its web page claiming it's 'dba approved' and 'unopinionated' is really true. It's not just an ORM, it also provides a SQL expression layer. You can generate queries however you like them. You can also always fall back to sending raw SQL through SQLAlchemy, and can even generate mapped objects from their results. Also the core SQLAlchemy ORM follows the data mapper pattern for better separation between the application's object layer and the database layer. If you're not planning to write everything as stored procedures it'll make your life as a DBA easier, not harder -- 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: Pylons marketing, ( new thread from web tech )
On Aug 22, 2009, at 8:13 PM, Graham Dumpleton wrote: On Aug 23, 9:56 am, Philip Jenvey pjen...@underboss.org wrote: On Aug 22, 2009, at 3:36 PM, Graham Dumpleton wrote: FWIW, hosting Pylons on anything besides Paste HTTP server can also be a problem in some cases. This is because certain setup steps for logging expected by Pylons applications are embedded in Paste HTTP server where they should not really be. This means that those magic steps have to be some how duplicated when using alternate WSGI hosting mechanisms. Such steps aren't though even documented in Pylons documentation, unless that has changed since last time I looked. logging is setup by PasteDeploy's loadapp, not the Paste HTTP server itself. Pylons apps are always created via loadapp for any kind of deployment, so that's the appropriate place. Is the following logging to wsgi.errors documentation not enough in this regard?http://pylonshq.com/docs/en/0.9.7/logging/#logging-to-wsgi-errors If that is the case and everything is done and self contained within loadapp(), why is it necessary to call paste.script.util.logging_config.fileConfig() explictly for alternate hosting mechanisms, as documented in: http://wiki.pylonshq.com/display/pylonscookbook/Logging+under +mod_wsgi prior to calling loadapp(). My mistake, this isn't happening in loadapp. This should be fixed -- 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: Pylons marketing, ( new thread from web tech )
On Aug 22, 2009, at 3:36 PM, Graham Dumpleton wrote: FWIW, hosting Pylons on anything besides Paste HTTP server can also be a problem in some cases. This is because certain setup steps for logging expected by Pylons applications are embedded in Paste HTTP server where they should not really be. This means that those magic steps have to be some how duplicated when using alternate WSGI hosting mechanisms. Such steps aren't though even documented in Pylons documentation, unless that has changed since last time I looked. logging is setup by PasteDeploy's loadapp, not the Paste HTTP server itself. Pylons apps are always created via loadapp for any kind of deployment, so that's the appropriate place. Is the following logging to wsgi.errors documentation not enough in this regard? http://pylonshq.com/docs/en/0.9.7/logging/#logging-to-wsgi-errors -- 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: '_fileobject' object has no attribute 'seek'
On Aug 17, 2009, at 10:40 AM, Jinal Jhaveri wrote: File '/usr/lib64/python2.5/rfc822.py', line 188 in readheaders self.fp.seek(startofline) File '/usr/lib/python2.5/site-packages/Paste-1.4.2-py2.5.egg/paste/ httpserver.py', line 481 in seek self.file.seek(place) AttributeError: '_fileobject' object has no attribute 'seek' The latest version of Paste has a fix relating to this httpserver seek method which might solve this. -- 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: pylons on jython
On Aug 13, 2009, at 12:19 AM, dusans wrote: does pylons work 100% on jython sqlalchemy will be 100% in 0.6 what about mako? Pylons and its dependencies, including Mako, work 100% http://pylonshq.com/docs/en/0.9.7/jython/ SQLAlchemy 0.6 trunk now runs very well on Jython with the postgresql +zxjdbc and mysql+zxjdbc dialects. They're now continuously tested on SQLAlchemy's buildbots (they pass 100%): http://groovie.org:8012/ oracle+zxjdbc also passes 100% but it lacks the new 0.6 returning feature -- hopefully that'll be solved before 0.6 final. Also, Victor Ng is working on a mssql+zxjdbc dialect that'll hopefully be included too. -- 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: Using %(here)s in logging config
On Aug 4, 2009, at 11:28 AM, Mike Orr wrote: On Mon, Aug 3, 2009 at 7:30 PM, Philip Jenveypjen...@underboss.org wrote: fileConfig accepts a set of defaults to pass to ConfigParser, so I've made PasteScript's logging config loader pass 'here' (and also '__file__' which PasteDeploy apparently sets up): http://trac.pythonpaste.org/pythonpaste/changeset/8052 How does that work? The defaults are supposed to be logging.basicConfig arguments, not 'here' and '__file__', which basicConfig doesn't know what to do with. No, they're just defaults for ConfigParser. basicConfig isn't involved at all with fileConfig -- 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: Using %(here)s in logging config
On Aug 3, 2009, at 2:41 AM, kochhar wrote: Mike Orr wrote: On Fri, Jul 31, 2009 at 12:05 PM, kochharkochhar...@gmail.com wrote: The file is used in two different ways. Variables are extracted using paste.deploy.loadwsgi.NicerConfigParser, which interpolates %(here)s. Logging configuration is done by logging.config.fileConfig, which doesn't know about interpolation. That's quite non-intuitive. What's the benefit of lumping the configs together if they behave differently? Could NicerConfigParser be used to generate an temporary interpolated version of the config file to give to logging's fileConfig? I'd be happy to write a patch if that's a reasonable fix. fileConfig accepts a set of defaults to pass to ConfigParser, so I've made PasteScript's logging config loader pass 'here' (and also '__file__' which PasteDeploy apparently sets up): http://trac.pythonpaste.org/pythonpaste/changeset/8052 -- 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: How display options select field in given order ?
On May 22, 2009, at 2:31 PM, Jan Koprowski wrote: Hi ! How I can display options elements in select field exactly in this same order as I wrote it in dictionary ? Assuming you're using webhelpers.html.tags.select, you can pass it an ordered iterable of item pairs, like a list of tuples (see its documentation). Plain dicts don't maintain order -- 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: trouble building docs
On May 11, 2009, at 12:11 PM, Walter Cruz wrote: pylons repo get from: http://pylonshq.com/hg/pylons-dev/ (sphinx)wal...@stark ~/devel/python/pylons/pylons/docs/en$ make html mkdir -p _build/html _build/doctrees sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx v0.6.1 loading pickled environment... not found building [html]: targets for 77 source files that are out of date updating environment: 77 added, 0 changed, 0 removed Exception occurred:[ 58%] thirdparty/formencode_api File /home/walter/.virtualenvs/sphinx/lib/python2.5/site-packages/ Sphinx-0.6.1-py2.5.egg/sphinx/ext/autodoc.py, line 487, in get_object_members for mname in self.get_attr(self.object, '__dict__')]) RuntimeError: dictionary changed size during iteration The full traceback has been saved in /tmp/sphinx-err-OtGUsQ.log, if you want to report the issue to the author. Please also report this if it was a user error, so that a better error message can be provided next time. Send reports to sphinx-...@googlegroups.com. Thanks! make: ** [html] Erro 1 The trouble is with pylons docs or sphinx? Luckily sphinx-build has a pdb option (-P) which let me narrow this down easily, formencode.Validator triggers it. It's really a sphinx bug with tricky classes, this fixes it: http://pylonshq.com/pasties/cd4b0d856ce7efe39b8e7378b931c3ee Could you maybe log a ticket about this with Sphinx? I get another even stranger error after this when it's autodocing WebOb. Do you get this with the patch applied? Exception occurred:[ 89%] thirdparty/webob File /Users/pjenvey/src/python/pylons-apple/lib/python2.5/site- packages/Sphinx-0.6.1-py2.5.egg/sphinx/ext/autodoc.py, line 844, in import_object self.doc_as_attr = (self.objpath[-1] != self.object.__name__) AttributeError: '_AnyETag' object has no attribute '__name__' - from webob.etag import _AnyETag _AnyETag.__name__ '_AnyETag' FYI downgrading Sphinx should get around all this. -- 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: jsonify Decimals and datetime.date
On May 1, 2009, at 12:45 AM, Marius Gedminas wrote: It's tricky, but not too tricky, if you only accept keyword arguments in to @jsonify(): Yep, but I definitely don't want to keep it working both ways going forward (1.0). It'd be a good stopgap. def jsonify(fn=None, arg1=value1, arg2=value2): if fn is None: # this is @jsonify(arg1=...), so return a decorator return functools.partial(jsonify, arg1=arg1, arg2=arg2) @functools.wraps def wrapped(*a, **kw): # do stuff retval = fn(*a, **kw) return simplejson.dumps(retval, arg1=arg1, arg2=arg2) return wrapped functools.wraps here isn't enough because it doesn't maintain the method argspec -- we need the decorator module magic. Pylons needs the argspec maintained to know what routing args to pass along. -- 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: jsonify Decimals and datetime.date
On Apr 30, 2009, at 5:13 AM, Uwe Feldtmann wrote: Thanks Domhnall. Not sure if it will help as I'm using the jsonify decorator on a method in the controller and it is what is failing when attempting to wrap the result set. Unfortunately our @jsonify just sucks in that you can't specify args to dumps. Otherwise this would be even slightly easier than Domhnall's example: # Don't even need a subclass def myenc(d): if if isinstance(d, decimal.Decimal): return float(str(d) # etc raise TypeError() simplejson.dumps(data, default=myenc) We need to fix jsonify -- what's a little problematic is it's built to take no arguments, which is significantly different from a decorator that's built to take arguments. We may be able to make the decorator work both ways for 0.10 but it'd tricky/annoying. Pylons 1.0 could definitely break it, however: @jsonify - @jsonify() -- 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: webhelpers: Convert markdown to text format
On Apr 17, 2009, at 11:26 AM, karikris...@gmail.com wrote: I have to convert my markdown to plan text to display the text summary in the homepage? How to do that? http://tinyurl.com/dk8a5b =] -- 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: installation has NEVER worked on the first try in two years of using Pylons
On Apr 9, 2009, at 4:22 AM, Noah Gift wrote: Ok, so I took the time to completely walk through the steps I had trouble with last night, and I was able to reproduce the installation problem. Notice that, yes, indeed, the wrong paster was in my path, but I stepped around it by calling the full path to paster inside of my virtualenv. http://pylonshq.com/pasties/4e2608ece2c92fcc84b69784d75b754a Thanks Noah, The problem must be an old version of virtualenv (or setuptools). I see setuptools-0.6c7 in the traceback -- the latest version is 0.6c9. That means your virtualenv must be ancient. I don't recall any weird issues like this with setuptools-0.6c7, but maybe this is an old virtualenv issue, maybe even particular to OSX. -- 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: installation has NEVER worked on the first try in two years of using Pylons
On Apr 8, 2009, at 4:50 AM, Noah Gift wrote: I get frustrated every time I setup a new virtualENV as I forgot that something always breaks. I just got this today: http://pylonshq.com/pasties/d8768f105749c5c169094812c4e0f01a I suspect you might have actually forgotten --no-site-packages. If you did indeed set it there would be a /Users/ngift/src/pylonsENV/lib/ python2.5/no-global-site-packages.txt Otherwise I don't know why Tempita wouldn't have been installed. Is it reproducible? Regardless of what the problem is, in the future it would be nice if we provided an 'all in one' install archive. Like a pip bundle (but then we have to require pip), or I think zc.sourcerelease can produce something similar. EggFreezer also does something along these lines but was more of a binary distribution installer. Something that bootstraps itself and installs everything without having to go through pypi, like a fully self contained go-pylons.py -- 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: Google Summer of Code '09
On Mar 12, 2009, at 10:10 PM, Philip Jenvey wrote: Pylons has submitted an application to GSoC '09, so we hope to be involved. Unfortunately our application was rejected. Rumor has it Google would be more picky with applicants this year, due to a reduced budget. There's some details about that here: http://blog.internetnews.com/skerner/2009/03/google-summer-of-code-2009-ope.html However there's still a chance for us to get some SoC action if we have some compelling students/projects -- possibly under the PSF org, or another remote possibly -- some kind of collaboration with the TurboGears org (depending on the project idea). -- 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: Google Summer of Code '09
On Mar 12, 2009, at 10:10 PM, Philip Jenvey wrote: Pylons has submitted an application to GSoC '09, so we hope to be involved. I've created a page on the wiki to list out ideas for projects: http://wiki.pylonshq.com/display/pylonscookbook/Google+Summer+of+Code Also if anyone is interested in mentoring, please add your name to the list. I'm guessing the more potential mentors we have listed, the better our chances of acceptance. -- 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: Helpers in 0.9.7
On Mar 16, 2009, at 2:06 PM, edgarsmolow wrote: I recently began development with Pylons 0.9.7. The online docs suggest using a function called url_for that should be in myproject.lib.helpers.py. But, the file is essentially empty. Is helpers.py supposed to come with any functions at all, or are we supposed to write url_for (and any others mentioned in the docs)? The official docs here: http://pylonshq.com/docs/en/0.9.7/ don't refer to url_for anywhere. The articles on the cookbook and also the online copy of the book may be a little out of sync and still refer to url_for/h.url_for. url_for still works, but the pylons.url global is preferred. -- 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: Error on upgrading from .9.6 when touching Headers in response
On Mar 14, 2009, at 9:24 AM, Jonathan Vanasco wrote: so basically we mostly just need a docs change to the 'migrating to 0.9.7' instructions Ok, done. Feel free to add to my change: http://wiki.pylonshq.com/pages/diffpages.action?pageId=11174779originalId=15302939 -- 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: Google Summer of Code '09
On Feb 23, 2009, at 12:00 AM, billy wrote: Do you guys have any plans in participating this year? I've recently got into python, and am very interested in pylons as a web framework so I thought it wouldn't hurt to see if you guys have any intentions on participating so maybe I can get in on a piece of the action :). Pylons has submitted an application to GSoC '09, so we hope to be involved. I've created a page on the wiki to list out ideas for projects: http://wiki.pylonshq.com/display/pylonscookbook/Google+Summer+of+Code If anyone has ideas, please feel free to contribute to this page. You simply need to signup for a login on the wiki to edit the page. -- 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: Disabling unicode doesn't always disable unicode in 0.9.7
On Mar 9, 2009, at 12:53 PM, Ross Vandegrift wrote: On Fri, Mar 06, 2009 at 03:17:55PM -0800, Philip Jenvey wrote: This should work: config['pylons.request_options']['charset'] = None Maybe you don't have this line at the end of the environment.py? It should come after config.init_app You can check request.charset later for what this is actually set to. Only the value of None should disable unicode (US-ASCII won't). Yea, something is definitely incorrect with disabling Unicode handling. I've setup a matching Apache/FCGI deployment with config['pylons.request_options']['charset'] = None. If I raise an Exception and print request.charset in the debug interface, I get 'utf-8'. I can confirm with LiveHTTPHeaders that my browser is not providing a Content-Type header that would be overriding the default character set. Earlier you said the Apache/FCGI environment wasn't having problems, but local paster was. Are you now saying you end up with a charset value of utf-8 in both places? Anyway, if it doesn't work in paster, I would concentrate on isolating the problem there, locally. However I'm unable to reproduce the issue with 0.9.7. Are you using 0.9.7 final? This may have been a bug in one of the earlier RC/betas. -- 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: Disabling unicode doesn't always disable unicode in 0.9.7
On Mar 6, 2009, at 2:34 PM, Ross Vandegrift wrote: Hi everyone, One of my app's primary functions is to speak SNMP to routers and switches. This completely precludes the use of any Unicode - something that's getting very frustrating in Python (not just Pylons!) I've got: config['pylons.request_options']['charset'] = None config['pylons.response_options']['charset'] = 'iso-8859-1' in my config/environment.py. But I still have request.params being passed up the stack with everything as Unicode. Here's one example: UnicodeMultiDict([('location', u'2'), ('domain', u'2'), ('hostcount', u'6'), ('customer', u'a'), ('type', u'2'), ('description', u'a'), ('ttype', u'srt'), ('nexthop', u'172.16.0.4'), ('vlanmethod', u'auto'), ('vlan', u'0'), ('interface', u'Vlan99')]) I didn't see this behavior until 0.9.7. I've also tried setting config['pylons.request_options']['charset'] = US-ASCII, but the data comes through the same. This should work: config['pylons.request_options']['charset'] = None Maybe you don't have this line at the end of the environment.py? It should come after config.init_app You can check request.charset later for what this is actually set to. Only the value of None should disable unicode (US-ASCII won't). -- 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: Codepage, UTF-8
On Mar 3, 2009, at 9:00 AM, Christopher Barker wrote: menshikoval...@gmail.com wrote: In my controller I use flash('Регистрация'), then in sends to template form in \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f How to use u prefix here? Does: flash(u'Регистрация') not work? On Mar 3, 2009, at 10:33 PM, menshikoval...@gmail.com wrote: No =( You probably don't have a magic encoding comment. Try adding: # coding: utf-8 (or whatever encoding your editor uses) to the top of your .py file. -- 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: Thread-safety in Pylons (Python?)
On Mar 4, 2009, at 1:58 PM, kgs wrote: I could not find anywhere unambigous answer if accessing Python primitives from many threads is safe or not - for me it looks that it might be not safe (because modyfing/iterating/accessing e.g. dictionary may result in context switches). This is the most authoritative page: http://effbot.org/pyfaq/what-kinds-of-global-value-mutation-are-thread-safe.htm It's still a bit ambiguous on what is really safe, but I can guarantee the two basic dict operations in question (a getitem and setitem on steady dict value) are in fact safe. -- 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: Beaker error
On Mar 2, 2009, at 11:24 AM, Mike Orr wrote: I've started getting an intermittent Beaker error. It happens in the base controller when I pass ``session.id`` to a generic logging routine. However, I have three sites with the same logging code, and it's only happening on one of the sites. It occurs on a variety of URLs. Here's the exception: x = self.do_acquire_write_lock(wait) Module beaker.synchronization:260 in do_acquire_write_lock return False else: fcntl.flock(filedescriptor, fcntl.LOCK_EX) return True fcntl.flock(filedescriptor, fcntl.LOCK_EX) TypeError: argument must be an int, or have a fileno() method. It'd be helpful to know what the value of filedescriptor is when this happens. -- 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: Application server
On Mar 1, 2009, at 6:26 AM, Kless wrote: If pylons work under Jython, then should get it to go under babble. And looks that is mostly working on Jython: http://wiki.python.org/jython/PylonsOnJython That wiki page was a little stale, I've now updated it. Pylons 0.9.7 now supports Jython. I'm not sure what it would take to integrate it with Babble as it seems to be its own big app server thing. Looks like integrating it with Django isn't too straightforward. Having a Pylons app in Jython that works with some Java libs (like a database) in the same process is now a definite possibility, though. -- 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: 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 -~--~~~~--~~--~--~---
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: 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: old doc bug for Routes
On Feb 23, 2009, at 11:00 AM, Chris Curvey wrote: It appears that routes has changed since http://wiki.pylonshq.com/display/pylonscookbook/Routes+for+people+in+a+hurry was written. To map a controller/action to the root of the site, you now need to specify map.connect(/, controller=mycontroller, action=index). Where/how should I report issues like this? You should be able to edit any page in the Pylons Cookbook, as long as you're logged in. -- 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
On Feb 23, 2009, at 10:58 AM, Chris Curvey wrote: I put the setup_all in load_environment (in environment.py), and that seemed to do no harm. But I can't find a method called setup_config anywhere. websetup's setup_config changed to setup_app in 0.9.7. def setup_config(command, filename, section, vars) -- def setup_app(command, conf, vars): Either one will work, regardless of version -- 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: beaker_cache query_args when duplicate queries are in
On Feb 11, 2009, at 3:38 AM, Wichert Akkerman wrote: Previously Philip Jenvey wrote: I just applied a fix that now correctly handles eleith's issue with duplicate query params, and always includes the function name regardless of the key type specified. I think you also need to add the class name if you get a bound function: you may very well have the same function name in multiple classes in the same source file. The class's name and module name are used for the cache's namespace, which'll prevent clashes. For normal functions just the function's module name is used for the namespace. Looking at this again maybe the class name should be in the key instead of the namespace, but that's not a big deal. By the time you read this an rc5 will likely be out with all these fixes. -- 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: logger configuration for sqlalchemy
On Feb 10, 2009, at 7:35 AM, przemek.ch wrote: Hi, Using sql alchemy I get warnings like this: C:\Python26\lib\site-packages\sqlalchemy-0.5.3dev-py2.6.egg\sqlalchemy \orm\scoping.py:121: SADeprec ationWarning: Use session.add() return getattr(self.registry(), name)(*args, **kwargs) But here I can't see the source of the problem. How can I configure the logger to see whole stack trace. In my development.ini I have: This is a warning emitted by the warnings module -- it has nothing to do with the logging system. Either the deprecated call was caused by SQLAlchemy itself (hence it referring to its own code) or probably more likely, the warning is using the wrong stack level, and not pointing you to where your code is using the deprecated call. You'll probably want to ask the sqlachemy devs about 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: beaker_cache query_args when duplicate queries are in
On Feb 9, 2009, at 4:33 AM, Wichert Akkerman wrote: Previously eleith wrote: My solution was to write my own decorator. could you share your decorator? For what it's worth below is my variant of beaker_cache. It has the advantage over the stock version that it works everywhere instead of only for controller methods and will never try to cache response headers. I think the latest tip solves all the complaints with beaker_cache in this thread. I just applied a fix that now correctly handles eleith's issue with duplicate query params, and always includes the function name regardless of the key type specified. A fix was made about a month ago to make it work everywhere (not just controller actions) again. There's been a toggle to specify which cache headers it preserves for a while now. -- 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: Routes problem (not thread safe?)
On Feb 9, 2009, at 2:47 AM, carlos wrote: Hi, I'm using Pylons 0.9.6.1, with Routes 1.7.3 and Python 2.5. inspecting de variables with the traceback debugger, I see that var is always a str, but self.prior is sometimes a dict ( {'type': ':', 'name': 'format'} ) and sometimes a str (but it also raises the TypeError exception, as if it was a dict!). It seems some kind of thread problem, because I repeat the same request and it works fine. Is this a known bug or maybe I'm doing something wrong? Yes, this was a bug -- create_regs was not thread safe. According to the changelog this was fixed in the 1.9 release. -- 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: Source encoding issues
On Jan 31, 2009, at 4:24 PM, Damjan wrote: I know about the pep and how python source files are encoded, but the interactive shell is something completely different. I wonder on what local env variable does shell depend. Since I have all of them either sl_SI.UTF8 or en_GB.UTF-8. The Python interactive shell depends on the locale (LANG or LC_xxx, run locale to see). The paster shell is just buggy I'd say (same as ipython). We have an issue open for this: http://pylonshq.com/project/pylonshq/ticket/531 I just noticed that the problem is likely due to a bug in the stdlib's code module (see the ticket for more info) -- I'd love to see a monkey patch to solve this for paster shell. Any takers? -- 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: Pylons vs Tomcat+GWT
On Jan 30, 2009, at 11:21 AM, Tycon wrote: Is there a Rails-like framework for Java ? The Java Wicket framework is intended to provide rapid web development ala Rails, that might be the closest thing. If you just want to run on the JVM and are willing to take a performance hit from regular Java, you could use Rails via JRuby, or Grails via Groovy or even Django or Pylons via Jython (Pylons 0.9.7 has initial support for Jython 2.5). JRuby is slower than regular Java, but at this point is probably better for most things (particularly long running server side apps) than normal Ruby 1.8 (MRI). There's also Scala's Lift web framework. Scala should perform close to normal Java. Granted I'm talking about the performance of these language runtimes compared to Java -- the performance of the frameworks themselves may matter as well. -- 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 with installation through easy_install
On Jan 1, 2009, at 11:17 PM, baluviki wrote: Installation of pylons (easy_install Pylons==0.9.6.2) fails with traceback. Last error is: File /usr/lib/python2.5/httplib.py, line 604, in _safe_read raise IncompleteRead(s) httplib.IncompleteRead: The same thing appears for easy_install -U setuptools too. I do not use easy_install normally. For example originally I installed setuptools as an ubuntu-pkg. So is there any magic, I have to do? This may have been due to pypi, or http://pylonshq.com/download being temporarily unavailable. Try again, does the problem still occur? -- 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: pylons.decorators.secure.https throws away the query string ?
On Jan 1, 2009, at 6:23 PM, Tycon wrote: This decorator is supposed to redirect HTTP GET requests to HTTPS. But guess what ? The query string in the request URI is lost, so the redirected (https) request will not have any request.params even if the original (http) request did. I'm surprised nobody's noticed this bug yet, thanks for pointing it out. We'll get it fixed for 0.9.7 final, though you should log a ticket for it anyway, as we're really good at forgetting about bugs that aren't. A patch would be great -- there is an @https test also, which obviously also needs attention. -- 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: Is there an easy way to set MIME types for static files?
On Jan 1, 2009, at 3:25 AM, Nopparat C wrote: I am learning to do RIA application using curl and pylons. I wonder if there is a way to configure MIME types for static files like I usually do in apache AddType text/vnd.curl .curl AddType text/vnd.curl.dcurl .dcurl You just need to register these with Python's mimetypes module. The WSGI middleware that serves static files, paste.fileapp.FileApp, uses that module to determine content-types. -- 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: easy_install pylons
On Dec 18, 2008, at 8:48 AM, Lawrence Oluyede wrote: On Thu, Dec 18, 2008 at 5:27 PM, Tibor Arpas tibor.ar...@infinit.sk wrote: Hi, I don't know if anybody noticed. easy_install pylons is broken because of this: (ENV) C:\Documents and Settings\All Users\services\infinitsk\infinitskeasy_install decorator==2.3.1 Searching for decorator==2.3.1 Reading http://www.pylonshq.com/download/ Reading http://pypi.python.org/simple/decorator/ Reading http://www.phyast.pitt.edu/~micheles/python/ documentation.html No local packages or download links found for decorator==2.3.1 error: Could not find suitable distribution for Requirement.parse('decorator==2. 3.1') I'm not sure what's the history and why the 2.3.1 isn't there, any ideas? I work with the author and AFAIK the solution is to store a version of the decorator somewhere in the pylonshq.com/download site or point it to the 2.3.2 bersion because it's been recently upgraded to 2.3.2 and moved to PyPI due to problems with the former website. BTW decorators has also been upgraded to version 3. http://www.artima.com/weblogs/viewpost.jsp?thread=245050 Think should be safer this before releasing the 0.9.7 We always host duplicates of the eggs on http://pylonshq.com/ download/, we just haven't quite everything up there for the release candidates. Everything will be there for the final release (coming very soon). I haven't tried 3.0 yet, and we're very close to 0.9.7 so I'm not going to require it just yet. Instead we'll require 2.3.2 (which is quite old now, and as you mentioned, is also on pypi) as a minimum. -- 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: easy_install pylons
On Dec 18, 2008, at 6:48 PM, Mike Orr wrote: Why do requirements sometimes mean Install this version minimum but take a newer one if it's available, and sometimes Install this version even if there's a newer one? So, Pylons has 'WebHelpers=0.6.3' . I'd hope that would install 0.6.4 if it were available, but last week at work it didn't. I'd prefer the latest version to be installed, but I don't want to make it difficult if people do want to use an older version. But for people who *do* need the newest version (like me), I don't want them to have to upgrade because easy_install chose to install an older version. In this case you got WebHelpers 0.6.3 because its egg is hosted @ http://pylonshq.com/download/0.9.7 , Pylons' dependency_links url. setuptools checked there first, found its minimum requirement, so didn't bother checking elsewhere Yet today when I installed Pylons at home, it installed decorator 3.0.0, in contradiction to Tibor's experience. Not sure why this happened. I'm curious what setuptools said about it when it traversed the download links. -- 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: If you HAD to use Java...
On Oct 31, 2008, at 11:05 AM, Wyatt Baldwin wrote: So, let's say you're a dedicated Python programmer and your Web framework/stack of choice is Pylons/Mako/SQLAlchemy (declarative, thank you very much). Let's also say that you're working on a project where you have, or are at least strongly compelled, to use Java. (And we'll also assume that you're sneaking Python in through back door whenever possible.) On top of all that (or maybe beneath it), you're a RESTafarian (but not a dogmatic practitioner) who prefers JSON over XML and has written your own RESTful base controller for Pylons (Restler) that follows the Rails/ATOM style. It's probably obvious where I'm heading with this--what libraries, tools, etc would you choose in JavaLand to get as close as possible to the feel of your preferred platform? FYI I've been working on making the answer to this question Use Pylons.. with Jython. Initial Jython 2.5 support is coming in the 0.9.7 release. Here's our Pylons on Jython buildbot: http://pylonshq.com:8014/ The few remaining failures on there are unimportant, minus the lack of elementtree, which is already being worked on and will land on Jython trunk very soon. The next step is to provide a way to create .war files from a Pylons project, which I'm tackling now. Then, support for more of the common optional libraries like SQLAlchemy, Genshi/Jinja2, etc. -- 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: Disk-based sessions on Windows
On Dec 3, 2008, at 1:08 PM, Mike Orr wrote: My colleague is getting the following error trying to run a Pylons application on Windows: IOError: [Errno 13] Permission denied: 'C:\\Documents and Settings\\Chris.Barker\\My Documents\\StandAlone/data\\sessions/container_file\\0\\04\ \04b435634fabe964808ec7a2df337889.cache' Can he show us the full stack trace? -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Jinja2 template
On Dec 4, 2008, at 11:48 AM, Kless wrote: If anybody wants to use Jinja2, read here [1] I hope that this version can be choosed too when a new project is created. It will, we actually upgraded the Jinja support to Jinja2 just shortly after rc4. The supported template options for new projects will be mako/genshi/jinja2 -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: simplejson install error, need help
On Nov 23, 2008, at 10:07 AM, Rod Morison wrote: I'm starting a new project and am trying to install Pylons 0.9.7 on a fresh install of Windows Vista/64 with Python 2.6. Easy install quits on an error installing simplejson. snip building 'simplejson._speedups' extension error: Setup script exited with error: None What version of setuptools/ez_setup was in use here? -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Beaker 1.1 Release
On Nov 19, 2008, at 1:47 PM, Michael Bayer wrote: also your usage is more succinct via: response = cache.get_value(request, expiretime=x, createfunc=lambda: func(self, *arg, **kw)) Mike, I've attempted a quick and dirty auto upgrade patch for the Beaker 1.0.x format to 1.1, take a look: http://pylonshq.com/pasties/1003 -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: simplejson installation failure
On Nov 7, 2008, at 10:34 PM, Mike Orr wrote: On Fri, Nov 7, 2008 at 4:20 PM, Deron Meranda [EMAIL PROTECTED] wrote: On Fri, Nov 7, 2008 at 5:52 PM, Florent Aide [EMAIL PROTECTED] wrote: On Thu, Nov 6, 2008 at 3:30 PM, Mike Orr [EMAIL PROTECTED] wrote: Simplejson has a C component that doesn't install cleanly on some Windows systems. If you're in a pinch and can't get simplejson to work, there are some other JSON modules that are pure python. People aren't installing simplejson because they're using it; they're installing it because it's a Pylons dependency. So you either have to download Pylons manually and hack setup.py, or find some way to get simplejson installed. It's only used for the @jsonify decorator. I've argued for dropping the dependency or downgrading it to the older simplejson that doesn't have this install problem, but was overruled by hopefully simplejson will fix their package soon. AFAICT this is a new problem (at least I don't recognize it). Just to clarify I did submit fixes for all the issues we encountered (to both setuptools and simplejson), we were just waiting for the setuptools-0.6c9 release, which was overdue anyway. That's been out for over a month now. Maybe we should reconsider dropping it -- I don't like a lot of dependencies either -- but first I'd like to know what the actual problem is here. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: simplejson installation failure
On Nov 6, 2008, at 1:20 AM, antonio wrote: Can´t get simplejson installed with easy install. I don´t know how to install manually without easy install, don´t know the necessary commands. Other pylons-components that I had to install with easy install worked well. I had to install some components separately because installation of pylons paket wouldn´t work, it stopped at the failure with simplejson. Any help appreciated, thanks. Protocol: C:\Python26\Scriptseasy_install-2.6.exe simplejson Searching for simplejson Reading http://pypi.python.org/simple/simplejson/ Reading http://undefined.org/python/#simplejson Best match: simplejson 2.0.4 Downloading http://pypi.python.org/packages/source/s/simplejson/simplejson-2.0.4 .tar.gz#md5=9a888ea017ef2fcd42a2823454950b16 Processing simplejson-2.0.4.tar.gz Running simplejson-2.0.4\setup.py -q bdist_egg --dist-dir c: \dokume~1\johndoe\lo kale~1\temp\easy_install-8nk8s5\simplejson-2.0.4\egg-dist-tmp-wy68t0 error: Setup script exited with error: None First, ensure you're using the latest setuptools -- 0.6c9. If the problem still occurs, try running easy_insatll with the -v (verbose) option. Otherwise we can't tell what actually happened here. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: paster exception (generator ignored GeneratorExit)
On Oct 17, 2008, at 8:14 AM, Michael van Tellingen wrote: Heya, I'm currently pretty much reliably triggering the following exception using IE6 (and some iframe/form post stuff): Exception happened during processing of request from ('192.168.131.1', 58222) Traceback (most recent call last): File /Library/Python/2.5/site-packages/Paste-1.7.1-py2.5.egg/paste/ httpserver.py, line 1056, in process_request_in_thread self.finish_request(request, client_address) File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/SocketServer.py, line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/SocketServer.py, line 522, in __init__ self.handle() File /Library/Python/2.5/site-packages/Paste-1.7.1-py2.5.egg/paste/ httpserver.py, line 432, in handle BaseHTTPRequestHandler.handle(self) File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/BaseHTTPServer.py, line 316, in handle self.handle_one_request() File /Library/Python/2.5/site-packages/Paste-1.7.1-py2.5.egg/paste/ httpserver.py, line 427, in handle_one_request self.wsgi_execute() File /Library/Python/2.5/site-packages/Paste-1.7.1-py2.5.egg/paste/ httpserver.py, line 295, in wsgi_execute result.close() RuntimeError: generator ignored GeneratorExit Putting the result.close() call in a try/except clause will allow paster to send the data to the client, thus this is currently my workaround. How do we produce this? I assume you're using a generator in a Pylons controller, is it that easy or is there anything else involved? -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: adding personal flags in Development.ini
On Oct 8, 2008, at 11:28 AM, ashok wrote: Hi All, I have a question about flags in development.ini file. Most of them are parsed by paster itself, but what I want to do is create my own flag and parse it myself. For example, I added this to the file: [mode] user_logging = 1 Now I need to parse this in my program, however, I was wondering if there is an intrinsic function that I could use to parse the file. Does any one know of this? You can add custom vars to the [app:main] section of your config file and they'd be available via the pylons.config object -- so you might do: use_logging = asbool(pylons.config.get('use_logging')) -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Shutdown hook
On Oct 8, 2008, at 3:40 PM, Phil Fazio wrote: I was wondering if there were a way to run methods or execute code on server shutdown (Ctrl+C, or otherwise). I'd like to close a Berkeley DB environment I'm running so as to avoid a potential nasty bug -- I tried adding code to the __del__() method of app_globals.py, but it doesn't seem to execute. Any help is greatly appreciated! Sure, you want the atexit module. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Templating c Stacked Object
On Oct 7, 2008, at 5:01 PM, EricHolmberg wrote: How can I create the global c variable that is used in the templates if I'm in an WSGI app and not in a controller response method? With the WSGI dispatch, I need to rewrite some of the output using Genshi, so I have the following code: class EmbeddedtracController(BaseController): def __init__(self): # set application to the trac WSGI dispatch_request function self.app = dispatch_request self.trac_env_path = config['trac_env_path'] def __call__(self, environ, start_response): Dispatches request to trac. ... self.rewriteLoginPage(environ, strHtml) ... def _rewriteLoginPage(self, environ, strHtml): Handles the 403 Forbidden response. # Set variables for Genshi c.input = strHtml ... return render(genshi, TracLogin) Probably the best place for calling _rewriteLoginPage would in a __before__ method. __call__ is the main entry point into Controllers, and unfortunately by that point variables like c aren't setup yet. Whereas they would be in __before__ (and __after__). which results in the following error message: c.input = strHtml File 'c:\\python25\\lib\\site-packages\\paste-1.7.1-py2.5.egg\\paste\ \registry.py', line 140 in __setattr__ setattr(self._current_obj(), attr, value) File 'c:\\python25\\lib\\site-packages\\paste-1.7.1-py2.5.egg\\paste\ \registry.py', line 194 in _current_obj 'thread' % self.name__) TypeError: No object (name: C) has been registered for this thread -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: RuntimeError: maximum recursion depth exceeded
On Sep 25, 2008, at 10:58 AM, Krishgy wrote: I have got this following error. Hope if someone can figureout.. line 264, in _pop_object_restoration self._pop_object_orig(obj) File c:\python25\lib\site-packages\paste-1.7.1-py2.5.egg\paste \registry.py, line 264, in _pop_object_restoration self._pop_object_orig(obj) File c:\python25\lib\site-packages\paste-1.7.1-py2.5.egg\paste \registry.py, line 263, in _pop_object_restoration if not restorer.in_restoration(): RuntimeError: maximum recursion depth exceeded What verson of Pylons are you using and what did you do to make this occur? -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: nosetests can't find packages?
On Aug 19, 2008, at 12:24 PM, Phredward wrote: I'm trying to run nosetests, and I keep getting package not found errors. I tried just making the sample blog app from http://wiki.pylonshq.com/display/pylonscookbook/Making+a+Pylons+Blog and started following the instructions for testing it at http://wiki.pylonshq.com/display/pylonsdocs/Unit+Testing. When I run nosetests --with-pylons=test.ini I get an error that ends with: File /usr/lib/python2.5/site-packages/pkg_resources.py, line 524, in resolve raise DistributionNotFound(req) # XXX put more info here pkg_resources.DistributionNotFound: MyBlog Is your project's egg-info directory still intact? If not, try running 'python setup.py egg_info' before nosetests. If that's the solution, we may need to make the with-pylons nose plugin run egg_info every time, or maybe only if it notices a DistributionNotFound exception. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: paster shell doesn't work with 0.9.7rc1dev
On Jul 4, 2008, at 6:29 PM, Olli Wang wrote: Hi, I got a traceback when I was trying to enable paster shell with the development version. Any idea? Thanks. File /usr/lib/python2.5/site-packages/Myghty-1.1-py2.5.egg/myghty/ importer.py , line 54, in import_module return builtin_importer(name, globals, locals, fromlist) File /usr/lib/python2.5/site-packages/Beaker-0.9.5-py2.5.egg/beaker/ ext/googl e.py, line 1, in module from __future__ import absolute_import TypeError: import_module() takes at most 4 arguments (5 given) This is a myghty bug (someone reported about a month ago actually). It's overriding builtin's __import__ and not handling the new level flag used for absolute imports in 2.5. If you're not using Myghty, the easiest way of avoiding this is to uninstall it. Otherwise Myghty's trunk will have a fix very soon. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Cross-Project code sharing...modules/plugins what does Pylons use?
On May 24, 2008, at 6:37 AM, rcs_comp wrote: For example, I would like to have a news, blog, and calendar module that I can plug into different applications. The goal is to have everything for the module contained in one subdirectory including any configuration, routing, templates, controllers, model, etc. So, something like this: /modules/news/... /modules/calendar/... /modules/blog/... If these are in fact separate applications, you can make each one its own Pylons app. Then you might also have a common package of code shared between all three (this would be a separate egg). Then at deployment time you can combine them into one composite application with Paste URL map, via the ini file: http://pythonpaste.org/deploy/#composite-applications -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Sharing caches and sessions between multiple Pylons instances
On May 23, 2008, at 2:06 PM, L.C. Rees wrote: In a scenario where you're running multiple Pylons instances of the same Pylons application behind a load balancer, what techniques can you use to share Beaker sessions and caches between the instances so the data they're storing can be accessed when needed irrespective of which instance is handling an individual request?-lcr Beaker can use SQLAlchemy or memcached as its backends. Unfortunately we don't have a tutorial on how to set this up. Someone wrote a good little intro that covers the Beaker backends here (unfortunately he never migrated this over to the Beaker section on the wiki): http://www.openvest.com/trac/wiki/BeakerCache It only covers just the Beaker API though, it doesn't cover how you'd utilize these backends within Pylons. I think the key thing you need to know is that you can set Beaker options (like the 'type' option) in the app section of your ini file. e.g.: beaker.type = 'memcached:stuff': Those options are covered here: http://wiki.pylonshq.com/display/beaker/Configuration+Options The @beaker_cache decorator can also take a type argument. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: get_lang/set_lang why the different signature?
On May 13, 2008, at 3:03 AM, Jorge Vargas wrote: set_lang is a string which inside pylons (_get_translator in translation.py) is converted to a list to make python's gettext happy. but then it's stored as a list in translator.pylons_lang which is retrieved by get_lang. not only this is misleading but it's wrong as with the current code it's not possible to have more than one lang anyway, unless you monkey patch translation.py set_lang should also be able to take a list as well. There's also an add_fallback function in pylons.i18n to add another language after the fact. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Extra / normalization
On Apr 29, 2008, at 12:29 PM, Yannick Gingras wrote: Passing the slashes as %2f do not help: it seems that the stripping occurs after the URL decoding. Does anyone know where this stripping occurs and if it's possible to selectively disable it? Unfortunately you can't disable it, WSGI servers must decode the URL's path portion before passing it to WSGI apps. Either an RFC or the CGI spec (which WSGI 1 stays compatible with) mandates this, I can't recall which -- Ben Bangert or Ian Bicking might remember. All you can do is include that value as parameter instead, or use WSGI 2 (which of course doesn't exist yet, but somewhere we've penned this 'feature' to be removed in version 2 of the spec). -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Pylons + Google App Engine
On Apr 9, 2008, at 3:58 AM, Alagu Madhu wrote: How to get started with Pylons and Google App Engine ? So we've made some progress over the past few days. You can now pretty much get Pylons working on App Engine. Ian Bicking has written a nice rundown of what had to happen: http://blog.ianbicking.org/2008/04/13/app-engine-and-pylons/ You'll also need his appengine-monkey library, which has a wiki page on how to get started with Pylons on App Engine: http://code.google.com/p/appengine-monkey/wiki/Pylons Give it a whirl and let us know how it goes! -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Pylons + Google App Engine
On Apr 9, 2008, at 9:43 AM, Bob Ippolito wrote: You can always take the approach where C modules are used if available, otherwise pure Python code can be used. simplejson does this, for example. Unfortunately it's not just C extensions that are the problem on app engine, it's actually Python builtin modules written in C. E.g. the problem with Mako and Genshi on app engine is that they need the builtin parser module to parse python code to AST. Rumor has it some C modules, like parser, are restricted due to security concerns -- like they would need to audit the parser module's rather hairy C code to ensure it's not violating their restricted Python sandboxing (though I'm not sure about this). I'm getting the impression that the guys behind google app engine are very Django centric, and might not be that aware of how important Mako and Genshi are outside of Django (I think they're very important for Django too, not every Django app uses Django templates). I'd encourage everyone to help make them aware of how important it is to get the pieces of our stack working: one way is by voting ('starring', click on the star) the related issues logged on their ticket tracker: The Mako templating doesn't work: http://code.google.com/p/googleappengine/issues/detail?id=9 Incompatible with pkg_resources http://code.google.com/p/googleappengine/issues/detail?id=60 Expand Python framework support to Zope3, Turbogears, and Pylons http://code.google.com/p/googleappengine/issues/detail?id=33 -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Internal Errors due to WebError failures on source encoding
On Apr 8, 2008, at 3:41 AM, Marcin Kasperski wrote: (tested using pylons-dev and WebError-0.8a) I have some error in my sources. Unfortunately WebError crashes so I do not see this error but WebError failure instead. And it crashes because it .encode-s strings using 'ascii'. I tried replacing all 'ascii' with 'utf-8' in weberror/exceptions/formatter.py and it seems to resolve the issue (true error was properly shown in pylons debugging page, in this case it was lacking import) The main question: why 'ascii'? Plus ... what about patching WebError just like I did? There's a ticket logged about this here: http://pylonshq.com/project/pylonshq/ticket/406 Ideally this would be taken care of before the 0.9.7 release. Is there any similar issues with the EvalException used in 0.9.6.1 I wonder, or is this new due to the new XML generation? The problem isn't just as easy as using utf-8, unfortunately not everybody's source encoding is utf-8. Basically WebError needs to determine the actual source encoding used (there's a patch in the ticket for that), and use that to generate a displayable version. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: I18n doesn't work outside Pylons Controller
On Mar 31, 2008, at 12:48 AM, Olli Wang wrote: Thanks, Dalius. It works. But I happened into another encoding issue: global_test = lazy_gettext(_('Global Test')) class HelloController(BaseController): def test(self): return str(global_test) # Works fine, returns the translated string def test2(self): return unicode(global_test) # It renders the following traceback I've tried many ways to encode the string to unicode but failed. This also causes my mako template down. Any suggestion? Thanks. You want lazy_ugettext -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: An idea for improving @validate
On Jan 29, 2008, at 11:45 AM, Ian Bicking wrote: POST or PUT over a resource automatically invalidates all caches (at least all that see the request), so that is of some benefit. I like PUT insofar as it is clearly symmetric with GET. If there is not a strong symmetry then I don't see any purpose to it. POST /resource/1?_action=PUT doesn't invalidate any caches, and so it's not just rather useless, it's actually counterproductive. That POST would invalidate caches for /resource/1, I thought you just pointed that out in the last paragraph? =] -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: An idea for improving @validate
On Jan 29, 2008, at 10:51 AM, Mike Orr wrote: One problem I've come across is the lack of a delete confirmation form. Ben says you can do it in Javascript before the DELETE executed, but I need something that degrades if users don't have Javascript. It looks like GET /messages/1/delete would nicely fit into that scheme. GETs should not have any side effects. So modifying/deleting a resource should be done via a POST. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Publishing application with avahi
On Mon, 2008-01-28 at 16:23 -0500, Chris AtLee wrote: This kind of works...The problem so far is that when the application is run under paste with the --reload option, the child avahi-publish-service processes don't get killed off when the application is shutdown. When paster restarts the application, the old avahi process is re-parented to the init process. The same problem occurs when running with --daemon. Have you tried using the Avahi Python bindings? I'd expect that to work far better than opening a subprocess. Regards, Cliff Is there a way to get notified when your application is about to be shut down? Paste looks like it just sends SIGTERM to the process when it detects a modified file, but maybe I'm missing something. If Cliff's suggestion doesn't work -- in general, the way to get a callback when python quits is via the atexit module. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Documentation for begginers
On Jan 28, 2008, at 4:46 PM, Mikeroz wrote: About QuickWiki tutorial: in models, _init_.py file i've got: class Page(object): content = None def __str__(self): return self.title def get_wiki_content(self): content = publish_parts(self.content, writer_name=html) [html_body] titles = sets.Set(wikiwords.findall(content)) for title in titles: title_url = h.url_for(controller='page', action='index', title=title) content = content.replace(title, h.link_to(title, title_url)) return content mapper(Page, pages_table) and when I go with paster setup-app development.ini it shows error name Page is not definied. Where could I go wrong? Your mapper line seems to be indented incorrectly (it shouldn't be indented at all). Python most likely gave you its specific line number in the error message. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: simplejson and cjson
On Jan 28, 2008, at 8:00 AM, [EMAIL PROTECTED] wrote: Hello all. Are there any plans of simplejson-to-cjson migration (I mean the @jsonify decorator). Nope, w hat's the advantage of using cjson? simplejson has had a C speed module for a while now, so the original point of cjson being a speed demon in comparison might not be true any longer. I really don't know for sure, though -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: localization when part of the code is in different place than pylons project.
On Jan 28, 2008, at 4:07 AM, Mikael Lepistö wrote: I tried this one already, it seemed to work only if the tookit dir is under the pylons project tree like this: myprojects/pylonsproject/ myprojects/pylonsproject/pylonsproject myprojects/pylonsproject/toolkit situation that I would like is: myprojects/pylonsproject/ myprojects/pylonsproject/pylonsproject myprojects/toolkit Are you saying specifying ../toolkit does not work? If not, that's probably a babel bug. Babel just works on path names. I'd try using it via the command line and seeing if it works that way. To do what you suggested -- extract both projects separately, then merge them later when necessary, I think Babel would need a gnu gettext msgcat-like feature. You might want to log an enhancement ticket on the Babel trac for this. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Mako + Dictionaries = unexpected EOF while parsing
On Dec 29, 2007, at 7:38 PM, Noah Tye wrote: When I try to use a dictionary in a mako template, like this: ${{'x': 'a', 'y': 'b'}['x']} I get a server error like this: SyntaxException: (SyntaxError) unexpected EOF while parsing (line 1) (u{'t': 'a', 'f': 'b') in file 'file location' at line: 22 char: 8 http://www.makotemplates.org/trac/ticket/20 -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: How do you specify a class for link_to links
On Dec 20, 2007, at 8:51 AM, programmer.py wrote: Hi all. I need to be able to set a style for the link I'm generating. I use link_to to generate links. But, you can not use class as a keyword argument :/, so I can't set a style for the generated link. Is there a way to do this that I'm overlooking? This is covered in the FAQ: http://wiki.pylonshq.com/pages/viewpage.action?pageId=9011474 -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Upgrading existing project to newer Pylons
On Dec 13, 2007, at 8:06 AM, Christoph Haas wrote: This is. Although I'd prefer if I could launch vimdiff or kompare during the upgrade. It's pretty good that it exists already anyway. It does no 3-way-diff/merge though. So if you changed something in the files then the paster create upgrade will suggest to throw away your changes unless you carefully include them. :( In the future we would like to do 3 way merging during the upgrade process. We need to store the original paster template somewhere in the project and utilize it later. This would mostly be an addition to PasteScript, anyone up for the task? =] -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: egg-info
On Nov 27, 2007, at 5:00 PM, Mike Orr wrote: Is it necessary to put the egg-info directory in version control? Every time i run python setup.py develop it updates those files, which I have to keep checking in. Are they necessary for a production system given that python setup.py develop seems to recreate them fine if they're missing? The production ini template currently resides in the .egg-info directory, and it needs to be versioned controlled. This is sucky: the template should just reside in the root directory of the project, so folks don't have to worry about revision controlling the egg-info dir. IIRC PasteScript hardcodes the template location there. There's also a paster_plugins.txt in there that can break things if it's not maintained. But this is really a bug (of a different nature) -- the file belongs there, but rerunning setup.py egg_info should recreate it. There's an open ticket about it: http://pylonshq.com/project/pylonshq/ticket/282 -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: egg-info
On Nov 29, 2007, at 3:41 PM, Philip Jenvey wrote: This is sucky: the template should just reside in the root directory of the project, so folks don't have to worry about revision controlling the egg-info dir. IIRC PasteScript hardcodes the template location there. Oh, but of course the problem with having the production template in the root directory is running paster setup-app project on an installed project wouldn't have the template on hand -- it needs to be installed along with the project. Hmm.. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Trying to install on dreamhost - need help
On Nov 24, 2007, at 4:55 PM, walterbyrd wrote: I am using the tutorial found here: http://blog.micampe.it/articles/tag/dreamhost It work until I try to run: python2.4 bin/ez_setup.py That causes this error: [Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/test- easy-install-12226.write-test' This means you're using the system-wide python instead of your virtual-python version. Reread the paragraph prior to the ez_setup.py line: To make the illusion more real, you should then add ~/bin in front of your $PATH, so that you can just type python in the shell and the interpreter used will be your private one instead of the global one. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: [ANN] ToscaWidgets 0.2 Release candidate available
On Nov 21, 2007, at 10:39 AM, Mike Orr wrote: On Nov 21, 2007 6:03 AM, Alberto Valverde [EMAIL PROTECTED] wrote: It's not a ToscaWidgets standalone application but a ToscaWidgets egg. This egg can be the listed in the install_requires of any application that needs it for easier deployment. It is really only useful to create a widget egg if you plan to distribute it or want to reuse it easily in multiple apps, for one-shot widgets you can just declare them inside a module inside your app's package. BTW, I've found PasteScript useful for much more than scaffolding Pylons or TG applications (or widget eggs). In a former job we used it extensively to script the installation, via a web control panel, of PHP applications (among others). I thought the only legitimate use for paster create was to make a WSGI application for paster serve. So here it's just copying an arbitrary egg skeleton to a directory? Sure, it could scaffold anything you want In fact PasteScript comes with a 'basic_package' template which is geared towards a basic python application. I've been using it any time I need to create a normal Python project. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Multiple controller calls
On Nov 21, 2007, at 5:35 AM, Justin wrote: def test(self, var): id = var if int(id) 5: return 'GREATER THAN' else: return 'LESS THAN' You'll run into trouble here if var is '' or contains non-numeric characters. Your default value in the routing rule is novar, which would raise a ValueError exception and ultimately a 500 Internal Server Error. Since we can't trust users to always put numeric values, you should trap the case thus: Yeah, I know. The novar default was left over from passing strings to the page via querystring. Like I said I'm just throwing stuff at the framework right now to kind of feel it out and get a grip on how it handles stuff. Just to rule out the possibility that I did somthing wierd I created a new project, added a new controller (changed nothing, its index action returns 'Hello World', and just add the line to by BaseController to print out the class name and received almost the same result: CtestController TemplateController ErrorController TemplateController ErrorController TemplateController ErrorController TemplateController ErrorController Again, print out the PATH_INFO of the requested URLs and you'll figure out what's being requested from your browser. If you still don't believe me that your browser is making those requests, load live http headers or the like and watch what it's doing. =] Also try hitting the page with a simple HTTP client (curl -O http:// localhost:5000/): you'll see just one request. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Multiple controller calls
On Nov 20, 2007, at 11:05 AM, Justin wrote: Sorry, I got cut off.. Anyway, the order is as follows: 1. my test controller 2. template.TemplateController 3. template.TemplateController 4. error.ErrorController 5. template.TemplateController 6. error.ErrorController 7. error.ErrorController This is for a test view that just returns a simple string to the browser and the page is returned as is should be without error. Is this normal? What is the purpose of all these controller calls? Right now I'm just evaluating pylons but this strikes me as inefficient and obtuse. Pylons is going to construct a Controller and call the specified action once per request. If that controller returns an error HTTP response code, Pylons will route the request to the error page (so you get a pretty 404 or whatever page). Triggering the error page means construction of an ErrorController and a call to its error page action. Assuming you're using the default TemplateController and its accompanying catch-all route, this means your browser is actually hitting TemplateController 3 times. The default TemplateController simply abort()s, hence the ErrorControllers. One of the requests is most likely for the favicon, I don't know about the other one (it probably has to do with the rendered error page). You can see what URL path was requested by printing out request.path_info. -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---