Re: Trouble with Routes
Ben Bangert [EMAIL PROTECTED] writes: On Aug 24, 2007, at 2:56 AM, Dan Korostelev wrote: Yeah, I also worked around the problem this way, but I don't like it. Looks like there's a bug in Routes. Thanks for information. There's no bug in routes, this is exactly how it works, and how the docs indicate it works. (...) The route name does *not* mean that the route its at will actually be the path generated. It means that the default args you give for that route will be pulled in as if you had specified them in the url_for. OK, so it is a bug by design. Take a look at the original example, and spend a minute thinking whether the routes behaviour in this case is what would one expect. And ... so how should be this very case solved? --~--~-~--~~~---~--~~ 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: using paste.debug.profile
On 8/27/07, Ian Bicking [EMAIL PROTECTED] wrote: Pekka Jääskeläinen wrote: I don't know what I did differently, but this time the server didn't exit, but I got this: Ah... it looks it's because Pylons introspects the signature to figure out what parameters to pass, and the signature of the decorated function is *args, **kw. But then it passes all those arguments to the enclosed function, and that breaks it. That fixed it. Thanks. Too bad the profile didn't help in my optimization case: it says rendering the page takes about 0.4 secs wall clock time total, but from the browser it feels like several seconds. Probably the .js files are not cached correctly or something. Should I add a ticket for a wish not needing to add the **kw to the action method or create a receipe to the wiki (if this cannot be fixed easily)? Is this supported at all: Anyways, do you know how to enable the profiling middleware for all controllers (in the config file)? -- --PJ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Too many database connections.
Hello. I have pylons 0.96 (SVN) and current SQLAlchemy, and I have bug that doesn't exist earlier. My connection code: code import sqlalchemy.mods.threadlocal from sqlalchemy import DynamicMetaData, objectstore metadata = DynamicMetaData( case_sensitive = False ) def db_connect( dsn ): engine = create_engine( dsn, echo=False, echo_pool=False, encoding='latin2', convert_unicode=True, pool_recycle=3600, pool_timeout=15, pool_size=5 ) metadata.connect( engine ) /code command netstat -an|grep 5432|grep ESTABLISHED|wc -l displays one more connection after each refresh of page until I have exceptions such as: sqlalchemy.exceptions.DBAPIError: (Connection failed) (OperationalError) FATAL: sorry, too many clients already --~--~-~--~~~---~--~~ 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: Too many database connections.
2007/8/27, caffecoder [EMAIL PROTECTED]: sqlalchemy.exceptions.DBAPIError: (Connection failed) (OperationalError) FATAL: sorry, too many clients already Check your database's settings. It seems that you have set very low connection limit. Best regards Cezary Statkiewicz -- Cezary Statkiewicz - http://thelirium.net rlu#280280 gg#5223219 jabber://[EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: Too many database connections.
Aww.. I've read your email once again. My suggestion was not appropriate:) Sorry, Cezary Statkiewicz -- Cezary Statkiewicz - http://thelirium.net rlu#280280 gg#5223219 jabber://[EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
i18n, FormEncode, Genshi
Hi! Being fairly new to Pylons, I'm working on an Pylons-based (0.9.6rc3) website that utilizes Genshi, Babel, ToscaWidgets and FormEncode. So far everything is working fine except for the translations. I was able to extract and compile language catalogs as described in http://wiki.pylonshq.com/display/pylonsdocs/Internationalization+and+Localization . Problem #1: FormEncode's error messages are not translated at all. What are the required steps? Problem #2: Although all strings are correctly extracted from my Genshi templates, the strings aren't translated in the rendered output. Do I somehow have to apply the genshi.filters.i18n.Translator filter manually (if so, what would be the easiest way?) or am I missing something else? I've been searching all related documentation and lists/groups for hours without success. Maybe anyone can give some hints? Apart from these issues I'm really impressed how Pylons encourages writing clean and readable code without sacrificing flexibility at all. Thank you, Daniel Haus --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
unit tests with Windows
Hi, according to the docs (http://wiki.pylonshq.com/display/pylonsdocs/Unit +Testing) paste.fixture is currently incompatible with Windows. Is there an alternative recommended way for tests? What are the issues with Windows? If procurable I'd be happy to help fixing the problem(s). Best regards, /ch --~--~-~--~~~---~--~~ 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, FormEncode, Genshi
On Aug 27, 2007, at 3:14 PM, Daniel Haus wrote: Hi! Being fairly new to Pylons, I'm working on an Pylons-based (0.9.6rc3) website that utilizes Genshi, Babel, ToscaWidgets and FormEncode. So far everything is working fine except for the translations. I was able to extract and compile language catalogs as described in http://wiki.pylonshq.com/display/pylonsdocs/Internationalization+and +Localization . Problem #1: FormEncode's error messages are not translated at all. What are the required steps? You can use the new state argument to pylons' validate decorator (in trunk only since r2347) and set its _ attribute: from pylons.i18n import _ from pylons.decorators import validate class State: _ = _ class AController(BaseController): @validate(state=State(), ...) def my_meth(self): ... If you're using ToscaWidgets, its validate decorator (in toscawidgets.mods.pylonshf) accepts a state_factory argument with similar semantics to Pylons' state but accepts a callable instead that returns the state: from toscawidgets.mods.pylonshf import validate class AController(BaseController): @validate(state_factory= lambda: State(), ...) def my_meth(self) ... You'll then have to add FormEncode's messages to your app's message catalog, compile it, etc... and that should do it. BTW, I'd love to hear of a way to configure Pylons's _ function to use the message catalog inside FormEncode's egg instead of copying it inside my app's catalog, is there any? HTH, Alberto --~--~-~--~~~---~--~~ 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: Trouble with Routes
On Aug 27, 2007, at 2:27 AM, Marcin Kasperski wrote: OK, so it is a bug by design. Take a look at the original example, and spend a minute thinking whether the routes behaviour in this case is what would one expect. And ... so how should be this very case solved? It's not a bug by design, please read the docs as there's a misunderstanding about what naming your route does. If you assume the named route does something that the docs say it doesn't do, then sure, its a bug. But why would you assume (and expect) that named routes do something that none of the docs say they do? Harnassing the fact that named routes load the defaults, and Routes will always attempt to use a route that uses all the defaults and arguments, here's how to handle the original example: from routes import * m = Mapper() m.connect('gallery_thumb', 'images/gallery/:(image_id)_: (image_size).jpg', image_size='thumbnail') m.connect('gallery', 'images/gallery/:(image_id).jpg') url_for('gallery_thumb', image_id=1) '/images/gallery/1_thumbnail.jpg' url_for('gallery', image_id=1) '/images/gallery/1.jpg' Routes loads the 'image_size' argument from the named route, which the first route requires (because there is a static part, the '.jpg' at the end). This ensures that using 'gallery' will go to the second one as there is no image_size argument provided which it needs. Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: using paste.debug.profile
On Aug 27, 2007, at 2:37 AM, Pekka Jääskeläinen wrote: That fixed it. Thanks. Too bad the profile didn't help in my optimization case: it says rendering the page takes about 0.4 secs wall clock time total, but from the browser it feels like several seconds. Probably the .js files are not cached correctly or something. I'd highly suggest taking a look at Yahoo's ySlow Firefox extension which can rank several important factors that affect how long the browser takes to fully load a page. Javascript should be loaded at the bottom of your page whenever possible as they'll block the browser from downloading images and other page components. Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: i18n, FormEncode, Genshi
On Aug 27, 2007, at 8:36 AM, Alberto Valverde wrote: You'll then have to add FormEncode's messages to your app's message catalog, compile it, etc... and that should do it. BTW, I'd love to hear of a way to configure Pylons's _ function to use the message catalog inside FormEncode's egg instead of copying it inside my app's catalog, is there any? I'm thinking there should be an option, that when 'on', will pass the State class into @validate for you. I'm also curious about whether there's some way to collect the message catalogs used in packages by your app. Maybe that's a Babel thing, that it could look at your dependency tree and find message catalogs to consolidate for you? Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: using paste.debug.profile
On 8/27/07, Ben Bangert [EMAIL PROTECTED] wrote: I'd highly suggest taking a look at Yahoo's ySlow Firefox extension which can rank several important factors that affect how long the browser takes to fully load a page. Javascript should be loaded at the bottom of your page whenever possible as they'll block the browser from downloading images and other page components. Looks like an excellent tool. I'll take a look. Thanks a lot. -- --PJ --~--~-~--~~~---~--~~ 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: Trouble with Routes
m.connect('gallery_thumb', 'images/gallery/:(image_id)_:(image_size).jpg', image_size='thumbnail') m.connect('gallery', 'images/gallery/:(image_id).jpg') Well, that's generally the same trick as discussed earlier as a workaround - forcing parameter difference (here - extra param). I do not understand why named routes works the way you describe. Does there exist any case when one wants to specify the named route while calling url_for and then have url generated by another route??? Thanks for the explanation, nevertheless, while I do not understand why it is implemented as it is, I at least understand what is happening. If the logic is to stay, I would suggest adding some more docs about it, it is really confusing for somebody new to Routes. (in general, Routes Manual would probably benefit from separate section about 'url_for', currently the manual is oriented more towards routes resolution) --~--~-~--~~~---~--~~ 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: using paste.debug.profile
On 8/27/07, Pekka Jääskeläinen [EMAIL PROTECTED] wrote: On 8/27/07, Ben Bangert [EMAIL PROTECTED] wrote: I'd highly suggest taking a look at Yahoo's ySlow Firefox extension which can rank several important factors that affect how long the browser takes to fully load a page. Javascript should be loaded at the bottom of your page whenever possible as they'll block the browser from downloading images and other page components. Looks like an excellent tool. I'll take a look. Yes. Excellent tool indeed. It revealed a problem with cache headers (I've discussed this on IRC with nick 'visit0r'): The tool says: These components do not have a far future Expires header: http://localhost:5000/style/movietron_original.css - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:11 GMT Content-Type: text/css Accept-Ranges: bytes Last-Modified: Wed, 22 Aug 2007 16:28:10 GMT Etag: 1187800090.0-12360 Content-Range: 0-12359/12360 Content-Length: 12360 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_1') (no expires) http://localhost:5000/img/header1.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:11 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Mon, 02 Jul 2007 18:00:20 GMT Etag: 1183399220.0-10983 Content-Range: 0-10982/10983 Content-Length: 10983 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_2') (no expires) http://localhost:5000/img/header1b.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:11 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Mon, 02 Jul 2007 18:00:20 GMT Etag: 1183399220.0-4850 Content-Range: 0-4849/4850 Content-Length: 4850 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_3') (no expires) http://localhost:5000/img/menu2.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:11 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Mon, 02 Jul 2007 18:00:20 GMT Etag: 1183399220.0-460 Content-Range: 0-459/460 Content-Length: 460 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_4') (no expires) http://localhost:5000/img/header1c.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:11 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Thu, 05 Jul 2007 10:56:57 GMT Etag: 1183633017.0-861 Content-Range: 0-860/861 Content-Length: 861 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_5') (no expires) http://localhost:5000/img/feed-icon-24x24.png - ParamsHeadersPost Response Headers Content-Type: image/png Accept-Ranges: bytes Last-Modified: Thu, 22 Dec 2005 20:14:26 GMT Etag: 1135282466.0-1090 Content-Range: 0-1089/1090 Content-Length: 1090 Date: Mon, 27 Aug 2007 16:26:11 GMT Server: PasteWSGIServer/0.5 Python/2.5.1 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_6') (no expires) http://localhost:5000/img/prev_disabled.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:11 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Fri, 03 Aug 2007 01:00:43 GMT Etag: 1186102843.0-1289 Content-Range: 0-1288/1289 Content-Length: 1289 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_7') (no expires) http://localhost:5000/img/next.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:12 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Fri, 03 Aug 2007 00:18:52 GMT Etag: 1186100332.0-1334 Content-Range: 0-1333/1334 Content-Length: 1334 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_8') (no expires) http://localhost:5000/img/header2.gif - ParamsHeadersPost Response Headers Server: PasteWSGIServer/0.5 Python/2.5.1 Date: Mon, 27 Aug 2007 16:26:12 GMT Content-Type: image/gif Accept-Ranges: bytes Last-Modified: Mon, 02 Jul 2007 18:00:20 GMT Etag: 1183399220.0-650 Content-Range: 0-649/650 Content-Length: 650 Loading... - javascript:document.yslowContext.viewHeaders('headerExpiresDiv_9') (no expires)
Re: using paste.debug.profile
On Aug 27, 2007, at 9:32 AM, Pekka Jääskeläinen wrote: It revealed a problem with cache headers (I've discussed this on IRC with nick 'visit0r'): So, it seems the static contents in 'public' do not have cache headers by default set like they should. This is with Pylons 0.9.6rc3 (upgraded rc-by-rc from 0.9.5). That shouldn't actually be a problem as they use ETag's instead. The Yahoo tool is not perfect, and does have a few inconsistencies on some things. Next issue: These components are not gzipped: *displays the css* here How do I use the gzipper of paster? What should I add to the Pylons conf? That will definitely make an impact on speed to an extent. I'd suggest having your front-end app handle gzipping. I use Apache in front of Paster, which gzip's the images when I add the following (Apache 2): LocationMatch /(style|scripts|trac/js|trac/css).* # Insert filter SetOutputFilter DEFLATE # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary /LocationMatch Otherwise, it seemed the bottleneck was the .js files, like I suspected. Thanks again for pointing this useful tool out. I might collect these optimization tips to a receipe wiki at some point. The most substantial speed boost I got on the PylonsHQ site, was from reducing the CSS from 3 stylesheets to 1 because each CSS load goes one at a time, blocking parallel downloads and anything else until the CSS is done. Moving the JS to the bottom also resulted in noticeable improvement since it loaded just once at the end instead of blocking parallel page component loading. Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: Trouble with Routes
On Aug 27, 2007, at 9:20 AM, Marcin Kasperski wrote: Well, that's generally the same trick as discussed earlier as a workaround - forcing parameter difference (here - extra param). I do not understand why named routes works the way you describe. Does there exist any case when one wants to specify the named route while calling url_for and then have url generated by another route??? If there's a shorter route possible that it might be able to find, it can. However, I am open to adding an option to Routes that lets you declare Named routes force generation with the exact route named. Would anyone want this option? I'd want this a separate option, rather than the default behavior as I wouldn't want to catch anyone using Routes given how it operates now to be utterly surprised when routes might not be generated as they had been expecting. Thanks for the explanation, nevertheless, while I do not understand why it is implemented as it is, I at least understand what is happening. If the logic is to stay, I would suggest adding some more docs about it, it is really confusing for somebody new to Routes. (in general, Routes Manual would probably benefit from separate section about 'url_for', currently the manual is oriented more towards routes resolution) Definitely, I'm working on updating the docs and moving them to the wiki, so its easier to collect comments and feedback. Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: using paste.debug.profile
On 8/27/07, Ben Bangert [EMAIL PROTECTED] wrote: That shouldn't actually be a problem as they use ETag's instead. The Yahoo tool is not perfect, and does have a few inconsistencies on some things. It seems to be not functioning optimally: I tested reloading my front page and looking at the traffic with Live HTTP Headers. It always wanted to reload the images and javascripts. Also the Proxy I use seemed to produce misses for all the files every time. That will definitely make an impact on speed to an extent. I'd suggest having your front-end app handle gzipping. I use Apache in front of Paster, which gzip's the images when I add the following (Apache 2): I don't use a front-end app at the moment. The paste.gzipper is not supported by the Pylons at the moment? The most substantial speed boost I got on the PylonsHQ site, was from reducing the CSS from 3 stylesheets to 1 because each CSS load goes one at a time, blocking parallel downloads and anything else until the CSS is done. Moving the JS to the bottom also resulted in noticeable improvement since it loaded just once at the end instead of blocking parallel page component loading. My problem are the large JS libs I use, from which I need only some simple function for each page. Too bad they are not modularized so I could just pick the functions I really need easily. They could really benefit from gzipping. -- --PJ --~--~-~--~~~---~--~~ 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: Trouble with Routes
On 8/27/07, Ben Bangert [EMAIL PROTECTED] wrote: On Aug 27, 2007, at 9:20 AM, Marcin Kasperski wrote: Well, that's generally the same trick as discussed earlier as a workaround - forcing parameter difference (here - extra param). I do not understand why named routes works the way you describe. Does there exist any case when one wants to specify the named route while calling url_for and then have url generated by another route??? If there's a shorter route possible that it might be able to find, it can. However, I am open to adding an option to Routes that lets you declare Named routes force generation with the exact route named. Would anyone want this option? I'd use it. I've run into this problem twice (and totally forgot how I solved it the first time), and I've had one of my developer colleagues come to me with the same problem as well. We almost exclusively use named routes - I think there's only one place in the two projects we've done with Routes where we don't - and so the current behaviour feels a bit weird. Neil -- Neil Blakey-Milner http://nxsy.org/ [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: unit tests with Windows
On Aug 27, 2007, at 6:27 AM, Clemens Hermann wrote: Hi, according to the docs (http://wiki.pylonshq.com/display/pylonsdocs/ Unit +Testing) paste.fixture is currently incompatible with Windows. Is there an alternative recommended way for tests? What are the issues with Windows? If procurable I'd be happy to help fixing the problem(s). I'm pretty sure this is no longer true, I believe James Gardner fixed the issues with Windows a long time ago. James, is that definitely the case? Can this warning be removed? -- 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: Trouble with Routes
On Aug 27, 2007, at 10:42 AM, Neil Blakey-Milner wrote: I'd use it. I've run into this problem twice (and totally forgot how I solved it the first time), and I've had one of my developer colleagues come to me with the same problem as well. We almost exclusively use named routes - I think there's only one place in the two projects we've done with Routes where we don't - and so the current behaviour feels a bit weird. Okey doke! It's now in the Routes trunk. Just set mapper.hardcode_names = True, and using named routes will restrict URL generation to only the route with the name. Example: from routes import * m = Mapper() m.connect('gallery_thumb', 'images/gallery/:(image_id) _thumbnail.jpg') m.connect('gallery', 'images/gallery/:(image_id).jpg') url_for('gallery_thumb', image_id=1) '/images/gallery/1_thumbnail.jpg' url_for('gallery', image_id=1) '/images/gallery/1_thumbnail.jpg' And the new option: m.hardcode_names = True url_for('gallery_thumb', image_id=1) '/images/gallery/1_thumbnail.jpg' url_for('gallery', image_id=1) '/images/gallery/1.jpg' Routes trunk can be installed with: sudo easy_install Routes==dev Cheers, Ben smime.p7s Description: S/MIME cryptographic signature
Re: Pylons paste monitor switch
I take it that this is a dead issue? On Aug 12, 10:38 am, voltron [EMAIL PROTECTED] wrote: Hi Pylons devs, since a new version is just round the corner, I would like to know if the situation has changed with the -monitor switch. Would it then be possible to modify things like controllers actually restarting the server? Thanks --~--~-~--~~~---~--~~ 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, FormEncode, Genshi
Thank you for your help Alberto, once again. I think Ben is right, there should be a somewhat more elegant solution to this. It would be great to have it all done automatically and out of my controller code, like it works in TG. I will see if I can find a way. Now there's still this Genshi translation-filter issue. The Pylons i18n tutorial does cover message extraction from Genshi, but there are no hints on configuration of that filter, which i think would be necessary. Is this a common problem, or am I missing something obvious? Greetings, Daniel On 27 Aug., 17:58, Ben Bangert [EMAIL PROTECTED] wrote: On Aug 27, 2007, at 8:36 AM, Alberto Valverde wrote: You'll then have to add FormEncode's messages to your app's message catalog, compile it, etc... and that should do it. BTW, I'd love to hear of a way to configure Pylons's _ function to use the message catalog inside FormEncode's egg instead of copying it inside my app's catalog, is there any? I'm thinking there should be an option, that when 'on', will pass the State class into @validate for you. I'm also curious about whether there's some way to collect the message catalogs used in packages by your app. Maybe that's a Babel thing, that it could look at your dependency tree and find message catalogs to consolidate for you? Cheers, Ben smime.p7s 3KHerunterladen --~--~-~--~~~---~--~~ 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 paste monitor switch
On Aug 27, 2007, at 1:21 PM, voltron wrote: I take it that this is a dead issue? On Aug 12, 10:38 am, voltron [EMAIL PROTECTED] wrote: Hi Pylons devs, since a new version is just round the corner, I would like to know if the situation has changed with the -monitor switch. Would it then be possible to modify things like controllers actually restarting the server? The --restart option has always done this. The --monitor (or is it --monitor-restart) option does something else. It restarts the server if it dies. -- 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 paste monitor switch
On Aug 27, 2007, at 3:02 PM, Philip Jenvey wrote: The --restart option has always done this. Er, I meant --reload of course -- 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, FormEncode, Genshi
Hi Alberto, On 8/27/07, Alberto Valverde [EMAIL PROTECTED] wrote: You'll then have to add FormEncode's messages to your app's message catalog, compile it, etc... and that should do it. BTW, I'd love to hear of a way to configure Pylons's _ function to use the message catalog inside FormEncode's egg instead of copying it inside my app's catalog, is there any? I submitted a patch that does roughly this, see http://pylonshq.com/project/pylonshq/ticket/296 Max. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pudge Doc Working?
Hello, I am trying to get Pudge documentation working, and running into some errors. I have tried this, including creating a couple of simple test/empty apps to no avail: http://wiki.pylonshq.com/display/pylonsdocs/Adding+Documentation+to+your+Application I am on Pylons .9.6rc3, buildutils .1.2. I get this error: Error: invalid command 'pudge' Thank You Aaron --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---