Re: Cannot import tmpl_context
[Mike Orr, 2009-07-07] Also, what is wrong with python 2.6 and pylons? Deprecation warnings and errors occur on the same import. I hesitate to show all the errors here as I read somewhere that 2.6 is not supported in linux. Is this true? The Pylons package in Ubuntu 9.04 (and I guess the Debian equivalent) is useless. The distros upgraded the default Python version but forgot to check Pylons' compatibility with it. Pylons 0.9.7 is compatible with Python 2.6, but it it was released too late to get into the distros. This will be rectified in the next distro releases. python-pylons is not in Ubuntu's main, so nobody cares about this package there, they blindly merge various versions from Debian unstable (while Debian can be in the middle of many transitions). If Debian package is broken (or dependencies are outdated in unstable), please send f*cks to pi...@d.o, though. PS I'm working on backports of python-pylons 0.9.7 (and its dependencies, including mod-wsgi) to Lenny - links will be available on pylons.debian.net -- -=[ Piotr Ożarowski ]=- -=[ http://www.ozarowski.pl ]=- --~--~-~--~~~---~--~~ 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: Cannot import tmpl_context
On Jul 7, 12:43 pm, Mike Orr sluggos...@gmail.com wrote: On Sun, Jul 5, 2009 at 10:51 PM, apocalypznowapocalypz...@gmail.com wrote: I am running python 2.5.2 on a debian based box (mint 5) and I used the package manager to download pylons 0.9.6.1-1. In python shell, when I type: from pylons import tmpl_context I get: ImportError: cannot import name tmpl_context 'tmpl_context' is new in Pylons 0.9.7. It was called 'c' in earlier versions (and still is). Also, what is wrong with python 2.6 and pylons? Deprecation warnings and errors occur on the same import. I hesitate to show all the errors here as I read somewhere that 2.6 is not supported in linux. Is this true? The Pylons package in Ubuntu 9.04 (and I guess the Debian equivalent) is useless. The distros upgraded the default Python version but forgot to check Pylons' compatibility with it. Pylons 0.9.7 is compatible with Python 2.6, but it it was released too late to get into the distros. This will be rectified in the next distro releases. All virtualenvs have an 'activate_this.py' script, which I believe is for cases likemod_wsgithat have problems with regular virtualenvs. Actually, it is recommended that you don't use activate_this.py in mod_wsgi and not necessarily a good idea in mod_python either. This is documented in: http://code.google.com/p/modwsgi/wiki/VirtualEnvironments Using virtual environments with Apache/mod_wsgi isn't that hard and is also explained in that document, so not sure what the issue was. Graham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: How To set up a route with route variables appearing in any order in query string.
Will I need some advanced routes feature such as a 'function condition' to make this happen? Or is there some more obvious (and/or simplified) way (i.e regular expressions?) to accomplish this, which I should be looking at?. On Jul 6, 10:24 am, afrotypa ovuaia...@gmail.com wrote: how do you set up routes to match a url structure with query strings where the route variables can appear in any position in the query string? i.e. which route will match all 3 of these urls and cause the controller/action to be called with var1=1, var2=2, var3=3? /controller/action/?var1=1var2=2var3=3 /controller/action/?var2=2var1=1var3=3 /controller/action/?var3=3var2=2var1=1 --~--~-~--~~~---~--~~ 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 to create drop-down list using pylons
W liście Mike Orr z dnia wtorek 07 lipca 2009: Other country lists would also be welcome. (In latin-1 charset. Doesn't it limit the list to only countries of Western Europe? -- Paweł Stradomski --~--~-~--~~~---~--~~ 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 To set up a route with route variables appearing in any order in query string.
afrotypa, wtorek 07 lipca 2009 13:08: Will I need some advanced routes feature such as a 'function condition' to make this happen? Or is there some more obvious (and/or simplified) way (i.e regular expressions?) to accomplish this, which I should be looking at?. You could access these parameters with default routes using request.GET. .pk. --~--~-~--~~~---~--~~ 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 To set up a route with route variables appearing in any order in query string.
You mean simply use map.connect('/{controller}/{action}') and then call request.params in the action to extract the query variables directly from the request? Perhaps that will work... On Jul 7, 7:53 am, Piotr Kęplicz kepl...@cmc.pl wrote: afrotypa, wtorek 07 lipca 2009 13:08: Will I need some advanced routes feature such as a 'function condition' to make this happen? Or is there some more obvious (and/or simplified) way (i.e regular expressions?) to accomplish this, which I should be looking at?. You could access these parameters with default routes using request.GET. .pk. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
pylons reassigns the built-in map function name to a mapper object in make_map
This is probably not a biggie but in the make_map function (in routing.py), the following line reassigns the variable map to a new Mapper object for defining routes :- map = Mapper(directory=config['pylons.paths']['controllers'], always_scan=config['debug']) This hides the built-in python map function which is unlikely to be used in make_map anyhow. But it will perhaps be safer/clearer to use another name (such as route_map) for this mapper object to avoid any confusion. --~--~-~--~~~---~--~~ 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 To set up a route with route variables appearing in any order in query string.
There isn't a built in feature for that in Routes. But you can use wildcard (*) and then split the wildcard using '/'. By doing this, the wildcard params are stored in array, so that you can sort them however you like to fulfill your requirements. - Didip - On Mon, Jul 6, 2009 at 7:24 AM, afrotypa ovuaia...@gmail.com wrote: how do you set up routes to match a url structure with query strings where the route variables can appear in any position in the query string? i.e. which route will match all 3 of these urls and cause the controller/action to be called with var1=1, var2=2, var3=3? /controller/action/?var1=1var2=2var3=3 /controller/action/?var2=2var1=1var3=3 /controller/action/?var3=3var2=2var1=1 --~--~-~--~~~---~--~~ 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 To set up a route with route variables appearing in any order in query string.
afrotypa, wtorek 07 lipca 2009 15:39: You mean simply use map.connect('/{controller}/{action}') and then call request.params in the action to extract the query variables directly from the request? Exactly, request.params is a multidict with all the QUERY_STRING parameters. .pk. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Mako escaping : trying to correlate config/environment.py and Definitive Guide to PYLONS
If I compare p73 of the PYLONS book section Security considerations and Web Helpers From the book: # Create the Mako TemplateLookup, with the default autoescaping config['pylons.app_globals'].mako_lookup = TemplateLookup( directories=paths['templates'], module_directory=os.path.join(app_conf['cache_dir'], 'templates'), input_encoding='utf-8', output_encoding='utf-8', imports=['from webhelpers.html import escape'], default_filters=['escape']) From my created file: # Create the Mako TemplateLookup, with the default auto-escaping config['pylons.app_globals'].mako_lookup = TemplateLookup( directories=paths['templates'], error_handler=handle_mako_error, module_directory=os.path.join(app_conf['cache_dir'], 'templates'), input_encoding='utf-8', default_filters=['escape'], imports=['from webhelpers.html import escape']) The default_filters is missing from the created file and the error_handler line is missing from the book.Is this an errata on the book or something else I don't understand? Tks, Mark J --~--~-~--~~~---~--~~ 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 to create drop-down list using pylons
On Tue, Jul 7, 2009 at 4:49 AM, Paweł Stradomskipstradom...@gmail.com wrote: W liście Mike Orr z dnia wtorek 07 lipca 2009: Other country lists would also be welcome. (In latin-1 charset. Doesn't it limit the list to only countries of Western Europe? The module contains string literals pasted from websites that use latin-1. We need to keep the original format so that we can update the data in one step. The module serves the large need for address forms in English-speaking countries. Perhaps separate modules could be used for other charsets. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Mako escaping : trying to correlate config/environment.py and Definitive Guide to PYLONS
apologies! couldn't see the wood or the trees. As usual, after posting it all becomes clearer. I can now see the default_filters is just in a different place in my file, on the second last line. just the output_encoding and error_handling is different. Tks, Mark J On Jul 7, 6:05 pm, markj m...@majames.com wrote: If I compare p73 of the PYLONS book section Security considerations and Web Helpers From the book: # Create the Mako TemplateLookup, with the default autoescaping config['pylons.app_globals'].mako_lookup = TemplateLookup( directories=paths['templates'], module_directory=os.path.join(app_conf['cache_dir'], 'templates'), input_encoding='utf-8', output_encoding='utf-8', imports=['from webhelpers.html import escape'], default_filters=['escape']) From my created file: # Create the Mako TemplateLookup, with the default auto-escaping config['pylons.app_globals'].mako_lookup = TemplateLookup( directories=paths['templates'], error_handler=handle_mako_error, module_directory=os.path.join(app_conf['cache_dir'], 'templates'), input_encoding='utf-8', default_filters=['escape'], imports=['from webhelpers.html import escape']) The default_filters is missing from the created file and the error_handler line is missing from the book.Is this an errata on the book or something else I don't understand? Tks, Mark J --~--~-~--~~~---~--~~ 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 To set up a route with route variables appearing in any order in query string.
Thanks!. On Jul 7, 11:26 am, Didip Kerabat did...@gmail.com wrote: There isn't a built in feature for that in Routes. But you can use wildcard (*) and then split the wildcard using '/'. By doing this, the wildcard params are stored in array, so that you can sort them however you like to fulfill your requirements. - Didip - On Mon, Jul 6, 2009 at 7:24 AM, afrotypa ovuaia...@gmail.com wrote: how do you set up routes to match a url structure with query strings where the route variables can appear in any position in the query string? i.e. which route will match all 3 of these urls and cause the controller/action to be called with var1=1, var2=2, var3=3? /controller/action/?var1=1var2=2var3=3 /controller/action/?var2=2var1=1var3=3 /controller/action/?var3=3var2=2var1=1 --~--~-~--~~~---~--~~ 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 reassigns the built-in map function name to a mapper object in make_map
Yeah, that's generally considered bad form. I'm attaching a hg patch to make the template change. (Cc'ing pylons-devel). On Tue, Jul 7, 2009 at 6:55 AM, afrotypaovuaia...@gmail.com wrote: This is probably not a biggie but in the make_map function (in routing.py), the following line reassigns the variable map to a new Mapper object for defining routes :- map = Mapper(directory=config['pylons.paths']['controllers'], always_scan=config['debug']) This hides the built-in python map function which is unlikely to be used in make_map anyhow. But it will perhaps be safer/clearer to use another name (such as route_map) for this mapper object to avoid any confusion. -- Kyle. www.kylev.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~--- # HG changeset patch # User Kyle VanderBeek ky...@kylev.com # Date 1246993332 25200 # Branch 0.9.7.x # Node ID 3a1e82e6e5d44da3efe7197247cda184ac11 # Parent 87b5793aa41e07542baa62f4d723bd7d50022d2e Avoid potential namespace confusion with the built-in python map function by renaming the variable to route_map. diff -r 87b5793aa41e -r 3a1e82e6 pylons/templates/minimal_project/+package+/routing.py_tmpl --- a/pylons/templates/minimal_project/+package+/routing.py_tmpl Mon Jun 29 17:13:04 2009 -0700 +++ b/pylons/templates/minimal_project/+package+/routing.py_tmpl Tue Jul 07 12:02:12 2009 -0700 @@ -9,12 +9,12 @@ def make_map(): Create, configure and return the routes Mapper -map = Mapper(directory=config['pylons.paths']['controllers'], - always_scan=config['debug']) -map.minimization = False +route_map = Mapper(directory=config['pylons.paths']['controllers'], + always_scan=config['debug']) +route_map.minimization = False # CUSTOM ROUTES HERE -map.connect('/{controller}/{action}') -map.connect('/{controller}/{action}/{id}') -return map +route_map.connect('/{controller}/{action}') +route_map.connect('/{controller}/{action}/{id}') +return route_map
Re: pylons reassigns the built-in map function name to a mapper object in make_map
As a contrary view, 'map' is a logical name for it. Many people have a variable 'file', which also shadows a builtin. 'route_map' is oververbose, especially with long arguments. 'rmap' might be OK. --Mike On Tue, Jul 7, 2009 at 12:09 PM, Kyle VanderBeekvanderb...@gmail.com wrote: Yeah, that's generally considered bad form. I'm attaching a hg patch to make the template change. (Cc'ing pylons-devel). On Tue, Jul 7, 2009 at 6:55 AM, afrotypaovuaia...@gmail.com wrote: This is probably not a biggie but in the make_map function (in routing.py), the following line reassigns the variable map to a new Mapper object for defining routes :- map = Mapper(directory=config['pylons.paths']['controllers'], always_scan=config['debug']) This hides the built-in python map function which is unlikely to be used in make_map anyhow. But it will perhaps be safer/clearer to use another name (such as route_map) for this mapper object to avoid any confusion. -- Kyle. www.kylev.com -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: How To set up a route with route variables appearing in any order in query string.
On Mon, Jul 6, 2009 at 7:24 AM, afrotypaovuaia...@gmail.com wrote: how do you set up routes to match a url structure with query strings where the route variables can appear in any position in the query string? i.e. which route will match all 3 of these urls and cause the controller/action to be called with var1=1, var2=2, var3=3? /controller/action/?var1=1var2=2var3=3 /controller/action/?var2=2var1=1var3=3 /controller/action/?var3=3var2=2var1=1 Routes does not look at the query string, only the URL path. There is no way to pass query parameters as action arguments. Well, you could theoretically set a callback function map.connect(..., condition={'function': MY_FUNC}), and it could parse the query string and stuff the variables into the match dict. But I don't know if webob is set up at that point so you'd have to do it manually. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: pylons reassigns the built-in map function name to a mapper object in make_map
On Tue, Jul 7, 2009 at 1:09 PM, Mike Orrsluggos...@gmail.com wrote: As a contrary view, 'map' is a logical name for it. Many people have a variable 'file', which also shadows a builtin. 'route_map' is oververbose, especially with long arguments. 'rmap' might be OK. Just because people get away with doing a dangerous thing doesn't make it an argument in favor of doing it. As almost anyone's father would opine, Just because others are jumping off a cliff doesn't mean you should go do it too. That built-ins are not reserved words is a matter of design pragmatism in Python (keeping the grammar small) more than anything else. Leaving those names alone should be a matter of shared convention among coders to avoid confusion. As for saving a couple characters when typing, I generally find that to be fruitless and non-pythonic (otherwise we should save typing by renaming the whole project pylns with the libraries ctrlrs, db, and tmplt). Since this is template code, it ought ought to exemplify good style; that includes unambiguous, non-abbreviated variable names. -- Kyle. www.kylev.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Speed of HTTP uploading
With stuff like this, you'll definitely get a productivity increase by using nginx/lighttpd in front of Pylons -- the server on front can be configured to pull in the entire file from the client caching before passing off to nginx. Something that I would bring up though - is what are you doing with these files ? And have you been able to test your code to see if the bottleneck is elsewhere ? I can see a few issues causing this: - KeepAlive / Persistent connection settings - are you doing an http open/close for every file ? that will slow stuff down - disk io - lots of little files use more resources than fewer little files. your applications design/architecture might be running into issues because of this. --~--~-~--~~~---~--~~ 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 reassigns the built-in map function name to a mapper object in make_map
On Jul 7, 2:28 pm, Kyle VanderBeek vanderb...@gmail.com wrote: On Tue, Jul 7, 2009 at 1:09 PM, Mike Orrsluggos...@gmail.com wrote: As a contrary view, 'map' is a logical name for it. Many people have a variable 'file', which also shadows a builtin. 'route_map' is oververbose, especially with long arguments. 'rmap' might be OK. Just because people get away with doing a dangerous thing doesn't make it an argument in favor of doing it. As almost anyone's father would opine, Just because others are jumping off a cliff doesn't mean you should go do it too. That built-ins are not reserved words is a matter of design pragmatism in Python (keeping the grammar small) more than anything else. Leaving those names alone should be a matter of shared convention among coders to avoid confusion. I don't agree that this is dangerous. I don't even think it's a slightly big deal. Sometimes `map` As for saving a couple characters when typing, I generally find that to be fruitless and non-pythonic (otherwise we should save typing by renaming the whole project pylns with the libraries ctrlrs, db, and tmplt). Since this is template code, it ought ought to exemplify good style; that includes unambiguous, non-abbreviated variable names. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Webfaction
Has anyone put a pylons application on webfaction. Did you use their pylons install or did you use virtualenv. Any step step by step directions would be appreciated. Thanks, Clemens Herschel --~--~-~--~~~---~--~~ 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 reassigns the built-in map function name to a mapper object in make_map
On Jul 7, 2:28 pm, Kyle VanderBeek vanderb...@gmail.com wrote: On Tue, Jul 7, 2009 at 1:09 PM, Mike Orrsluggos...@gmail.com wrote: As a contrary view, 'map' is a logical name for it. Many people have a variable 'file', which also shadows a builtin. 'route_map' is oververbose, especially with long arguments. 'rmap' might be OK. Just because people get away with doing a dangerous thing doesn't make it an argument in favor of doing it. As almost anyone's father would opine, Just because others are jumping off a cliff doesn't mean you should go do it too. That built-ins are not reserved words is a matter of design pragmatism in Python (keeping the grammar small) more than anything else. Leaving those names alone should be a matter of shared convention among coders to avoid confusion. [Hit Send accidentally last time] I don't agree that this is dangerous. I don't even think it's a slightly big deal. Sometimes `map` is the best name for a var; sometimes `id` is. I rarely (never?) use those built-ins, and I'd rather use the most appropriate (and not overly-verbose name) in a local scope than worry about a name clash, which is unlikely and can be easily worked around in those rare cases where it's an issue. As for saving a couple characters when typing, I generally find that to be fruitless and non-pythonic (otherwise we should save typing by renaming the whole project pylns with the libraries ctrlrs, db, and tmplt). Since this is template code, it ought ought to exemplify good style; that includes unambiguous, non-abbreviated variable names. Cutting vowels is a bit different from using a shorter name in a given scope where the meaning is clear (i.e., I don't think `route_map` conveys more meaning than `map`). And there are plenty of (possibly domain-specific) cases where an abbreviation or acronym is appropriate. I bet you use `i` as a loop counter. I use well-known acronyms like `db`, `exc`, and `wkt` (well known text). In my `make_map` function I use `mc` for `map.connect` and `mr` for `map.resource`. --~--~-~--~~~---~--~~ 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 reassigns the built-in map function name to a mapper object in make_map
On Tue, Jul 7, 2009 at 3:44 PM, Wyatt Baldwinwyatt.lee.bald...@gmail.com wrote: On Jul 7, 2:28 pm, Kyle VanderBeek vanderb...@gmail.com wrote: On Tue, Jul 7, 2009 at 1:09 PM, Mike Orrsluggos...@gmail.com wrote: As a contrary view, 'map' is a logical name for it. Many people have a variable 'file', which also shadows a builtin. 'route_map' is oververbose, especially with long arguments. 'rmap' might be OK. Just because people get away with doing a dangerous thing doesn't make it an argument in favor of doing it. As almost anyone's father would opine, Just because others are jumping off a cliff doesn't mean you should go do it too. That built-ins are not reserved words is a matter of design pragmatism in Python (keeping the grammar small) more than anything else. Leaving those names alone should be a matter of shared convention among coders to avoid confusion. [Hit Send accidentally last time] I don't agree that this is dangerous. I don't even think it's a slightly big deal. Sometimes `map` is the best name for a var; sometimes `id` is. I rarely (never?) use those built-ins, and I'd rather use the most appropriate (and not overly-verbose name) in a local scope than worry about a name clash, which is unlikely and can be easily worked around in those rare cases where it's an issue. I don't want to get into a bikeshed argument over changing one local variable from three letters to nine. I just want to point out that there is opposition to the change, and that the status quo should get the benefit of the doubt. 'id' is another good point. This is way too useful and universal to disrupt just for purity. If you want purity, see Java, where the compiler forces you to. -- Mike Orr sluggos...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: pylons reassigns the built-in map function name to a mapper object in make_map
On Jul 7, 4:23 pm, Mike Orr sluggos...@gmail.com wrote: I don't want to get into a bikeshed argument over changing one local variable from three letters to nine. I just want to point out that there is opposition to the change, and that the status quo should get the benefit of the doubt. I don't want to make a big deal out of it either. My only argument is that the status quo in this case may cause a problem for someone using the template that spits out routing.py in a new project. If they actually do want to use map() later on as they develop their make_map (), they're going to get a potentially confusing exception that routes.base.Mapping doesn't implement __call__(). If we want to improve Pylons and help people have success with it, side stepping such confusion is arguably a Good Thing (TM), especially since it is just template code and doesn't cause any interface/compatibility problems. As for the length, yes, I actually do use variables like that all the time. My code reads like English, and the people who maintain it love that. :-) --~--~-~--~~~---~--~~ 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: superwiki?
2009/7/7 Mike Orr sluggos...@gmail.com On Mon, Jul 6, 2009 at 8:23 PM, 오현성chamda...@gmail.com wrote: Hi there, I notice on the pylons wiki that mention is made of possible interest in a full-featured superwiki. Is such a project underway? I've been trying to extend the SimpleSite project into a more complete wiki, but I haven't got particularly far yet. I'd be interested to hear if there are other projects underway, rather than reinventing the wheel yet again. I haven't heard of any other projects besides those listed on the page. Thanks for your reply. I'll see how I get on with gradually adding features from MoinMoin, but it may be a while before I produce anything close to a fully functional wiki. Richard --~--~-~--~~~---~--~~ 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: Webfaction
On Jul 7, 3:33 pm, clemensherschel hersc...@panix.com wrote: Has anyone put a pylons application on webfaction. Did you use their pylons install or did you use virtualenv. Any step step by step directions would be appreciated. I'd use a virtualenv and a custom port app. --~--~-~--~~~---~--~~ 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 reassigns the built-in map function name to a mapper object in make_map
On Jul 7, 4:56 pm, Kyle VanderBeek vanderb...@gmail.com wrote: On Jul 7, 4:23 pm, Mike Orr sluggos...@gmail.com wrote: I don't want to get into a bikeshed argument over changing one local variable from three letters to nine. I just want to point out that there is opposition to the change, and that the status quo should get the benefit of the doubt. I don't want to make a big deal out of it either. My only argument is that the status quo in this case may cause a problem for someone using the template that spits out routing.py in a new project. If they actually do want to use map() later on as they develop their make_map (), they're going to get a potentially confusing exception that routes.base.Mapping doesn't implement __call__(). If we want to improve Pylons and help people have success with it, side stepping such confusion is arguably a Good Thing (TM), especially since it is just template code and doesn't cause any interface/compatibility problems. I agree to a certain extent, but someone that doesn't know `map` is a built-in will probably get bit by that eventually anyway, beside the fact that they SHOULD be using list comprehensions. ;) If I had to vote on a change to `route_map`, I'd vote +0. As for the length, yes, I actually do use variables like that all the time. My code reads like English, and the people who maintain it love that. :-) I agree with this sentiment, too, but there is an argument to be made for reducing verbosity if doing so doesn't impact understanding too much. It's possible to be overwhelmed by LOC, and single logical lines of code spread over multiple lines are harder to read (and there's that whole pesky question of how to best format such lines, leading to further bike shed discussions...) I say we add a class called Kernel and shove all the built-ins into it. You know, so it'll be all object-oriented and stuff. --~--~-~--~~~---~--~~ 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: Webfaction
Has anyone put a pylons application on webfaction. Did you use their pylons install or did you use virtualenv. Any step step by step directions would be appreciated. I used the built-in install, then upgraded it using easy_install. --~--~-~--~~~---~--~~ 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: Paster Shell stopped working
Hello Alll. If it would be helpful to anyone, the following patch made everything work: --- a/pylons/commands.pyTue May 12 19:02:50 2009 -0700 +++ b/pylons/commands.pyWed Jul 08 11:51:36 2009 +0700 @@ -481,7 +481,7 @@ if can_import(helpers_module): locs['h'] = sys.modules[helpers_module] -exec ('from pylons import app_globals, c, config, g, request, ' +exec ('from pylons import app_globals, config, request, ' 'response, session, tmpl_context, url') in locs exec ('from pylons.controllers.util import abort, redirect_to') in locs exec 'from pylons.i18n import _, ungettext, N_' in locs For some reason, commands seemed to import c and g from pylons, though there were no such globals defined. Regards, George Fatkin. On Jun 27, 2:08 am, GogiJan george.fat...@gmail.com wrote: After installing dev pylons version, paster shell stopped working for all pylons projects (including newly created). $paster shell test.ini Traceback (most recent call last): File /usr/bin/paster, line 8, in module load_entry_point('PasteScript==1.7.3', 'console_scripts', 'paster') () File /usr/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg/ paste/script/command.py, line 84, in run invoke(command, command_name, options, args[1:]) File /usr/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg/ paste/script/command.py, line 123, in invoke exit_code = runner.run(args) File /usr/lib/python2.5/site-packages/PasteScript-1.7.3-py2.5.egg/ paste/script/command.py, line 218, in run result = self.command() File /home/george/work/opros/pylons/hg/P/Pylons/pylons/ commands.py, line 485, in command 'response, session, tmpl_context, url') in locs File string, line 1, in module ImportError: cannot import name c --~--~-~--~~~---~--~~ 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: superwiki?
Hi Richard, 2009/7/8 오현성 chamda...@gmail.com: Thanks for your reply. I'll see how I get on with gradually adding features from MoinMoin, but it may be a while before I produce anything close to a fully functional wiki. I've got some code that does the basics of a MediaWiki-like syntax, you're welcome to use it if you want. You can get it from here: http://openpm-org.svn.sourceforge.net/viewvc/openpm-org/trunk/projecthq/lib/wiki.py?view=markup -- Raoul Snyman B.Tech Information Technology (Software Engineering) E-Mail: raoul.sny...@gmail.com Web: http://www.saturnlaboratories.co.za/ Blog: http://blog.saturnlaboratories.co.za/ Mobile: 082 550 3754 Registered Linux User #333298 (http://counter.li.org) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---