Re: [Zope-dev] when did transaction lose the ability to be usable as a context manager?
Chris Withers ch...@simplistix.co.uk wrote: Hi All, I used to do this: import transaction with transaction: ... print 'hello' ... Traceback (most recent call last): File console, line 1, in module AttributeError: __exit__ When did that stop working and what should I now do instead? cheers, Chris You can use pure hackery to work around this: - t.py - def __enter__(*args): print 'enter', args def __exit__(*args): print 'exit', args def fixup(): import sys, types self = sys.modules[__name__] mymod = type(__name__, (types.ModuleType,), globals()) sys.modules[__name__] = mymod(__name__) fixup() -- t1.py --- #!python2.7 import t with t: print transaction and the output is: C:\Tempt1.py enter (module 't' (built-in),) transaction exit (module 't' (built-in), None, None, None) This is hackery though, and watch out for globals as the globals() dict known to the functions in t.py is no longer the same dict visible to modules that import it so changes to one won't be visible in the other and any functions in the module will behave like methods (so you have to give them a 'self' parameter). Much better just to change the code to define an object and import that from the module. ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Installer for Windows (quick question)
Sidnei da Silva [EMAIL PROTECTED] wrote: Since I'm going to be building the installer for Windows I would like to quickly ask if anyone expects multiple Zope installs to live side-by-side. The existing installer atempted that but I don't believe it was very successful. I would like to know if anyone has multiple Zope installations on Windows side-by-side and if they consider that important. Yes and yes. Same as Martin Aspeli's reasons: testing on multiple plone versions. I think the main thing is to be sure that the installation doesn't add any zope specific folders to PythonPath in the registry. The Plone installation for example adds (or added) some folders to PythonPath which meant that multiple plones using the same major python version would try to share parts of the Plone installation. Not adding folders to the pythonpath registry key allows coexistence, and there are more than enough ways to add folders to pythonpath without using the registry. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Re: Re: Re: favicon.ico for 2.10?
Chris Withers wrote: Duncan Booth wrote: What may be more significant is that simply retrieving favicon.ico into IE displays garbage. I don't know why; IE seems perfectly capable of displaying it on the address bar or favourites, but in the main browser window it displays a short curved line and nothing else. Is the method that's returning it setting the right content type? I've tried 3 mime types: application/octet_stream: The icon displays correctly in Firefox and incorrectly in IE, other favicon.ico files I've tried with this mime type display correctly in IE. image/x-icon: The same incorrect display in IE and correct display in FF. image/vnd.microsoft.icon: Still displays correctly in FF, but IE decides to dump it as characters instead of displaying a graphic at all. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Re: Re: favicon.ico for 2.10?
Lennart Regebro wrote: Anu I have added a favicon.ico to trunk. For some reason it doesn't show up in the Bookmark list of Firefox. If this is a caching problem, or something else, I don't know yet. If anybody knows, tell me and I'll fix it, For your viewing pleasure, I attached the big Z gif I used to create the icons, the GIMP file with transparent and non-transparent versions in 16x16, 32x32 and 48x48, and the resulting icon. I checked it on IE and Windows Explorer in all the different sizes I could find and it looks great almost all of the time. Unfortunately in the properties tabs it looks absolutely terrible in IE with a 120dpi display (such as my laptop), but I put that down to IE stupidity. What may be more significant is that simply retrieving favicon.ico into IE displays garbage. I don't know why; IE seems perfectly capable of displaying it on the address bar or favourites, but in the main browser window it displays a short curved line and nothing else. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Re: favicon.ico for 2.10?
Chris McDonough wrote: There's a nice little Mac freeware app named IcoMaker for creating .ico files from GIF files. .ico files are actually containers for various icon sizes and color depths and this app allows you to create an .ico file out of up to six sizes/depths. I stole the favico from zope.org and made one using IcoMaker with a single size/depth (16x16/16colors). It's attached. I haven't tried it in IE. If it doesn't work for whatever reason, maybe someone else who has more icon-foo can do a more thorough job. That one works, at least in those cases where IE is displaying the icon at 16x16. Some higher resolution images in the file would be useful though for situations where it decides to display larger icons, otherwise it looks pretty blocky. So far I've found at least 4 different icon sizes used in IE and one outside. From smallest to largest: address bar and favourites toolbar are smallest (1), the links toolbar uses a larger icon (2), favourite properties has the icon on two tabs in different sizes 'web document' (3) and 'General' (4). And of course IE's favourites are actually just a folder, so you need a suitable icon for Explorer's icon view (5). I haven't measured these, but I would guess the sizes I saw were 16, 24, 32, 48, and 64 pixels. There's an icon maker at http://favicon.ru/en/ which will do 16,32 and 48 pixel images online, but I don't have a decent starting image. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: favicon.ico for 2.10?
Florent Guillaume wrote: kit BLAKE wrote: 2006/4/24, Jens Vagelpohl [EMAIL PROTECTED]: Yeah, that's nice. Does it work as a PNG, though? I was under the impression (and thought the spec requires) that favicons must be *.ico files. A PNG favicon will work in the Mozilla family, but not in IE. kit However I'd be surprised if a .gif didn't work. So far as I can tell, neither .png nor .gif work for favicon.ico in IE. It will display a gif/png named favicon.ico in the browser, but it won't use it as an icon on the address bar/favourites. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] ZEO question.
And now onto the reason I was looking for that list: -WinNT 4.0 -Zope 2.3.1b1 -ZEO 0.4.1 E:\Zope\2.3.1b1python lib/python/ZEO/start.py -p 8000 Traceback (innermost last): File "lib/python/ZEO/start.py", line 315, in ? if __name__=='__main__': main(sys.argv) File "lib/python/ZEO/start.py", line 297, in main signal.signal(signal.SIGHUP, handler) AttributeError: SIGHUP What does that mean and how can I fix it? It means that ZEO isn't compatible with NT. simply comment out line 297 of start.py and it should be fine. Finally, how can I get the storage server to use the Data.fs from my INSTANCE_HOME rather than the SOFTWARE_HOME, which I presume the above does? I think the default is to use INSTANCE_HOME/var/Data.fs so you should be happy. BTW, I have managed to get ZEO running as an NT service complete with Core Session in a mounted BerkeleyDB 3.2 storage. -- Duncan Booth [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZEO question.
> > There is a second line to mess with, something about os.ppid I think. > We should really have these changes made to the source > Yes, you have to change line 310: open(zeo_pid,'w').write("%s %s" % (os.getppid(), os.getpid())) to: open(zeo_pid,'w').write("%s" % (os.getpid())) I have posted a report on the ZEO Tracker for both these changes. -- Duncan Booth [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] BerkeleyStorage with BerkeleyDB 3.2
I wanted to get BerkeleyStorage installed on my Windows system. Since there is a nice downloadable binary version of the Python bindings for version 3.2, I downloaded and installed that, then modified BerkeleyStorage.py to support the new interface instead of the old one. If anyone wants a copy, see http://www.zope.org/Members/Duncan/BerkeleyStorage -- Duncan Booth [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] manage_main select ... / don't work with Mozilla
On 15 Mar 2001, you wrote in local.zope.dev: Matt wrote: select should have a corresponding /select right? In which case no, it should not have a trailing slash. They are only needed for single tags that have no corresponding close, eg br / hr / etc. I agree but in the management interface of Zope it's not the case. You have select ... / Some stuff... /select and you should have select stuff /select. That's the reason why it doesn't work anymore with Mozilla. It just seems to be one place in zope's code. OFS/dtml/main.dtml, line 43 needs the spurious slash removing. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Repeating a piece of HTML code
dtml-in expr="_.range(0, movie_rating)" img SRC="star.gif" height=15 width=15 /dtml-in Replace movie_rating with the variable that represents the movie rating. What about dtml-var "'*' * movie_rating" ? Fine, except that he wants the img tag repeated the appropriate number of times. Try putting the tag into the dtml-var statement and you get something along the lines of (untested): dtml-var "('img src=%sstart.gif%s height=15 width=15' % (_.chr(34), _.chr(34))) * movie_rating" at which point the dtml-in starts to look more appealing. Of course if you rename star.gif as star_gif you could try: dtml-var "start_gif.tag() * movie_rating" which has a certain neatness. -- Duncan Booth [EMAIL PROTECTED] int month(char *p){return(124864/((p[0]+p[1]-p[2]0x1f)+1)%12)["\5\x8\3" "\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure? http://dales.rmplc.co.uk/Duncan ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )