From kevin@bud.ca Sun Jun 10 21:47:44 2001 From: kevin@bud.ca (Kevin Teague) Date: Sun, 10 Jun 2001 13:47:44 -0700 Subject: [Zope-Perl] Script (Perl) 1.0b6 Message-ID: <3B23DCF0.2030208@bud.ca> Hi all, I have put up a version of PerlMethods (which has now been fully renamed to 'Script (Perl)') available here: http://www.bud.ca/ext2/code/ScriptPerl-1.0b6.tar.gz To install: * Have a working install of pyperl and zoperl * unzip in your Products directory. You will now have two directories /Products/PerlMethods and /Products/ScriptPerl. If you don't need to support older instances of Perl Methods you should be able to remove your /Products/PerlMethods directory. * Restart Zope. * Create instances of "Script (Perl)" Changes from PerlMethods1.0b5 include: * Renamed all references to PerlMethods to Script (Perl) * Added a History tab * Edit and Add screens cleaned up. Uses newer Zope web interface calls (such as "manage_page_header") * Lots of changes to the code layout. Uses AccessControl.ClassSecurityInfo() to protect methods. * New icon: 'www/scriptperl.gif' * FTP interface now uses the '##' syntax for parameters (er, args) and other meta info, in the same manner as PythonScripts. Things that are still incomplete: * Help screens need to be written * Not thoroughly tested. Give the code a whirl and send any bug reports to kevin@bud.ca - Kevin From jimbo@tacomaplace.com Tue Jun 12 01:13:11 2001 From: jimbo@tacomaplace.com (jimbo) Date: Mon, 11 Jun 2001 17:13:11 -0700 Subject: [Zope-Perl] getting Everyauction values into zope Message-ID: <200106111713.AA3333816962@tacomaplace.com> Hello, I'm wondering what would be the best way to display the values. I would like to just post how many new auctions, bids, closing,etc. I thought I figure I should just use localfs or something to read the data using python or DTML. I know very little programming using perl. Is there an easy way of doing this? TIA, -Jimbo From alany@idiglobal.com Wed Jun 20 22:09:29 2001 From: alany@idiglobal.com (Alan Young) Date: Wed, 20 Jun 2001 15:09:29 -0600 Subject: [Zope-Perl] Getting wierd problem with self in perl script. Message-ID: <01062015090500.24238@harleypig> (Ahhh ... appropriate sig!) I'm trying to get a perl script up and going and running into serious understanding issues. Script (Perl) id: test Arguments: self Code: return $self->objectValues; DTML Method id: testtest Content: I go to http://zope/users/alany/test and get the following: [, , , , ] which is to be expected. I go to http://zope/users/alany/test/test and get the following: Error Type: PerlError Error Value: Can't call method "objectValues" on an undefined value at test line 1. Change to and I get Error Type: NameError Error Value: self Change to and I get Error Type: PerlError Error Value: Usage: Python::PyObject_GetAttr(o, attrname) at /home/zope/lib/perl/Zope.pm line 118. All of these are errors are the same if I add a my $self = shift; line at the top of the method. Help! Basically, what I want to do is something like the following: .gif" alt="">   Any ideas or suggestions? -- I think my career is ruined! From maarten.slaets@neolabs.be Thu Jun 21 10:22:38 2001 From: maarten.slaets@neolabs.be (Maarten Slaets) Date: Thu, 21 Jun 2001 11:22:38 +0200 Subject: [Zope-Perl] PerlError: constant item trapped by operation mask at (eval 12) line 1. Message-ID: <3B31BCDE.9EC1271A@neolabs.be> Hi, I'm getting an error while testing a perl script. At (seamingly) random edit's I get the traceback seen below. Only thing I can do to continue editing is restart my zope. Perl Script: id: perlmenu arg: self code: my @res; search($self); sub search { my @array = ('Folder', 'DTML Document'); for ($_[0]->objectValues(\@array)) { push(@res, $_->getId()); } } return join("\n", @res); Now if I start modifying the code, at some point I get a traceback like this: Traceback (innermost last): File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/zope/Zope-2.3.2/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: perlmenu) File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, in publish File /home/zope/Zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_edit) File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_edit) File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, line 96, in manage_edit (Object: perlmenu) File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, line 155, in recompile (Object: perlmenu) PerlError: constant item trapped by operation mask at (eval 11) line 1. If I add another perl script: id: somethingelse arg: code: 1; I get the same error: Traceback (innermost last): File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, in publish File /home/zope/Zope-2.3.2/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, in publish File /home/zope/Zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: manage_addPerlMethod) File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: manage_addPerlMethod) File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, line 224, in manage_addPerlMethod File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, line 83, in __init__ (Object: testfdsfsdf) File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, line 96, in manage_edit (Object: testfdsfsdf) File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, line 155, in recompile (Object: testfdsfsdf) PerlError: constant item trapped by operation mask at (eval 12) line 1. I'm using: Zope Version Zope 2.3.2 (source release, python 1.5.2, linux2) Python Version 2.1 (#2, May 1 2001, 14:50:43) [GCC 2.95.2 20000220 (Debian GNU/Linux)] System Platform linux2 Process Id 1352 (1026) Running For 31 min 16 sec and zoperl-1.0.beta5 pyperl-1.0.1 I don't have much time to look at this further for now, but if any of you get the same error, please let me know. -- Maarten Slaets Contact: http://www.neolabs.be/vcard/MaartenSlaets.vcf From alany@qwest.net Mon Jun 25 17:15:00 2001 From: alany@qwest.net (Alan Young) Date: Mon, 25 Jun 2001 10:15:00 -0600 Subject: [Zope-Perl] Re: Getting wierd problem ... Message-ID: <01062510150001.00175@harleypig> Ok, I've figured out how to call a script in perl with self () and are there any differences I need to be aware of. Thanks. Alan -- Software suppliers are trying to make their software packages more "user-friendly". ... Their best approach, so far, has been to take all the old brochures, and stamp the words, "user-friendly" on the cover. -- Bill Gates, Microsoft, Inc. [Pot. Kettle. Black.] From u.wisser@publisher.de Wed Jun 27 08:15:31 2001 From: u.wisser@publisher.de (Ulrich Wisser) Date: Wed, 27 Jun 2001 09:15:31 +0200 Subject: [Zope-Perl] Aquisition? Message-ID: <5.0.2.1.0.20010627090531.00a2a300@post.netlink.se> Hello, I have a Script(Perl, unrestricted) in my Folder "/reports/". The script needs to use a ZSQL Method in folder "/sql/Lst/". Here is my code: my $sql = Python::getitem($self, "sql"); my $Lst = Python::getitem($sql, 'Lst'); foreach $row ($Lst->Submitstat("site" => $self->{REQUEST}->website, "dat" => $self->{REQUEST}->datum)) { $worksheet->write($row, 1, $row); $row++; } But that doesn't work. Here is the error message: Error Type: KeyError Error Value: sql Traceback: File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, in publish_module File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/Zope-2.3.2/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/Zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: excel_dok) File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: excel_dok) File /usr/local/Zope-2.3.2/lib/python/Products/PerlExternalMethod/__init__.py, line 119, in __call__ (Object: excel_dok) File /usr/local/Zope-2.3.2/lib/python/OFS/ObjectManager.py, line 678, in __getitem__ (Object: Traversable) KeyError: (see above) What is the error? How can I use my ZSQL Methods? Thanks Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 From u.wisser@publisher.de Wed Jun 27 21:45:34 2001 From: u.wisser@publisher.de (Ulrich Wisser) Date: Wed, 27 Jun 2001 22:45:34 +0200 Subject: [Zope-Perl] ZopeBook examples ("use" does not work) Message-ID: <5.0.2.1.0.20010627223819.009f64c0@post.netlink.se> Hello, I have some trouble working with Perl Scripts. I wanted to try the Dilbert example from Zope Book. But I get an error on the "use LWP::UserAgent;" statement: PerlError: require trapped by operation mask at excel2 line 1. What do I do wrong? I'd like to use Spreadsheet::WriteExcel in my Scripts. Just I don't get it used in Script (Perl). and can't get my Script (Perl, unrestricted) to acquire my SQL folders. Any hints anybody? TIA Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 From andym@ActiveState.com Wed Jun 27 21:59:05 2001 From: andym@ActiveState.com (Andy McKay) Date: Wed, 27 Jun 2001 13:59:05 -0700 Subject: [Zope-Perl] Re: Getting wierd problem ... References: <01062510150001.00175@harleypig> Message-ID: <020001c0ff4c$02fb87d0$ae03a8c0@activestate.com> You should be able to pass arguments exactly as the same as python args. You can also pull out of the request if necessary, there is no difference for var|call|in compared to anything else. Cheers. -- Andy McKay. ----- Original Message ----- From: "Alan Young" To: Sent: Monday, June 25, 2001 9:15 AM Subject: [Zope-Perl] Re: Getting wierd problem ... > Ok, I've figured out how to call a script in perl with self ( "script(this())" but I'm still having problems getting things working > correctly. If I want to have more parameters things get really screwy. > > Is there a step by step tutorial on how to make perl work with zope? All > the tutorials I've seen make some basic assumptions that I'm not familiar > with. > > How do I create the script so I can access passed values. What are the > possible ways I can call the script () and are there > any differences I need to be aware of. > > Thanks. > > Alan > -- > Software suppliers are trying to make their software packages more > "user-friendly". ... Their best approach, so far, has been to take all > the old brochures, and stamp the words, "user-friendly" on the cover. > -- Bill Gates, Microsoft, Inc. > [Pot. Kettle. Black.] > > _______________________________________________ > Zope-perl maillist - Zope-perl@zope.org > http://lists.zope.org/mailman/listinfo/zope-perl > From andym@ActiveState.com Wed Jun 27 21:57:07 2001 From: andym@ActiveState.com (Andy McKay) Date: Wed, 27 Jun 2001 13:57:07 -0700 Subject: [Zope-Perl] ZopeBook examples ("use" does not work) References: <5.0.2.1.0.20010627223819.009f64c0@post.netlink.se> Message-ID: <01fe01c0ff4c$02b222c0$ae03a8c0@activestate.com> > I have some trouble working with Perl Scripts. > I wanted to try the Dilbert example from Zope Book. > But I get an error on the "use LWP::UserAgent;" > statement: You cant use "use" within a Script (Perl). Cheers. -- Andy McKay. From andym@ActiveState.com Wed Jun 27 21:57:50 2001 From: andym@ActiveState.com (Andy McKay) Date: Wed, 27 Jun 2001 13:57:50 -0700 Subject: [Zope-Perl] Aquisition? References: <5.0.2.1.0.20010627090531.00a2a300@post.netlink.se> Message-ID: <01ff01c0ff4c$02cdc110$ae03a8c0@activestate.com> So sql isnt inside the reports folder? That wont work and wouldn't in python. You first have to get the root and then get the sql folder. Cheers. -- Andy McKay. ----- Original Message ----- From: "Ulrich Wisser" To: Sent: Wednesday, June 27, 2001 12:15 AM Subject: [Zope-Perl] Aquisition? > Hello, > > I have a Script(Perl, unrestricted) in my Folder "/reports/". > The script needs to use a ZSQL Method in folder "/sql/Lst/". > Here is my code: > > my $sql = Python::getitem($self, "sql"); > my $Lst = Python::getitem($sql, 'Lst'); > foreach $row ($Lst->Submitstat("site" => $self->{REQUEST}->website, "dat" > => $self->{REQUEST}->datum)) { > $worksheet->write($row, 1, $row); > $row++; > } > > But that doesn't work. Here is the error message: > > Error Type: KeyError > Error Value: sql > > Traceback: > > File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, in > publish_module > File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, in > publish > File /usr/local/Zope-2.3.2/lib/python/Zope/__init__.py, line 221, in > zpublisher_exception_hook > (Object: Traversable) > File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, in > publish > File /usr/local/Zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, in mapply > (Object: excel_dok) > File /usr/local/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, in > call_object > (Object: excel_dok) > File > /usr/local/Zope-2.3.2/lib/python/Products/PerlExternalMethod/__init__.py, > line 119, in __call__ > (Object: excel_dok) > File /usr/local/Zope-2.3.2/lib/python/OFS/ObjectManager.py, line 678, in > __getitem__ > (Object: Traversable) > KeyError: (see above) > > > What is the error? How can I use my ZSQL Methods? > > Thanks > > Ulrich > -- > Searchengine Know How - Webpromotion - Optimization - Internal Search > World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg > http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 > > > _______________________________________________ > Zope-perl maillist - Zope-perl@zope.org > http://lists.zope.org/mailman/listinfo/zope-perl > From u.wisser@publisher.de Wed Jun 27 21:59:40 2001 From: u.wisser@publisher.de (Ulrich Wisser) Date: Wed, 27 Jun 2001 22:59:40 +0200 Subject: [Zope-Perl] Aquisition? In-Reply-To: <01ff01c0ff4c$02cdc110$ae03a8c0@activestate.com> References: <5.0.2.1.0.20010627090531.00a2a300@post.netlink.se> Message-ID: <5.0.2.1.0.20010627225900.009f6640@post.netlink.se> Hi Andy, >So sql isnt inside the reports folder? That wont work and wouldn't in >python. >You first have to get the root and then get the sql folder. How do I get the root folder? Thanks Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 From andym@ActiveState.com Wed Jun 27 22:05:22 2001 From: andym@ActiveState.com (Andy McKay) Date: Wed, 27 Jun 2001 14:05:22 -0700 Subject: [Zope-Perl] PerlError: constant item trapped by operation mask at (eval 12) line 1. References: <3B31BCDE.9EC1271A@neolabs.be> Message-ID: <020401c0ff4c$e2e83500$ae03a8c0@activestate.com> Hmm. Heres a patch for a bug that occurs on editing. Im dont remember getting the same error message though: /lib/perl/Zope.pm --- d:\Zope.pm Sat Feb 24 00:21:02 2001 +++ l:\lib\perl\Zope.pm Fri Apr 27 12:19:51 2001 @@ -41,7 +41,7 @@ my $mtime = (stat $f)[9]; if ($mtime > ($mod_stat{$f} || $^T)) { delete $INC{$file}; - require_ext($mod); + require_ext($mod, $instance_home); } $mod_stat{$f} = $mtime; } Cheers. -- Andy McKay. ----- Original Message ----- From: "Maarten Slaets" To: Sent: Thursday, June 21, 2001 2:22 AM Subject: [Zope-Perl] PerlError: constant item trapped by operation mask at (eval 12) line 1. > Hi, > > I'm getting an error while testing a perl script. At (seamingly) random > edit's I get the traceback seen below. Only thing I can do to continue > editing is restart my zope. > > Perl Script: > id: perlmenu > arg: self > code: > my @res; > search($self); > > > sub search { > my @array = ('Folder', 'DTML Document'); > for ($_[0]->objectValues(\@array)) { > push(@res, $_->getId()); > } > } > > return join("\n", @res); > > > Now if I start modifying the code, at some point I get a traceback like > this: > > > > Traceback (innermost last): > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, > in publish_module > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, > in publish > File /home/zope/Zope-2.3.2/lib/python/Zope/__init__.py, line 221, in > zpublisher_exception_hook > (Object: perlmenu) > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, > in publish > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, > in mapply > (Object: manage_edit) > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, > in call_object > (Object: manage_edit) > File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, > line 96, in manage_edit > (Object: perlmenu) > File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, > line 155, in recompile > (Object: perlmenu) > PerlError: constant item trapped by operation mask at (eval 11) line 1. > > > If I add another perl script: > id: somethingelse > arg: > code: > 1; > > I get the same error: > > Traceback (innermost last): > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 223, > in publish_module > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 187, > in publish > File /home/zope/Zope-2.3.2/lib/python/Zope/__init__.py, line 221, in > zpublisher_exception_hook > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 171, > in publish > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/mapply.py, line 160, > in mapply > (Object: manage_addPerlMethod) > File /home/zope/Zope-2.3.2/lib/python/ZPublisher/Publish.py, line 112, > in call_object > (Object: manage_addPerlMethod) > File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, > line 224, in manage_addPerlMethod > File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, > line 83, in __init__ > (Object: testfdsfsdf) > File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, > line 96, in manage_edit > (Object: testfdsfsdf) > File /home/zope/Zope-2.3.2/lib/python/Products/PerlMethod/__init__.py, > line 155, in recompile > (Object: testfdsfsdf) > PerlError: constant item trapped by operation mask at (eval 12) line 1. > > I'm using: > Zope Version > Zope 2.3.2 (source release, python 1.5.2, linux2) > Python Version > 2.1 (#2, May 1 2001, 14:50:43) [GCC 2.95.2 20000220 > (Debian GNU/Linux)] > System Platform > linux2 > Process Id > 1352 (1026) > Running For > 31 min 16 sec > > and > > zoperl-1.0.beta5 > pyperl-1.0.1 > > I don't have much time to look at this further for now, but if any of > you get the same error, please let me know. > > -- > Maarten Slaets > Contact: http://www.neolabs.be/vcard/MaartenSlaets.vcf > > _______________________________________________ > Zope-perl maillist - Zope-perl@zope.org > http://lists.zope.org/mailman/listinfo/zope-perl > From u.wisser@publisher.de Wed Jun 27 22:02:36 2001 From: u.wisser@publisher.de (Ulrich Wisser) Date: Wed, 27 Jun 2001 23:02:36 +0200 Subject: [Zope-Perl] ZopeBook examples ("use" does not work) In-Reply-To: <01fe01c0ff4c$02b222c0$ae03a8c0@activestate.com> References: <5.0.2.1.0.20010627223819.009f64c0@post.netlink.se> Message-ID: <5.0.2.1.0.20010627230024.009f7930@post.netlink.se> Hi, > > I have some trouble working with Perl Scripts. > > I wanted to try the Dilbert example from Zope Book. > > But I get an error on the "use LWP::UserAgent;" > > statement: > >You cant use "use" within a Script (Perl). The example was taken from the ZopeBook. I belive that part needs some more clearance. Some more information about the "context" variable for example would be interesting. Thanks again Ulrich -- Searchengine Know How - Webpromotion - Optimization - Internal Search World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 From andym@ActiveState.com Wed Jun 27 22:08:54 2001 From: andym@ActiveState.com (Andy McKay) Date: Wed, 27 Jun 2001 14:08:54 -0700 Subject: [Zope-Perl] ZopeBook examples ("use" does not work) References: <5.0.2.1.0.20010627223819.009f64c0@post.netlink.se> <5.0.2.1.0.20010627230024.009f7930@post.netlink.se> Message-ID: <022201c0ff4d$60a27c80$ae03a8c0@activestate.com> I believe I sent a note saying you couldnt do that... oh well. Cheers. -- Andy McKay. ----- Original Message ----- From: "Ulrich Wisser" To: "Andy McKay" ; Sent: Wednesday, June 27, 2001 2:02 PM Subject: Re: [Zope-Perl] ZopeBook examples ("use" does not work) > Hi, > > > > I have some trouble working with Perl Scripts. > > > I wanted to try the Dilbert example from Zope Book. > > > But I get an error on the "use LWP::UserAgent;" > > > statement: > > > >You cant use "use" within a Script (Perl). > > The example was taken from the ZopeBook. I belive that part > needs some more clearance. Some more information about > the "context" variable for example would be interesting. > > Thanks again > > Ulrich > -- > Searchengine Know How - Webpromotion - Optimization - Internal Search > World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg > http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 > > > _______________________________________________ > Zope-perl maillist - Zope-perl@zope.org > http://lists.zope.org/mailman/listinfo/zope-perl > From andym@ActiveState.com Wed Jun 27 22:16:34 2001 From: andym@ActiveState.com (Andy McKay) Date: Wed, 27 Jun 2001 14:16:34 -0700 Subject: [Zope-Perl] Aquisition? References: <5.0.2.1.0.20010627090531.00a2a300@post.netlink.se> <5.0.2.1.0.20010627225900.009f6640@post.netlink.se> Message-ID: <024301c0ff4e$943e80b0$ae03a8c0@activestate.com> My zope-perl installation is hosed at the moment, so I couldnt tell you... sorry couldnt guess off the top of my head without leading you astray. Cheers. -- Andy McKay. ----- Original Message ----- From: "Ulrich Wisser" To: "Andy McKay" ; Sent: Wednesday, June 27, 2001 1:59 PM Subject: Re: [Zope-Perl] Aquisition? > Hi Andy, > > >So sql isnt inside the reports folder? That wont work and wouldn't in > >python. > >You first have to get the root and then get the sql folder. > > How do I get the root folder? > > Thanks > > Ulrich > -- > Searchengine Know How - Webpromotion - Optimization - Internal Search > World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg > http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06 > > > _______________________________________________ > Zope-perl maillist - Zope-perl@zope.org > http://lists.zope.org/mailman/listinfo/zope-perl > From alany@qwest.net Thu Jun 28 01:41:39 2001 From: alany@qwest.net (Alan Young) Date: Wed, 27 Jun 2001 18:41:39 -0600 Subject: [Zope-Perl] Re: Getting wierd problem ... In-Reply-To: <020001c0ff4c$02fb87d0$ae03a8c0@activestate.com> References: <01062510150001.00175@harleypig> <020001c0ff4c$02fb87d0$ae03a8c0@activestate.com> Message-ID: <01062718413903.00179@harleypig> On Wednesday 27 June 2001 14:59, Andy McKay wrote: > You should be able to pass arguments exactly as the same as python args. > You can also pull out of the request if necessary, there is no difference > for var|call|in compared to anything else. Ok. Then I'm confused. This is what I'm trying to do, maybe that'll make things easier to explain. BTW, I've checked the code for dtml-in and it doesn't seem to do exactly what I want here. If it does, please let me know. Thanks. The prototype of what I want to do: sortObjects(ObjectTypeList, PrecedenceList, AttributeList) sortObjects returns a sequence of objects (like objectValues) of the ObjectsTypeList, sorted by AttributeList with PrecedenceList listed first. example: would return a sequence of all Folder's, File's and Image's sorted by id and then size (well, that doesn't make much sense, but you get the idea) with all Folder's listed first (the remaining entries ordered without regard to meta type). Within the in tag I should be able to access the objects properties as I would with objectValues ( would give me the title or id for the returned object). Because I won't be using any modules, just sort, grep and/or map I should be able to use a Script (Perl) object. I've tried both the old and the new one just announced here last week. Maybe you can point out my fallacy. Create a Script (Perl) object. Id: sortObjects Title: Arguments: ObjectTypeList, PrecedenceList, AttributeList Code: This is where it gets interesting. If I do my @objs = split /,\s*/, $ObjectTypeList; my @prec = split /,\s*/, $PrecedenceList; my @atts = split /,\s*/, $AttributeList; my $a; $a .= "$_:" for @objs, @prec, @atts; return $a; I get the expected results (objectValues(\@objs) and I get the following PerlError: Global symbol "$self" requires explicit package name at sortObjects line 8. Ok. Fair enough. Add 'self' to the argument list. It saves. When I try to run my dtml method however, I get the following PerlError: Can't locate object method "objectValues" via package "Folder, File,Image" (perhaps you forgot to load "Folder, File,Image"?) at sortObjects line 8. Huh? I thought $self was always available. *shrug* The wording of this error message indicates to me that the first fields are being shoved into $self (see above re expected results). Ok, wander around and finally discover on #zope that this() can be used to pass in self. Try it as the first parameter. Now I'm getting '[]' returned from the above code. Try moving self and this() to the end of their respective parm lists. Nope. Same thing. I'm stumped. I'm obviously missing something really easy but I can't figure out what. Any ideas? -- A mind is a wonderful thing to waste. From dano@brightfire.com Thu Jun 28 03:48:06 2001 From: dano@brightfire.com (Daniel Lord) Date: Wed, 27 Jun 2001 19:48:06 -0700 Subject: [Zope-Perl] Re: installing pyperl on Mac OSX--anybody have success? Message-ID: <200106280248.WAA21114@renown.cnchost.com> I have Python 2.1 installed from source and using Mac OSX Perl: The install in Python-Object fails miserably: ( cd Python-Object ; perl Makefile.PL ; make install ) Picking up pyton include files from "/usr/local/bin/include/python2.1" Writing Makefile for Python::Object cc -c -I"/usr/local/bin/include/python2.1" -g -pipe -pipe -fno-common -traditional-cpp -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -O3 -DVERSION=\"1.00\" -DXS_VERSION=\"1.00\" -I/System/Library/Perl/darwin/CORE -DMULTI_PERL Object.c In file included from /usr/local/bin/include/python2.1/Python.h:24, from Object.xs:8: /usr/local/bin/include/python2.1/config.h:159: warning: `_POSIX_THREADS' redefined /usr/include/sys/unistd.h:87: warning: this is the location of the previous definition In file included from Object.xs:10: ../lang_lock.h:67: parse error before `last_py_tstate' ../lang_lock.h:67: warning: data definition has no type or storage class make: *** [Object.o] Error 1 This seems terribly wrong and I don't wnat to be patching *.h files. Anybody have success with this? From gisle@ActiveState.com Thu Jun 28 07:32:20 2001 From: gisle@ActiveState.com (Gisle Aas) Date: 27 Jun 2001 23:32:20 -0700 Subject: [Zope-Perl] Re: installing pyperl on Mac OSX--anybody have success? In-Reply-To: Daniel Lord's message of "Wed, 27 Jun 2001 19:48:06 -0700" References: <200106280248.WAA21114@renown.cnchost.com> Message-ID: Daniel Lord writes: > I have Python 2.1 installed from source and using Mac OSX Perl: > > The install in Python-Object fails miserably: > > ( cd Python-Object ; perl Makefile.PL ; make install ) > Picking up pyton include files from "/usr/local/bin/include/python2.1" > Writing Makefile for Python::Object > cc -c -I"/usr/local/bin/include/python2.1" -g -pipe -pipe -fno-common > -traditional-cpp -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -O3 > -DVERSION=\"1.00\" -DXS_VERSION=\"1.00\" > -I/System/Library/Perl/darwin/CORE -DMULTI_PERL Object.c > In file included from /usr/local/bin/include/python2.1/Python.h:24, > from Object.xs:8: > /usr/local/bin/include/python2.1/config.h:159: warning: > `_POSIX_THREADS' redefined > /usr/include/sys/unistd.h:87: warning: this is the location of the > previous definition > In file included from Object.xs:10: > ../lang_lock.h:67: parse error before `last_py_tstate' > ../lang_lock.h:67: warning: data definition has no type or storage class > make: *** [Object.o] Error 1 > > This seems terribly wrong and I don't wnat to be patching *.h > files. Anybody have success with this? Does you perl has thread support? 'perl -V' should say something about USE_ITHREADS. --Gisle From dano@brightfire.com Thu Jun 28 15:51:01 2001 From: dano@brightfire.com (Daniel Lord) Date: Thu, 28 Jun 2001 07:51:01 -0700 Subject: [Zope-Perl] Re: installing pyperl on Mac OSX--anybody have success? In-Reply-To: Message-ID: <200106281451.KAA16232@repulse.cnchost.com> On Wednesday, June 27, 2001, at 11:32 PM, Gisle Aas wrote: > Does you perl has thread support? 'perl -V' should say something > about USE_ITHREADS. Thanks Gisle, you guessed right: hint=recommended, useposix=true, d_sigaction=define ==> usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef SInce that is Apple's build, looks like I'll have to find out 1) if I can get the source they used (maybe from Darwin) and recompile to use threads or 2) get the generic Perl 1.5.6 source and struggle with all the OSX idiosyncracies in cc and the libs. I wish Apple would fix this, OSX is most non-unix unix I have ever tried to build unix apps on I still like it better than Windows though ;-)