IRC log of #zope3-dev for Friday, 2005-07-22

*** horizon5 has joined #zope3-dev00:02
srichterJ1m: why do applications need the formal and actual parameter list? and why do they need to match?00:13
*** timte has quit IRC00:17
*** hazmat has joined #zope3-dev00:21
J1mApplications only need formal parameters00:22
J1mtools need actual.00:22
J1mThey are different and have to match for the same reasons they do in any programming language.00:22
J1msrichter, Think of applications as function declrations and tools as function calls.00:23
*** Theuni has quit IRC00:29
*** hazmat has quit IRC00:40
*** hazmat has joined #zope3-dev00:41
*** hazmat has quit IRC00:49
srichterJ1m: ok00:55
*** projekt01 has joined #zope3-dev00:55
*** bradb is now known as bradb-afk00:57
srichterJ1m: is the output of applications stored as workflow-relevant data?01:07
*** MrTopf has quit IRC01:09
J1myes01:16
J1m(output of tools)01:16
*** J1m has quit IRC01:16
*** projekt01 has quit IRC01:28
*** stub has quit IRC02:14
*** SteveA has quit IRC02:22
*** yota has quit IRC02:39
*** __mac__ has quit IRC04:02
*** povbot has joined #zope3-dev04:12
*** zagy has quit IRC04:21
*** zagy has joined #zope3-dev05:49
*** MiUlEr has joined #zope3-dev08:01
*** horizon5 has quit IRC08:20
*** MiUlEr has quit IRC08:33
*** hdima has joined #zope3-dev09:08
*** timte has joined #zope3-dev09:12
*** yota has joined #zope3-dev09:59
*** sashav has joined #zope3-dev10:38
*** d2m has quit IRC10:55
*** sashav has quit IRC10:59
*** lunatik has joined #zope3-dev11:05
*** lunatik has left #zope3-dev11:05
*** lunati1 has joined #zope3-dev11:14
*** lunati1 has left #zope3-dev11:16
*** __gotcha has quit IRC11:58
*** __gotcha has joined #zope3-dev11:58
*** sashav has joined #zope3-dev12:03
*** __gotcha has quit IRC12:04
*** __gotcha has joined #zope3-dev12:04
*** MrTopf has joined #zope3-dev12:21
*** d2m has joined #zope3-dev12:36
*** mexiKON has joined #zope3-dev12:37
*** MrTopf_ has joined #zope3-dev12:38
*** __gotcha_ has joined #zope3-dev12:55
*** philiKON has quit IRC12:55
*** MrTopf has quit IRC12:56
*** __gotcha has quit IRC13:13
*** regebro has joined #zope3-dev13:19
*** mexiKON is now known as philiKON13:25
*** tvon has quit IRC13:58
*** Theuni has joined #zope3-dev14:04
*** mkerrin has joined #zope3-dev14:07
*** faassen has joined #zope3-dev14:15
*** MrTopf_ has quit IRC14:39
*** stub has joined #zope3-dev14:54
*** anguenot has joined #zope3-dev14:58
*** __gotcha_ is now known as __gotchaway15:08
*** tvon has joined #zope3-dev15:09
*** regebro has quit IRC15:26
*** alga has joined #zope3-dev15:27
*** mgedmin has joined #zope3-dev15:44
*** regebro has joined #zope3-dev15:49
*** MrTopf has joined #zope3-dev15:52
*** tav has joined #zope3-dev16:03
*** BjornT_ has joined #zope3-dev16:06
*** gintas has joined #zope3-dev16:08
*** BjornT has quit IRC16:21
*** BjornT_ is now known as BjornT16:31
*** bradb-afk is now known as bradb16:35
*** Theuni has quit IRC16:35
*** bskahan has joined #zope3-dev16:39
*** gintas has quit IRC16:45
*** sashav has quit IRC16:46
*** SteveA has joined #zope3-dev16:50
*** horizon5 has joined #zope3-dev16:52
*** hdima has quit IRC16:57
*** roym has joined #zope3-dev16:59
roymHi Folks,17:11
roym17:11
roymHow do specify credential information correctly in a simple functional test.17:11
roymor set up a default principal? The code below fails thus:17:11
roym17:11
roym>   File "/usr/local/Zope3/src/zope/app/publication/zopepublication.py",17:11
roym>   line 89, in beforeTraversal17:11
roym>    raise Unauthorized # If there's no default principal17:11
roym17:11
roym| class MyBrowserTestCase(BrowserTestCase):17:11
roym|   def setUp(self):17:11
roym|     super(MyBrowserTestCase, self).setUp()17:11
roym|17:11
roym|   def test_something(self):17:11
roym|     response=self.publish('/', basic='sara:rose')17:11
roym|     print "response: ", response17:12
roym|17:12
roym| suite = unittest.TestSuite()17:12
roym| suite.addTest(unittest.makeSuite(MyBrowserTestCase))17:12
roym| unittest.main()17:12
roym17:12
srichterthere are default users defined for functional tests17:12
srichtersee ftesting.zcml17:12
roymI see that mgr:mgrpw is defined in src/ftesting.zcml; however changing the code to17:18
roymresponse=self.publish('/', basic='mgr:mgrpw')17:18
roymstill fails as before...17:18
mgedminroym, that usually indicates that your content object is not connected to the containment hierarchy17:19
roymI see... thanks17:19
mgedminmgr:mgrpw has only local security grants specifically for flushing out bugs like this17:19
mgedminif globalmgr:globalmgrpw gets access, but mgr:mgrpw doesn't, then that's a sure bet17:20
roymI am confused however, since self.publish is being called on '/'; surely that should be rooted - it is the root.17:21
mgedminand it should normally be visible to anonymous users17:25
mgedminweird17:25
*** J1m has joined #zope3-dev17:29
roymI am running the functional tests as follows: (from phillips book)17:29
roymfrom zope.app.debug import Debugger17:30
roymimport os17:30
roymos.chdir('/var/lib/zope3/instances/instance1')17:30
roymdebugger = Debugger(db='var2/Data.fs', config_file="etc/site.zcml")17:30
roymcould this be why?17:30
mgedminwhy don't you use the zope 3 test runner?17:30
roymhow would I invoke that?17:32
roymoh - do you mean bin/test?17:32
* mgedmin nods17:32
mgedmine.g., bin/test -f -s path/to/your/package17:33
philiKONroym, my book doesn't teach you to run functional tests like this...17:35
philiKONroym, see chapter 11, section 11.417:36
roymOne of the things I liked in Zope2 was that I could interactively walk thru the folder hierarchy.17:39
roymIs this possible in zope3? at the debugger prompt?17:39
philiKONyou can still do that in z317:39
philiKONwith 3.117:39
philiKONbin/zopectl debug17:39
roymperfect. thanks17:39
roymdo you have any samples of an exploration session - ie: I have the debugger prompt, and vaguely remember that it was17:43
roymeither a conn() or app() call that got you started...17:44
philiKONdebugger is the application object17:45
philiKONi've been wanting to document this better17:45
*** philiKON has quit IRC17:45
mgedmin>>> from zope.app import zapi17:46
mgedmin>>> root = debugger.root()17:46
mgedmin>>> object = zapi.traverse(root, 'path/to/some/object')17:46
roymgracias!17:46
mgedminif you want to change something, and make the changes persist, also do17:46
mgedmin>>> import transaction17:47
mgedmin>>> transaction.commit()17:47
mgedminat the end17:47
roymjust like in z2. nice.17:47
*** philiKON has joined #zope3-dev17:47
*** philiKON has quit IRC17:52
*** zagy has quit IRC17:52
*** philiKON has joined #zope3-dev17:53
philiKONJ1m, got a min?17:59
J1msure18:02
philiKONJ1m, suppose i have a containerish class18:02
philiKON(implements IContainer)18:02
philiKONbut i want to have it appear as a file object in FTP/DAV18:03
philiKONso, i really don't want its IReadDirectory/IWriteDirectory adapters to be found18:03
philiKON(those are registered for IContainer)18:03
philiKONhow would i go about doing this?18:03
philiKONreally the only half clean solution that came to my mind is to implement a __conform__ method... :(18:04
SteveAmake it provide IMySpecialContainer18:05
SteveAand register an adapter for IReadDirectory that returns None18:05
philiKONright, i thought of that18:05
J1mRegister an adapter factory for your class providing IReadDirectory/IWriteDirectory. Have that factory return None.18:05
philiKONis None in the adapter factory equal to the meaning "there is no adapter"?18:05
J1myes18:05
philiKONWhy does IFoo(obj) fail with a TypeError then if there's no adapter?18:06
J1mBecause it can't find an adapter. :)18:06
philiKONmmh18:06
J1mIf you want it not to fail, provide a default:18:06
J1mIFoo(obj, None)18:07
philiKONright, i know18:07
philiKONok, what if I do this:18:08
philiKONIFoo(obj, {})18:08
philiKONnow, i have explicitly registered an adapter factory for IFoo that returns None18:08
philiKONfor the above mentioned reason (want to override an existing adapter)18:08
J1mThen you will get {}18:08
philiKONwill I?18:08
philiKONthat's ok then18:09
J1mNo, I was just kidding.18:09
philiKONi didn't know that18:09
philiKONhrrrm18:09
J1mI was kidding about kidding18:09
* philiKON is confused18:09
* MrTopf even more18:09
philiKONi guess i should just try it out18:10
J1mI make a statement, and you asked if it was true.18:10
J1mWhat was I supposed to say?18:10
philiKONyeh, it was more of a surprising rhetorical question18:10
J1mAnd so I kidded you about it.18:10
philiKONyeah, gotcha18:11
philiKONthanks18:11
* MrTopf has to thank :-)18:11
* philiKON and MrTopf sprinting18:11
roymI am at a debugger prompt (z3); what is the z3 equivalent of the following z2 incantation:18:33
roym[v.id for v in root.values()]18:33
roymwhere root = debugger.root()18:34
philiKON[zapi.getName(v) for v in root.values()]18:34
*** __gotchaway has quit IRC18:34
*** __gotchaway has joined #zope3-dev18:35
*** __gotchaway is now known as __gotcha18:35
roymtks18:35
srichterJ1m: it seems strange that the process instance itself does not provide a list of work items that need to be finished for the current activity18:50
J1mwhat current activity? There can be many.18:50
srichterah, so I guess I would expect, some API like this: process.currentActivities[1].workitems[0]18:51
srichter(or something like it)18:51
J1m<shrug>18:52
J1mI haven't needed it.18:52
srichterI do not need it, but it would make life easier18:52
J1mI wouldn't be opposed to something like that, using methods, not attrs.18:52
srichtersometimes I want to get an overview of all workitems for a manager (for example) , like you did in the READMEE.txt with a list of workitem18:53
J1mSure, but I's probably use some application-level facility for this.18:53
srichterbut sometimes a manager looks at a particular workflow; in those cases I would like to inspect it directly18:53
J1mI'd have worklist objects that kept track of work items for a manager.18:54
J1mThe process instance doesn't really know anything about managers.18:54
srichterright, I do this too18:54
srichterof course18:54
J1mor about people even.18:54
srichterright18:54
srichtermaybe I need to find a better way of organizing my workitems18:55
srichterI think I have an idea; thanks :-)18:55
*** bskahan has quit IRC19:07
* MrTopf needs a WebDAV MOVE...19:15
*** bradb is now known as bradb-lunch19:51
*** projekt01 has joined #zope3-dev20:00
*** projekt01 has quit IRC20:01
*** anguenot has quit IRC20:10
*** bskahan has joined #zope3-dev20:13
*** MrTopf has quit IRC20:16
*** WebMaven has joined #zope3-dev20:22
*** alga has quit IRC20:27
*** mgedmin has quit IRC20:31
*** Aiste has quit IRC20:32
*** bskahan has quit IRC20:32
*** faassen has quit IRC20:38
*** regebro has quit IRC20:52
*** bradb-lunch is now known as bradb20:53
*** mkerrin has quit IRC21:58
*** Aiste has joined #zope3-dev22:16
*** horizon5 has quit IRC22:19
*** timte has quit IRC23:09
*** BjornT has quit IRC23:21
*** FarcePest has quit IRC23:41

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