IRC log of #zope3-dev for Tuesday, 2005-01-25

*** jhauser has quit IRC00:24
Damasceneare metal macros 100% operational?  i'm havign some slight issues on overriding slots, but not sure if it's just me.00:47
J1mas far as we know they are00:47
Damasceneis there a way to turn on advanced debugging mode for it? much to my chagrin, it seems like unlike TAL, METAL doesn't seem to error out very easily.. if at all.  or i'm doing something terribly wrong heh.00:48
*** srichter has joined #zope3-dev00:55
*** ChanServ sets mode: +o srichter00:56
*** Aiste has quit IRC01:13
Damascenewhat's the diff between.  views/standard_macros/page, context/@@standard_macros/page|view ?01:21
Damascenefor metal:use-macro01:21
Damasceneoh yeah throw in a views/standard_macros/view as well.01:21
J1mdon't use views01:21
J1muse context/@@standard_macros01:21
Damasceneview or page?  i'm just trying to get it so i can use my skins/template.pt01:22
Damascenethe macro slots i defined in skins/template.pt01:22
J1mUse view if you want tabs01:22
Damascenehm.  i got a <html metal:use-macro="context/@@standard_macros/page"> and a <div metal:fill-slot="cat">ETC</div> in my index.pt.  my skin/template.pt has a <metal:block define-macro="page"> and a <metal:block define-slot="cat">SOMETHING</metal:block>   but it doesn't seem to override skins/template.pt curious on where i should look?  i've tried a lot of diff combinations so far.01:30
*** porghar has joined #zope3-dev01:43
porgharhi there01:44
srichterhi01:45
porgharhi stephan01:46
porghari was precisely looking for your help :)01:46
srichter:-)01:47
*** run|work has left #zope3-dev01:48
porghari've been toying with zwiki, and i'm not sure if i'm doing something wrong01:48
porgharis it supposed to work ok with latin-1 inputs?01:49
srichtermmh, I can't remember, but I think it expects UTF-8 input01:50
srichterunless your browser specifies otherwise01:51
porghari see01:51
*** `anthony has quit IRC01:52
porgharnot sure of what i'm doing wrong then01:52
srichterI remember there being some issues with non-ASCII inputs01:53
srichterbut this is certainly not zwiki-specific but a problem of the TextWidget in Zope 301:53
srichterI think it would help brining it up on the Dev mailing list01:54
porgharyup, i just wanted to check here first because i saw nothing on the list that looked similar01:54
porgharand i've been digging for a couple of days now :)01:55
J1mI doubt that:01:55
J1m- zwiki uses a text widget01:55
J1m- that there is a problem with non-ascii input to a text widget01:56
porgharwell01:56
porgharnot an expert in Zope3 by far, so you probably shouldnt pay much attention to this but...01:57
porghari've installed it on two boxes01:57
porgharand tried to create a page with spanish accented characteres from three different ones01:57
porgharwith no success01:57
porghari get a unicodedecodeerror01:57
porgharand btw, i get a similar error with bugtracker01:58
srichterJ1m: I am pretty sure that the text is sent Latin1 and Zope tries to decode it using UTF-801:59
J1mZope should be outputing the form in utf802:00
srichterright, so we assume the browser sends the form also in UTF-802:00
srichterdo we actually specify the encoding in the form element?02:00
porghari've used both firefox and ie02:01
J1mset set the charset to utf-8 in the headers02:02
J1mwe don't set it in the form tag02:03
porghar... sorry Jim... are you talking to me now?02:04
J1ma browser is supposed to send the form in whatever encoding it got the form in02:04
J1mI'm talking to both of you02:04
porgharok :)02:04
J1mwhat is the unicode value of the character you are trying to send?02:04
porgharhold on a second02:05
J1mI got the same error.02:05
J1mCrap02:06
porgharthe value is...02:06
J1mwell, wikipage has:02:06
J1m html = str(source)02:06
J1mtrying a contact02:06
porgharit's seems you haven't needed in the end02:06
porghari've tried hacking those lines too02:07
porgharbut i'm just a zope3-newbienewbie02:07
J1mThat code is just evil02:07
J1mwell, I just added a buddy with Arabic characters in it's address with no problem.02:08
J1mSo it's not a text widget bug.02:08
J1mIt sounds like zwiki is broken02:09
srichter:-(02:09
srichterprobably some leftover from the old renderer02:09
*** hazmat has quit IRC02:09
srichterporghar: feel free to fix it02:09
J1mThe bug tracker is broken02:10
porgharlol02:10
porgharme? fix it?02:10
porgharthat wouldn't be a good idea :)02:10
porghari'm still trying to get the CA right02:10
porgharbtw, huge congrats to both of you02:11
porghar(and all the rest)02:11
porghari'm amazed of what you're doing with zope302:11
porgharso much, that i'm trying to make it used here at work02:11
J1msrichter, the bug tracker is unusable02:13
J1mCan't add bugs to it :(02:14
J1mI don't know how porghar managed to test inputing non-ascii text to it.02:14
porghari'm using a zope3x-3.0.0 install02:15
porgharand downloaded the package from the wiki02:15
porgharit installs fine and works fine with ascii input02:15
*** hazmat has joined #zope3-dev02:16
J1msrichter, ayt?02:22
srichterJ1m: yep02:23
J1many idea what's up with bugtracker?02:23
srichternope02:23
srichterin what respect?02:24
srichterit should work afaik02:24
J1msrichter, the bug tracker is unusable02:24
J1mCan't add bugs to it :(02:24
srichter:-(02:24
srichterok02:24
J1mat least I can't02:24
srichterI have to look at it02:24
porghari can't believe that after two days wondering what was *I* doing wrong...02:26
porgharit was actually a couple of bugs in the packages :)02:26
porghar... makes me feel a little less stupid02:26
J1mporghar, should should never assume you were doing something wrong with software02:26
porgharlol02:26
porgharthe thing is, that assumption is normally right :p02:27
Damasceneyeah but i'm so bad at this stuff, it's usually my fault not the software's fault haha02:27
*** J1m has quit IRC02:28
*** porghar has quit IRC02:33
*** projekt01 has joined #zope3-dev02:47
*** stub has joined #zope3-dev03:28
*** hazmat has quit IRC04:40
*** bradb has quit IRC04:48
*** bradb has joined #zope3-dev04:52
*** tvon has joined #zope3-dev04:53
*** __gotcha__ has quit IRC04:57
*** __gotcha has joined #zope3-dev04:59
*** __gotcha__ has joined #zope3-dev05:00
*** hazmat has joined #zope3-dev06:03
*** stub has quit IRC06:28
*** stub has joined #zope3-dev06:30
*** hazmat has quit IRC07:10
*** sashav has quit IRC07:16
*** hazmat has joined #zope3-dev07:29
*** zagy has joined #zope3-dev08:06
zagymoin08:07
*** hazmat has quit IRC08:33
*** d2m has quit IRC08:41
*** hazmat has joined #zope3-dev08:46
*** Suresh-E has joined #zope3-dev08:56
*** stu1 has joined #zope3-dev09:05
*** stub has quit IRC09:06
*** d2m has joined #zope3-dev09:14
*** stu1 is now known as stub09:31
*** sashav has joined #zope3-dev09:40
*** jhauser has joined #zope3-dev10:16
*** hazmat has quit IRC11:01
*** MalcolmC has joined #zope3-dev11:11
*** AJC has joined #zope3-dev11:38
*** SteveA has quit IRC11:45
*** SteveA has joined #zope3-dev11:46
*** SteveA has quit IRC11:52
*** SteveA has joined #zope3-dev11:52
*** vlado has joined #zope3-dev12:00
*** [nicknam] has joined #zope3-dev12:17
*** [nicknam] is now known as apoirier12:17
*** SteveA_ has joined #zope3-dev12:20
*** SteveA has quit IRC12:20
*** AJC has quit IRC12:20
*** AJC has joined #zope3-dev12:21
*** SteveA_ is now known as SteveA12:21
*** mgedmin has joined #zope3-dev13:07
*** alakdan has joined #zope3-dev13:16
*** SteveA has joined #zope3-dev13:47
*** alakdan has left #zope3-dev13:48
*** SteveA_ has joined #zope3-dev13:58
*** Aiste has joined #zope3-dev13:59
*** SteveA has quit IRC14:01
*** SteveA_ is now known as SteveA14:01
*** `anthony has joined #zope3-dev14:03
*** regebro has joined #zope3-dev14:03
regebroHang on... because the date and datetime widgets uses tzinfo, I need to use it too, because otherwise dates can't be compared...14:09
regebroAnd so find my tzinfo i need to do:14:10
regebrofrom zope.app.datetimeutils import _tzoffset, tzinfo, DateTimeParser14:10
regebromytzinfo = tzinfo(_tzoffset(DateTimeParser._localzone, None) / 60)14:10
regebroIsn't that just a tad bit complicated? Is there an easier way to do this?14:10
regebroEvidently not. And I even simplified it by ugly-using DateTimeParsers class attribute. ;)14:15
mgedmindoes that bit handle daylight savings time?14:19
*** mgedmin has quit IRC14:25
regebroYup, because DateTimeParser._localzone is DST aware.14:27
*** niemeyer has joined #zope3-dev14:31
*** Aiste has quit IRC14:33
* VladDrac 's trying to figure out why he doesn't get a view / preview tab14:39
*** srichter has quit IRC14:44
*** tvon has quit IRC14:51
*** faassen has joined #zope3-dev15:15
regebroSigh, and dates are always timezone naiv, and can't be compared with datetimes that have timezones.15:24
*** stub has left #zope3-dev15:32
regebroOr maybe not..15:36
*** mgedmin has joined #zope3-dev15:37
`anthonyregebro: datetimes and timezones are just plain evil and hard.15:38
regebroYeah, so I notice. :/15:38
Damascenehey regebro, ever use METAL?15:40
regebroAs is metal:use-macro, yes.15:42
regebroOtherwise, no,  Damascene. Unless you mean like, metal forks. Hohoho. ;)15:42
SteveA`anthony: a veritable can of worms.15:43
*** tvon has joined #zope3-dev15:44
`anthonySteveA: There's a reason grownups use UTC for everything <wink>15:46
regebroIt would be MUCH easier if you could just make a particular tzinfo the default, so that all times are tz-aware.15:48
regebroI'm currently going through all my code to find all places where I create datetimes or times that do not have timezones...15:48
`anthonyregebro: Really, really, really: Use UTC everywhere, and convert to a timezone at display-time.15:49
`anthonyTimezones are only for display.15:49
regebroTell that to Zope3. :p15:49
`anthonyYou will find your code is much saner and much more robust.15:49
`anthonyregebro: I haven't looked too closely at Z3, but Z2 works fine in UTC.15:49
`anthonys/Z3/Z3's timezone mechanisms/15:50
`anthonyif all else fails, set TZ=UTC before starting Z315:50
SteveAi'd say use UTC everywhere except where you want to use naive time because you are actively uninterested in timezone.15:50
regebroYeah, but datetime works quite differently.15:50
`anthonySteveA: Even then. You might _think_ you don't care about timezones, but later down the track you will probably get bitten.15:51
*** srichter has joined #zope3-dev15:51
*** ChanServ sets mode: +o srichter15:51
`anthonyI've seen at least half-a-dozen other projects get bitten by this.15:51
SteveAthere's a bunch of calendaring applications where you really want to explicitly not care about timezones15:51
* VladDrac wraps his brain around too much zope3 stuff at once15:51
regebroI am actively uninterested in it, but zope gives me tz-aware times. So all my times need to be tz-aware. Using UTC doesn't really help, becaus ethat is still a timezone.15:51
`anthonySteveA: Not so. A calendar _must_ care about timezones.15:51
`anthony"Set an event to go off this time next week". Ok, what happens if that "week" includes a daylight savings time switch?15:52
SteveAif it is my personal calendar, and i want to be woken up at 8am, i want it to be 8am in the timezone i am in15:53
SteveAif it travel, i want it to be 8am local time15:53
regebroWell, if it IS timezone-aware, wouldn't it go off one hour off?15:53
regebroQ: What does iCal do?15:53
`anthonyregebro: But you might want that. You might be instead saying "24 * 7 hours from now". That's what I mean by "you need to pay attention to it now"15:53
SteveAadding timezone information to that, and adding in naive programmers, you get a system that doesn't work well because it is taking responsiblity for too much information15:53
regebro`anthony: Sure, but that must be a very unusual case.15:54
`anthonySteveA: So what happens to the event that's registered at 2.30am on the night of the DST switch (here, DST switch is at 2/3am)15:54
regebroI don't really care if my calendar understands timezones or not. Any way, it's a lot of bother.15:55
`anthonyregebro: You'd be horribly surprised to see how often daylight savings fucks things up.15:55
regebro`anthony: No I wouldn't.15:55
SteveA`anthony: the software needs to be down for maintenance15:55
`anthonySteveA: Yuk.15:55
regebroI've been doing timezone aware software for many years.15:56
`anthonyI take an absolutely hard-line on timezone issues. Any time stored with a "timezone" is a bug ;)15:56
`anthonyunless that "timezone" is UTC, aka +000015:56
regebroI would agree on that.15:57
`anthonyregebro: I also find it clarifies issues a lot if you simply regard "timezone" as another display setting, like "language"15:57
`anthonyor "font" <wink>15:57
MalcolmCanthony: What if a user of an international system chooses a time, and that time has to continue to come out as their local time even when their local timezone changes?15:58
regebroBut, how on earth do I handle both tz-aware and non-tz-aware datetimes?15:58
MalcolmCanthony: Do you then force the time to UTC and store their timezone separately, just to prove a point?15:58
SteveAregebro: they are two totally different things, that's all15:58
SteveAregebro: a non-tz-aware datetime is more like a timedelta, really15:59
regebroYeah, but I need to handel them both, as if they are one.15:59
SteveAno you don't15:59
regebroYeah, well, good. You come over here and write this program then. ;)16:00
regebroBut I'll start with seeing if I can convince Zope3 not to give me tzaware dates, firstly...16:01
SteveAwhere does it give you these things?16:02
SteveAyou mean from forms?16:02
regebroYup. I can strip it of tzinfo, I guess. I tried that before but that seemed complicated.16:03
SteveAyou want a field type that is a naive datetime field16:04
SteveAbecause it is a totally different thing to a utc datetime16:04
SteveAanthony is right that utc datetime is by far the most useful in almost all situations16:04
regebroSteveA, actually, that part might fix itself when I have proper widgets fordate and time, instead of a date input field.16:05
`anthonyMalcolmC: No. If you want to let the user change timezones and have it affect existing stored times, then you need to make sure you do the right thing then.16:05
regebroI mean string input field.16:05
*** mgedmin_ has joined #zope3-dev16:06
mgedmin_I'm a bit unhappy that datetime does not have a tzinfo object for UTC16:07
mgedmin_and that datetime.datetime.utcnow() returns a datetime object with tzinfo=None16:07
*** Voblia_ has joined #zope3-dev16:07
*** gintas has joined #zope3-dev16:07
*** bskahan has joined #zope3-dev16:08
Damasceneoh boy.  if i use my custom skin in the latest svn, the w3.org validator gets a 404.  if i go to that URL manually, it works fine... boggles the mind.16:13
*** J1m has joined #zope3-dev16:14
*** mgedmin has quit IRC16:18
*** mgedmin_ is now known as mgedmin16:19
regebromgedmin_: That's because the default datetime implementation has no tzinfo implementation at all.16:25
regebroso tzinfo must be None.16:25
regebroA good default set of tzinfos would be very beneficial to Python I think.16:26
mgedminwell, the datetime module has an abstract tzinfo class16:27
mgedminit could also have a concrete class for UTC16:27
regebroYeah, you might be right.16:28
regebroi was thinking it needs a more comple implementation, but just a UTC timezone would be good.16:28
Damascenehm.  i wonder WHY Zope3 might spit out HTTP/1.1 404 Not Found16:31
DamasceneDate: Tue, 25 Jan 2005 14:29:56 GMT16:31
Damascenebut then still display the contents16:31
mgedminDamascene, what does the error log say?16:31
Damascenethat's if i use a custom skin.  maybe i setup my custom skin improperly...16:31
Damascenemgedmin:  404, but the content displays fine.  ;)16:32
Damasceneno traceback or anything16:32
Damascenebasically if i didn't use the w3.org validator, i'd never have seen or thought it was a 404 because the page displays.16:33
Damascenei manually telnetted to the system.  if i use say ++skin++ZopeTop/ it does show 200 Ok16:33
Damascenei just switch to ++skin++fc/ and boom 404, but still displays the page.16:33
Damasceneso either i setup the skin improperly... (not sure .. i just did package include=".skin" in the browser, added in a <layer> command and <skin> command in the skins' configure.zcml...)16:35
Damascenedisplays the page according to my skin's template.pt... (although i've been having probelms with getting my macro slots to fill, i wonder if this is related).16:37
*** Suresh-E has left #zope3-dev16:37
*** SteveA_ has joined #zope3-dev16:45
*** `anthony has quit IRC16:47
*** `anthony has joined #zope3-dev16:51
*** [apoirie] has joined #zope3-dev16:53
Damasceneokay. does anyone have another public site using the Zope3 SVN I can test to see if it showsup with 404 but still 'displays' properly?17:01
Damascenebut needs a custom skin.17:02
*** SteveA has quit IRC17:07
*** apoirier has quit IRC17:13
*** zopepaul has joined #zope3-dev17:37
*** eaon has joined #zope3-dev17:41
*** eaon has left #zope3-dev17:41
*** sashav has quit IRC18:02
*** zopepaul has quit IRC18:11
*** gintas has quit IRC18:35
*** jhauser_ has joined #zope3-dev18:53
*** jhauser has quit IRC19:05
*** bskahan has quit IRC19:09
*** bskahan has joined #zope3-dev19:18
Voblia_is there a way to check permissions of some view (permissions that are set in zcml file) in the code of a view?19:25
*** Voblia_ is now known as Voblia19:28
mgedminVoblia, try view = zope.component.getView(object, name, request)19:30
* mgedmin pauses19:31
mgedminwill getView succeed if the authenticated user does not have permission to access that view?19:31
mgedminwill it return a security proxied view?19:31
*** sashav has joined #zope3-dev19:31
*** Aiste has joined #zope3-dev19:33
mgedminyes it will19:34
*** zagy has quit IRC19:35
*** hazmat has joined #zope3-dev19:37
mgedminuhh, I think you can then call zope.security.proxy.getChecker(view).check_getattr(view, '__call__') and see whether it raises an exception19:37
mgedmineek, there should be a better way to get an answer to the question "can I access attribute foo of object bar?"19:38
*** tvon has quit IRC19:38
*** MalcolmC has left #zope3-dev19:43
*** tvon has joined #zope3-dev19:44
*** vlado has quit IRC19:54
*** Heff has joined #zope3-dev20:02
*** AJC has quit IRC20:02
*** Heff is now known as AJC20:02
* mgedmin is slightly annoyed that verifyObject() returns True *or* raises an exception20:18
* mgedmin thinks that there are two sane models: A) returning True or False, b) raising an exception or returning None20:18
* J1m agrees with mgedmin20:19
mgedminare there any caveats with skins and functional doctests?20:36
*** bskahan has quit IRC20:45
*** regebro has quit IRC20:49
*** [apoirie] has quit IRC20:51
*** Aiste has quit IRC21:01
mgedmin++skin++ does not work in functional doctests!21:07
*** tvon has left #zope3-dev21:08
Damasceneall ++skin++s?  or just the custom one you built?21:14
Damascenei.e.  does ++skin++ZopeTop work?21:14
Damascenei'm just curious if this is related to the issue i ran into where my custom skin would return HTTP 404 but the content would display.21:14
mgedmin++skin++ZopeTop does not work21:15
Damasceneoh21:15
Damasceneah well.  i guess i'm all alone in my wack issue then. haha21:15
*** hazmat has quit IRC21:22
J1m++skin++ZopeTop works fine for me21:23
mgedminit works in a browser, but not in a functional doctest21:24
J1mah21:25
mgedminI think it is because functional tests create a new BrowserRequest class21:25
mgedminand say that it implements the default skin21:25
J1mI frequently use the ebug skin when debugging functional doctests21:25
J1mI frequently use the debug skin when debugging functional doctests21:25
mgedminhm21:25
* mgedmin tries to construct a short testcase21:27
mgedminit works21:27
Damasceneactually does someone have a zope 3 svn that i can just publically access with one of your custom skins?  i just want to verify it isn't showing 404 like mine.  :(21:33
mgedminDamascene, I've used custom skins in Zope 3 apps, and I do not remember having that error21:35
mgedminalthough I don't believe I ever explicitly checked the status code21:35
Damasceneyeah, that's why i wanted to test it on someone else's setup who knows what they are doing.  ;)21:35
Damasceneif it works on someone else's setup, then clearly i've borked something up (as usual).21:36
mgedminHTTP/1.0 200 Ok21:36
mgedminmy skins work in a browser, but don't work in functional doctests :-)21:38
Damasceneah well.  i guess i did something retarded then.  you using the SVN or 3.0.0?21:40
mgedminsvn21:41
*** faassen has quit IRC21:43
Damasceneokay teh problem is somehow my errant skin/template must be screwing it up.  thanks, at least i know it's definitely on my end.  ;) probably the skin template21:44
mgedminis the ZopeTop skin derived from rotterdam?21:56
mgedminyes21:57
mgedminI think that explains why ZopeTop works in functional doctests while my custom skin doesn't21:57
mgedminI use a BeforeTraversalEvent subscriber that checks whether event.object provides a certain interface21:57
mgedminand if it does, the subscriber calls applySkin(event.request, MyCustomSkin)21:57
Damascenehm.  in srichter's book.  <html metal:use-macro="views/standard_macros/page">21:57
Damascenehowever, that macro page defines the doctype.21:58
Damascenebut the doctype has to be defined before the <html> tag.  a catch-22.21:58
mgedminI added a debugging print that prints list(providedBy(event.request).interfaces()) after calling applySkin21:58
mgedminand I see that in functional doctests the request provides both my skin and Rotterdam21:58
mgedminwhile in real life it does not provide Rotterdam21:58
mgedminI blame zope.interface.classImplements(request_cls, _getDefaultSkin()) in zope.app.tests.functional21:59
mgedminDamascene, metal:use-macro will replace the <html> element in your template with whatever is defined in the macro22:00
mgedminso if the macro has something like <metal:block define-macro="page"><!DOCTYPE ...><html>...</html></mt22:00
mgedmin</metal:block>22:00
mgedminthen it will produce correct output22:00
Damasceneah ok!22:00
Damascenethansk for the sanity check.  a tiny typo of mine forced it to not appear that way (even though what you said makes sense and is what the docs said too hehe)22:02
*** hazmat has joined #zope3-dev22:03
mgedminthe Debug skin also includes the rotterdam layer22:04
mgedmintherefore more specific interfaces win and the bug is not noticeable with Debug or ZopeTop skins22:04
* mgedmin found a simple way to reproduce his problem22:10
mgedminJ1m, try http("GET /++skin++Basic HTTP/1.1\n\n") in a functional doctest22:11
mgedminyou will see that the rotterdam skin gets applied (the output does not mention zopetopBasic.css but mentions zope3xmltree and such that come from the rotterdam skin22:12
J1mI'll take your word for it.22:12
mgedminI was wrong once already22:12
J1mI'm pretty busy on something else22:13
mgedminok22:13
mgedminperhaps I should just file a collector issue22:13
J1mThat would be good22:13
* mgedmin does so22:14
*** zagy has joined #zope3-dev22:17
mgedmindone: http://zope.org/Collectors/Zope3-dev/35322:24
*** SteveA_ is now known as SteveA22:39
*** zagy has quit IRC22:46
*** niemeyer has quit IRC23:03
*** frerich has joined #zope3-dev23:17
frerichquit23:19
*** mgedmin has quit IRC23:33
*** bskahan has joined #zope3-dev23:34
*** frerich has quit IRC23:42
Damascenewell what do you know.  that silly context/@@view_get_menu/fc_mainnav is what caused ALL my problems.  error 404, and METAL not working.  ;)23:48

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