IRC log of #zope3-dev for Wednesday, 2005-06-22

*** niemeyer has quit IRC00:00
*** bradb is now known as bradb-out00:09
*** jinty has quit IRC00:11
*** BjornT has quit IRC00:12
*** dobee has quit IRC00:14
*** timte has quit IRC00:44
*** dhuber has quit IRC01:02
*** bcsaller has quit IRC01:04
*** ignas has joined #zope3-dev01:19
*** J1m has quit IRC01:25
*** hazmat has joined #zope3-dev01:26
*** jhauser_ has quit IRC01:32
*** SureshZ has left #zope3-dev01:33
*** projekt01 has joined #zope3-dev02:36
*** yota has quit IRC02:49
*** RaFromBRC is now known as RaFromBRC|afk03:05
*** d2m has quit IRC03:19
*** stub has joined #zope3-dev03:52
*** RaFromBRC|afk has quit IRC03:53
*** bradb-out is now known as bradb-away04:13
*** projekt01 has quit IRC05:25
*** SureshZ has joined #zope3-dev05:31
*** MiUlEr has joined #zope3-dev06:39
*** SureshZ has left #zope3-dev07:23
*** bskahan has joined #zope3-dev08:06
*** hazmat has quit IRC08:45
*** bskahan has quit IRC08:55
*** timte has joined #zope3-dev09:04
*** d2m has joined #zope3-dev09:16
*** BjornT has joined #zope3-dev09:19
*** SteveA_ has quit IRC09:30
*** guido_g has joined #zope3-dev09:34
*** jhauser has joined #zope3-dev09:44
*** philiKON has quit IRC09:54
*** timte has quit IRC10:07
*** hazmat has joined #zope3-dev10:07
*** yota has joined #zope3-dev10:18
*** tarek has joined #zope3-dev10:34
*** jinty has joined #zope3-dev11:07
*** jhauser_ has joined #zope3-dev11:15
*** lunatik has joined #zope3-dev11:18
*** jhauser has quit IRC11:27
*** sashav has joined #zope3-dev11:28
*** lunatik has left #zope3-dev11:35
*** hdima has joined #zope3-dev11:37
*** mgedmin has joined #zope3-dev11:59
*** philiKON has joined #zope3-dev12:00
hdima'/++etc++process' doesn't work for virtual hosts12:02
hdimaIs it safe to add 'if context is None or ...' at line 50 in 'z.a.traversing.browser.absoluteurl'?12:05
*** MiUlEr has quit IRC12:19
*** jinty has quit IRC12:35
*** SteveA has joined #zope3-dev12:48
*** ignas_ has joined #zope3-dev13:23
*** philiKON has quit IRC13:26
*** mikka__ has joined #zope3-dev13:27
mikka__hello!13:27
mikka__I have little problem with sandbox version of Zope313:28
*** projekt01 has joined #zope3-dev13:29
mikka__I had no problems creating it13:29
mikka__but every change I make to it is not persisted after server reboot13:29
*** SteveA has quit IRC13:44
*** SteveA has joined #zope3-dev13:46
*** Aiste has joined #zope3-dev13:46
*** hazmat has quit IRC14:10
*** JZ_ has joined #zope3-dev14:20
*** bskahan has joined #zope3-dev14:31
*** faassen has joined #zope3-dev14:35
srichtermikka__: what changes do you refer to?14:41
*** JZ_ is now known as JZ14:51
*** mikka__ has quit IRC15:17
srichterhdima: I think that process should not have a location; I am surprised, though, that it works without virtual hosts15:25
srichterI think I agree with your bug fix15:25
srichterso you are good to go15:25
srichtermake sure to write a test as well15:26
srichterthanks!15:26
*** lunatik has joined #zope3-dev15:26
hdimaIt works simple because request.getVirtualHostRoot() returns None15:26
hdimaOk15:26
*** lunatik has left #zope3-dev15:28
*** the|hidden has quit IRC15:36
*** zagy has quit IRC15:36
*** zagy has joined #zope3-dev15:36
*** SteveA has quit IRC15:38
*** SteveA has joined #zope3-dev15:52
*** the|hidden has joined #zope3-dev15:53
*** bradb-away is now known as bradb16:00
*** MiUlEr has joined #zope3-dev16:12
*** SureshZ has joined #zope3-dev16:23
*** bskahan has quit IRC16:25
bob2is there any standard code/idiom out there for writing out File's to disk?16:39
*** tarek has quit IRC16:42
srichterbob2: you have to be more specific16:44
bob2so, I have some classes that inherit from File, and sometimes I need to write them out to disk16:45
bob2(File's containing html, generating some static pages, basically)16:45
bob2so I guess the only mildly hard bit is finding out their path in the zope instance16:45
*** bska|mobile has joined #zope3-dev16:45
srichterwell, I think the var directory is known as a global somewhere16:47
srichteror your container should be a special one that knows the root directory of the files16:47
bob2hm, I mean "virtual path to the object"16:47
srichterwell, what are you trying to do?16:48
bob2I guess I mean the url of the File object16:49
bob2I'm trying to put it at the same point in the filesystem as it appears in the zope object tree16:50
bob2and I know my vocabulary is shot at the moment, my apoligies16:50
srichterwell, then16:52
srichterthe best would be to have a special folder16:52
srichterthat declares the root on the filesystem16:53
bob2hmm16:53
bob2the translation isn't the problem, I'm more trying to find the url to an object, given that object16:54
srichteran object is located in a folder in the ZODB16:57
srichterso it has a definite location16:57
srichterof that object knows about the path of the file in the FS, you have all the info you need16:57
bob2hm, I guess I need to duplicate it when the object is created, then16:58
*** stub has quit IRC16:58
*** bska|mobile has quit IRC16:59
*** bskahan has joined #zope3-dev16:59
*** J1m has joined #zope3-dev17:09
*** sashav has quit IRC17:11
*** lunatik has joined #zope3-dev17:15
*** JZ has quit IRC17:27
*** hdima has quit IRC17:27
bob2hm, which attribute is the "name" of an object stored in?17:31
mgedmin__name__17:31
mgedminsee ILocation17:32
bob2ah, thank you17:32
bob2is there a general method to find where in the hierarchy an interface is?17:34
bob2I usually just google for "IFoo zope3"17:34
J1mgrep17:36
J1mtags17:36
bob2ah, good point17:36
J1mThere is mostly a method to the madness.17:36
J1mSo after you get some experience, you'll probably be able to guess where things are much of the time.17:36
bob2yeah, I'm getting better at guessing where they are17:36
*** lunatik has left #zope3-dev17:39
*** guido_g has quit IRC17:40
*** philiKON has joined #zope3-dev17:53
*** zagy has quit IRC17:56
*** anguenot has joined #zope3-dev18:00
*** MiUlEr has quit IRC18:14
*** MiUlEr has joined #zope3-dev18:16
*** ignas_ has quit IRC18:43
*** d2m has quit IRC18:59
*** regebro has joined #zope3-dev19:07
*** hazmat has joined #zope3-dev19:38
*** ignas_ has joined #zope3-dev19:42
bob2hm, so not all objects have __name__19:43
*** jinty has joined #zope3-dev19:48
*** bskahan has quit IRC19:53
bob2hrm, even ones in containers19:56
bob2where can I read about how objects get names?19:56
projekt01See __setitem__ in SampleContainer19:57
projekt01bob2, all objects where implement or provide the IContained have a __name__ attribute19:58
bob2hmm19:59
projekt01This __name__ get set in the __setitem__ method of a IContainer19:59
bob2the name of the object being added to the container?19:59
projekt01The container is responsible for the items name19:59
bob2hm, right19:59
projekt01Yes19:59
bob2I have a two classes, one derives from File, one from Folder.  in the zope3 web ui, when I add one to the other, the File has a __name__.20:00
bob2but in my unit tests, the File does not have a __name__, even after being added to the container20:00
bob2assuming 'directory["foo"] = file' does what I think, and adds file to the directory container20:01
projekt01Directory['foo'] uses __setitem__ from IContainer20:01
bob2right, so this should work20:02
bob2I'll try using the super classes directly20:02
projekt01You also could write Directory.__setitem__('foo', file)20:02
projekt01If Directory is a object instance20:03
projekt01If Directory is the class you can use:20:03
projekt01Super(Directory, self).__setitem__('foo', file)20:03
bob2ok, this sample program seems to me like it should print out "foo"20:06
bob2from zope.app.file import File20:06
bob2from zope.app.folder import Folder20:06
bob2file = File()20:06
bob2folder = Folder()20:06
bob2folder["foo"] = file20:06
bob2print file.__name__20:06
projekt01No20:07
projekt01Try adding:20:07
projekt01file = folder['foo']20:07
projekt01print file.__name__20:07
projekt01you reference to the file before adding to the container.20:08
bob2hrm, wow20:08
projekt01This doesn't work if you get a LocationProxy around the file from the container20:08
bob2so that uses FileFactory to make me a new file?20:08
bob2or do I need to reference it both ways before I can use it?20:09
projekt01Does the File class implement IContained?20:10
bob2hrm, no20:11
*** MiUlEr has quit IRC20:11
projekt01Does this work for you: print folder["foo"].__name__20:11
bob2yes20:11
projekt01Ok, then if you get the object form the container you get also a LocationProxy arround the object20:12
bob2ah20:13
projekt01this proxy contains the name and not the object itself20:13
bob2hrm, how do I do-proxy it?20:13
projekt01you mean remove proxy?20:14
projekt01or add proxy20:14
bob2er, "de-proxy", remove it20:14
bob2so I get the object back20:14
projekt01from zope.proxy import getProxiedObject20:14
projekt01Sorry I have to go now, I'm back later. Hope that helps a little bit.20:15
bob2it did, thank you very much20:15
bob2is this sort of level of question approriate for the zope3-users or zope3-dev list?20:19
*** neder-zzz is now known as nederhoed20:25
*** hazmat has quit IRC20:27
*** faassen has quit IRC20:27
*** jinty has quit IRC20:29
bob2should I make my classes implement IContained?20:32
nederhoedif you want to restrict what containers, you could implement IContained20:33
bob2ah20:33
nederhoedI think there is something written in Stephan Richter's Zope3 Dev book20:33
bob2but to just be,er, Contained, I don't need to?20:33
bob2hm, I thought so, too, but I can't seem to find it20:34
nederhoedhum, I have to  rethink that20:34
srichterbob2: findinf ifaces: you can also always use the API doctool20:34
bob2oh, of course, I forgot about that20:34
srichterbob2: you should always get an object's name using zapi.getName(object)20:35
bob2ah, IContained is mentioned in the messageboard interface discussion20:35
nederhoedindeed20:36
srichter(not all objects have to directly implement IContained, but only require an adapter to it20:36
srichterall your content objects should implement IContained20:37
srichteror at least ILocation20:37
bob2hrm, using zope.app.zapi.getName tells me that it can't adapt my objects to zope.app.traversing.interfaces.IPhysicallyLocatable20:38
srichterthat's a good rule of thumb, which I have never not used :-)20:38
bob2hm, I guess this is a result of what you just suggested?20:38
srichtermake it an IContained, then add it to a container20:38
srichterit should work20:38
srichteryes20:38
srichteroh yeah, of course it is much easier to just inherit from the Contained class20:39
srichterthis way you don't have to worry about the implementation20:39
bob2hm, yeah, I thoguht inheriting from File would give me all this20:39
srichterwhich File did you inherit?20:40
bob2zope.app.file.file.File20:40
srichtergeez, the zope.app.file.file.File class is really old20:40
bob2ah20:40
srichterit has not been modernized20:40
srichterbut the data code is good of course20:41
bob2is there another simple Contained class I could inherit from?20:41
bob2hrm, why is there zope.app.file.file.File and zope.app.file.File?20:41
J1mNew containers generally subclass BTreeContainer.20:42
bob2I'm more looking for a base "containee" class, this is a leaf node object20:43
srichterbob2: zope.app.file.File is just a link to the other one20:48
srichterit's suppose to make imports shorter20:48
bob2ah20:53
J1mbob2, maybe you want zope.app.container.contained.Contained ;)20:54
bob2ah20:54
J1mDepending what you want to do20:54
J1mwhich is unclear :)20:54
*** jinty has joined #zope3-dev20:55
anguenotHi all. got a question about how to deal with component registration dependencies21:09
anguenotThe example is with the catalog for instance21:09
anguenotit depends of the uidutil21:09
anguenotbut if theis utility is not here I can create my catalog21:10
anguenotbut It will crash as system error if I try to register it21:10
anguenotbecause getUtility() is used within the internals of the catalog component21:10
anguenotwithout traping exceptions21:11
J1mso far so good21:11
anguenotShoud the catalog trap tjhe ComponentLookup exceptions (or use queryUtility()) ? or should simply we *not* allow the creation of the catalog itself ?21:12
anguenotbecause it's useless without the registration of the uidtool anyway21:12
anguenot?21:12
J1mIt shouldn't silently ignore the problem.21:12
J1mPerhaps in it's UI, it should provide some diagnosis.21:12
anguenoti'm fine with this21:12
*** regebro has quit IRC21:12
anguenotyup21:13
anguenotsuch as not proposing the registration21:13
anguenoton the registration form21:13
J1mperhaps21:13
J1mThis is fairly generic code though.21:13
J1mYou would need to provide a custom registration view for it.21:13
anguenotI was more thinking about registration deps21:14
anguenotfor a utility21:14
anguenotthat you wanna register21:14
J1mOf course, it would be sort of nice if there was some kind of more general prerequisite framework.21:14
srichterI think there is definitely a place for solving this problem generically21:14
anguenotIt means that the utility would be aware about the fact that he needs certain utilities and or  services for being able to be registered21:15
srichterI think the prerequisites should be more general21:16
anguenotcan you explain this ?21:17
srichteri.e. every pre-requisite is a callable that has to return True21:17
srichterfor example21:17
srichterthe callable's doc string could be used as explanatory textvery similar to how generations work21:17
srichterif we want to be more fancy, we could have PreRequisite objects that can even offer to fulfill the prerequisite21:18
srichterso you get an overview of all the prereqs and it tells you which are fulfilled and which are not21:19
* mgedmin idly thinks that docstrings and i18n do not mix well21:19
srichterif a prerequisite can fulfill itself, you can check it and click "Fulfill" or so21:19
anguenotyups would rock :)21:19
anguenotok21:19
srichtermgedmin: probably not, so a prerequisite object would be more appropriate21:20
anguenotand do you see the association in betwee, the prerequiste object and the object itself ?21:20
anguenothow21:20
srichterit could be an adapter, for example21:21
anguenotok21:22
srichtereven better a subscriber21:22
srichterbecause you want several of those subscribers for a given object21:23
srichterI think that would be very scalable, since one prerequisite might have other prerequisites21:23
anguenotright21:23
srichterdoing this in a subscriber model would allow for a full prerequisite graph (eventually, as in later)21:23
anguenotWe should write something about it .21:24
srichterwe should solve the simple case first and not overdesign21:24
anguenotok thanks Stephan.21:25
srichteryou are welcome21:25
*** hazmat has joined #zope3-dev21:28
*** douglasc has joined #zope3-dev21:31
*** jinty has quit IRC21:32
nederhoedis it true that if I have a site using, say 4 products, when creating a skin I could best create a product that contains custom views for those 4 products?21:32
*** weaselgod has joined #zope3-dev21:33
*** jinty has joined #zope3-dev21:33
weaselgodcan someone point me to a good IRC channel for Plone based discussion?21:34
srichterweaselgod: no plone guys here, but try #plone21:35
weaselgodhmm, that channel doesn't exist, but thanks anyway21:36
srichteryes it does21:36
weaselgodoops, found it21:36
srichterI just tried it21:36
weaselgodtypo :)21:36
weaselgodthanks21:36
*** weaselgod has left #zope3-dev21:36
*** RaFromBRC has joined #zope3-dev21:42
*** mgedmin has quit IRC21:50
*** Aiste has quit IRC21:51
nederhoedsomeone?21:51
srichterhuh?21:52
*** lunatik has joined #zope3-dev21:53
*** lunatik has left #zope3-dev21:54
*** anguenot has quit IRC21:54
*** jhauser has joined #zope3-dev21:57
*** ignas_ has quit IRC21:58
*** jhauser_ has quit IRC22:01
*** hazmat has quit IRC22:04
*** douglasc has quit IRC22:18
nederhoedmy question was: is it true that if I have a site using, say 4 products, when creating a skin I could best create a product that contains custom views for those 4 products?22:39
nederhoedand I also wonder if I should share an instance for multiple sites, or if I should run multiple instances parallel22:40
*** RaFromBRC has quit IRC22:44
*** nederhoed has quit IRC22:46
*** nisha_cgx has joined #zope3-dev22:57
*** nisha_cgx has quit IRC23:02
*** nederhoed has joined #zope3-dev23:02
*** d2m has joined #zope3-dev23:12
*** nederhoed has quit IRC23:17
*** ignas_ has joined #zope3-dev23:30
*** ignas has quit IRC23:42
*** ignas_ has quit IRC23:42
*** jinty has quit IRC23:42

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!