Re: [Zope] A basic question

2012-07-14 Thread Andrew Milton
+---[ Kristian Thy ]--
| On Sat, Jul 14, Giampiero Benvenuti wrote:
|  I have a python script in my zope instance:
|  
|  dt=DateTime(2012,1)
|  print dt
|  print dt.strftime('%Y')
|  print dt.year()
|  
|  return printed
|  2012/01/01 00:00:00 GMT+2
|  2011
|  2012
|  
|  Why do I get two different values for the year (2011, 2012)?
| 
| It would seem strftime defaults to a timezone to the left of GMT+2.

strftime converts to UTC

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Question about Upgrading Zope and OS X Server

2010-12-07 Thread Andrew Milton
+---[ Tres Seaver ]--
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| On 12/07/2010 01:18 PM, Dan Gaibel wrote:
| 
|  I have recently inherited the responsibility of supporting a fairly
|  complex web server running Zope 2.8.6 on Python 2.3.5. This
|  configuration is currently on a Linux (Fedora Core) server and I
|  would like very much to migrate to OS X Server Snow Leopard. It also
|  seems to me that I should consider upgrading Zope to a more current
|  release while I'm at it. We heavily use MySQL and associated
|  products, LocalFS, and the Python Imagining Library. We have a
|  variety of ZClass homegrown products as well.
|  
|  I know that I'm in for a headache no matter what, but I wonder if any
|  of you folks could point me in the right direction or offer advice on
|  the situation. Is it crazy to jump from 2.8.6 to 2.12? Does anyone
|  use OS X Server for Zope? Is this migration a mistake? Any pitfalls I
|  should be looking out for?
| 
| I would do this in small steps, e.g. first migrate to the new machine / OS:
| 
| - - Get Python 2.3.x installed on the OS/X server.
| 
| - - Build the latest Zope 2.8.* on that server.
| 
| - - Install and test products there in the same versions  you now use.
| 
| - - Copy your old database over and test.
| 
| then upgrade the software stack:
| 
| - - Move carefully through the Zope releases (I would to 2.9, 2.10, and'
|   2.12), upgrading Python as needed  to stay on a supported version.
| 
| - - Check for upgrades to the products, and their compatibility with
|   Zope versions.  Test them, and your site. after each upgrade.

The move from 2.9 to 2.10 is likely to be the most painful part in
terms of legacy Zope apps. A lot of products will break on 2.10

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some newbie tal help

2010-10-05 Thread Andrew Milton
+---[ Mark Phillips ]--
| I have a table and I am putting data into the cells using tal. I want to bold 
the data under a certain condition. I tried this,
| but it didn't work:
| 
| td tal:content=string:${player/name}b 
tal:condition=python:str(player['name']) == 'Team'name/b/td

Try using css

tddiv tal:replace=string:${player/name} tal:attributes=class 
python:test(player['name'] == 'Team', 'someboldcss', '') //td



-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some newbie tal help

2010-10-05 Thread Andrew Milton
+---[ Andrew Milton ]--
| +---[ Mark Phillips ]--
| | I have a table and I am putting data into the cells using tal. I want to 
bold the data under a certain condition. I tried this,
| | but it didn't work:
| | 
| | td tal:content=string:${player/name}b 
tal:condition=python:str(player['name']) == 'Team'name/b/td
| 
| Try using css
| 
| tddiv tal:replace=string:${player/name} tal:attributes=class
|  python:test(player['name'] == 'Team', 'someboldcss', '') //td

s/tal:replace/tal:content/

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some newbie tal help

2010-10-05 Thread Andrew Milton
+---[ Mark Phillips ]--
| 
| 
| On Tue, Oct 5, 2010 at 10:28 AM, Andrew Milton a...@theinternet.com.au 
wrote:
| 
| +---[ Mark Phillips ]--
| | I have a table and I am putting data into the cells using tal. I want 
to bold the data under a certain condition. I tried
| this,
| | but it didn't work:
| |
| | td tal:content=string:${player/name}b 
tal:condition=python:str(player['name']) == 'Team'name/b/td
| 
| Try using css
| 
| tddiv tal:replace=string:${player/name} tal:attributes=class 
python:test(player['name'] == 'Team', 'someboldcss', '')
| //td
| 
| 
| Is CSS preferred over using tal:omit for some reason? When would I use 
tal:omit to add formatting to a table cell and when should
| I use CSS instead?

I think you want to use CSS. Later if you want to change from bold to
underlined or italics or rainbow, you can just change a CSS class,
instead of rebuilding your mark up.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] removing an exuserfolder from an exported ZEXP

2010-09-28 Thread Andrew Milton
+---[ Edward Colmar ]--
| Hey all!
| 
| I have an old export that I am trying to Import back into a new zope.
| 
| I'm getting an error from exUserFolder on import and it is not completing the 
install.
| 
| Is there a way to remove this from within the zexp?
| 
| The error I'm getting is:
| 
| Error Type: ImportError
| Error Value: No module named AuthSources.mysqlAuthSource.mysqlAuthSource
| 
| Or, alternatively, is there a way to get past this import error?
| 
| Any help would be greatly appreciated.

Install exUserFolder then delete it
If exUserFolder is installed, then you're probably missing the mySQL
python libs.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Storing DTML in SQL

2010-08-18 Thread Andrew Milton
+---[ Justin Dunsworth ]--
| I am currently working on a project where I am storing HTML within a MySQL 
database to display dynamic pages and content in
| sequences. I would like to be able to store DTML within the tables as well 
and be able to call them within the page to display
| that content. I tried mixing the DTML in with the HTML and it shows the HTML 
correctly but no DTML.
|
| Is it possible to even do this? Are there other suggestions on how to go 
about this?

I'm not condoning this in any way d8) but...

You have to actually execute the DTML as DTML. That means your
rendering code has to actually execute it and display the output, not
just dump the source into your page.

How to do that will probably require you to use some trusted code, that
means a Product or an External Method for Zope 2 (I assume Zope 2
since you're talking about DTML). 

You might have a bit of a mountain to climb there d8)

Are you sure you need to store the DTML in the db?

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Storing DTML in SQL

2010-08-18 Thread Andrew Milton
+---[ Garry Saddington ]--
| Garry Saddington wrote:
|  Justin Dunsworth wrote:
|  I am currently working on a project where I am storing HTML within a 
|  MySQL database to display dynamic pages and content in sequences. I 
|  would like to be able to store DTML within the tables as well and be 
|  able to call them within the page to display that content. I tried 
|  mixing the DTML in with the HTML and it shows the HTML correctly but no 
|  DTML.
|   
|  Is it possible to even do this? Are there other suggestions on how to go 
|  about this?
|  
|  The closest I have found is on Zopelabs 
|  (http://www.zopelabs.com/cookbook/1078612026)
| 
| Sorry wrong recipe try this:
| 
| http://www.zopelabs.com/cookbook/993850737/1011691351

Do I really have to explain why that particular recipe is a bad idea? d8)

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Storing DTML in SQL

2010-08-18 Thread Andrew Milton
+---[ Richard Harley ]--
| On 18/08/10 17:38, Andrew Milton wrote:
|  +---[ Garry Saddington ]--
|  | Andrew Milton wrote:
|  |  +---[ Garry Saddington ]--
|  |  | Garry Saddington wrote:
|  |  |  Justin Dunsworth wrote:
|  |  |  I am currently working on a project where I am storing HTML within 
a
|  |  |  MySQL database to display dynamic pages and content in sequences. I
|  |  |  would like to be able to store DTML within the tables as well and 
be
|  |  |  able to call them within the page to display that content. I tried
|  |  |  mixing the DTML in with the HTML and it shows the HTML correctly 
but no
|  |  |  DTML.
|  |  |
|  |  |  Is it possible to even do this? Are there other suggestions on how 
to go
|  |  |  about this?
|  |  |
|  |  |  The closest I have found is on Zopelabs
|  |  |  (http://www.zopelabs.com/cookbook/1078612026)
|  |  |
|  |  | Sorry wrong recipe try this:
|  |  |
|  |  | http://www.zopelabs.com/cookbook/993850737/1011691351
|  |
|  |  Do I really have to explain why that particular recipe is a bad idea? 
d8)
|  |
|  | Just trying to be helpful. I did say that it was the only thing I can
|  | find and I did not recommend it.
|  | If you would care to share the problems of the recipe on the list then I
|  | am sure all those reading who are new to Zope would benefit;)
| 
|  Since python scripts are web callable and something has to be passed
|  in... The phrase execute arbitrary code is nearly always quickly
|  followed by the phrase remote exploit and lots of sad faces (and
|  then some finger pointing d8)
| 
| 
| If that is the case, aren't all python scripts within Zope potentially 
| exploitable?

Not all python scripts execute arbitrary code *passed to them* 

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Storing DTML in SQL

2010-08-18 Thread Andrew Milton
+---[ robert rottermann ]--
| I think storing dtml in a db is wrong by design.
| I do lots of dynamic websites that are generated from external data.
| i had no need for a single line of dtml yet ...

I've seen it used a lot in PHP systems like PHP-Nuke, where the widget
code is executed out of strings in the db. Whether it's necessary or
not in this instance is debatable.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [JOB][OT?] Position for a Python/Zope developer in Pula, Cagliari (CA), Italy

2010-07-13 Thread Andrew Milton
+---[ Marco Bizzarri ]--
| 
| Well, it's interesting to see such a reaction; we've seen steep learning (and 
adapting) curve from an emacs/vi environment to an
| IDE like Eclipse; since we're a development shop working on Eclipse for all 
our projects (Java, PHP, Python), we required
| knowledge and practice of such a tool.
| 
| Anyway, I assure no emacs/vi guy got injured in writing this requirement ;)

If your IDE is so awful that you need to specifically mention that
your new developers know how to use it, I think you need a new IDE,
because that one is not doing its job d8)

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] javascript experts?

2010-05-22 Thread Andrew Milton
+---[ Garry Saddington ]--
| I am using some dynamic javascript to build form input controls and I 
| have got everything working perfectly in all browsers except IE. The 
| javascript uses square bracket notation to allow the 
| phones.number:records to build multiple database input records for Zope.
| 
| if (eval(document.forms.playlist['phones.number:records'][ + idx + 
| ].value)  0)
| 
| However,IE interprets it as:
| document.forms.playlist.phones.number:records
| and of course therefore does not find the element referenced.
| Can anyone suggest a workaround for IE in this respect.

Use ids as well as names and grab the items out of the DOM.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] cron like service

2010-05-05 Thread Andrew Milton
+---[ Garry Saddington ]--
| Can anyone suggest the easiest way to automatically have a python script 
| fire at set times of the day/month/year.

A cron job that uses (wget | curl | fetch | lynx | netcat | etc) to hit your 
script.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope for .NET

2010-04-16 Thread Andrew Milton
+---[ Brian Sullivan ]--
| I am looking for an open source .NET framework that includes user
| management, authentication, multiple configurable levels of security,
| tools for html generation and is data base agnostic or includes some
| sort of built in data base.
| 
| It would be nice if it had a host of open source add ins. Basically
| Zope functionality for .NET.
| 
| Is there anything like that out there -- or even something close?

Tried Zope? d8)

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problem Building 2.10.x

2010-03-24 Thread Andrew Milton
+---[ Susan Day ]--
| Hi;
| I'm trying to build 2.10.x on a CentOS 5.4 server. I get the error that I 
need to upgrade my Python from 2.4.3 to (I believe)
| 2.4.6. The problem is that I really can't do that using rpms unless I roll my 
own. Before doing that I wanted to consult you all
| and ask your advice.

2.4.3 should be fine as a substitute for 2.4.6 sans some bug fixes in python.

| PS Another option would be to build this on my Mac, but it doesn't
| look like Zope supports that platform.

Zope should work anywhere python works. And python definitely works
under OSX (given it's just unix under the hood).

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Dieter Mauer's Reference Product

2010-03-16 Thread Andrew Milton
+---[ Dieter Maurer ]--
| Brian Brinegar wrote at 2010-3-16 10:12 -0400:
|  ...
| Second, through path notation or URL traversal, References under the
| previous version of Zope would default to using methods / objects within
| the target before falling back to acquisition. Under Zope 2.11 acquired
| methods/objects take priority (only when traversed).
| 
| For example, assuming there is an index_html in the root as well as in
| the target, and using the following code:
| 
|  tal:content=container/MyReference/index_html/absolute_url_path
| 
| Zope 2.11 yields the path to the acquired index_html:
| 
|  /index_html
| 
| Zope 2.9.6 yields the path to the index_html in the target:
| 
|  /Path/To/Target/index_html
| 
| Again, through python, both yield the second, desired output.
| 
| This sounds strange -- almost unbelievable.
| 

2.10 is when TALES/TAL/ZPT were back-ported from Z3 into Z2, so not really
unbelievable d8) 

Otherwise working things break crossing the 2.9/2.10 barrier.

I imagine the behaviour will be present from 2.10 onwards.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] japanese encoding

2010-02-26 Thread Andrew Milton
+---[ Aaron Maupin ]--
| Hi guys,
| 
| I'm having trouble installing and using the japanese codecs (from
| http://www.python.jp/pub/JapaneseCodecs )with Zope on a shared host.  I
| just can't seem to get the encodings available for the python used by
| the Zope install.

[snip]

| 
| import japanese  #works
| 
| print japanese
| #module 'japanese' from
| 
'/home/USERNAME/webapps/zope/zinstance/parts/instance/lib/python/japanese/__init__.pyc'
| #however there's nothing in
| /home/USERNAME/webapps/zope/zinstance/parts/instance/lib/python/ except
| a README.txt saying this directory will hold additional installed
| packages... should there be something here?
| 
| text = 'blah blah'  #okay
| text = unicode(text, 'utf-8')  #okay
| text = text.encode('japanese.iso-2022-jp')  #fails with lookuperror

Tried simply; text.encode('iso-2022-jp') ?


-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] japanese encoding

2010-02-26 Thread Andrew Milton
+---[ Aaron Maupin ]--
| Andrew Milton wrote:
| 
| Tried simply; text.encode('iso-2022-jp') ?
| 
| Yes, I've tried that.  I get 'unknown encoding: iso-2022-jp'

japanese.python.iso-2022-jp

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] japanese encoding

2010-02-26 Thread Andrew Milton
+---[ Aaron Maupin ]--
| Andrew Milton wrote:
| +---[ Aaron Maupin ]--
| | Andrew Milton wrote:
| | 
| | Tried simply; text.encode('iso-2022-jp') ?
| | 
| | Yes, I've tried that.  I get 'unknown encoding: iso-2022-jp'
| 
| japanese.python.iso-2022-jp
| 
| Not sure why that would work

That's what the included test cases use...

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] japanese encoding

2010-02-26 Thread Andrew Milton
+---[ Aaron Maupin ]--
| Perhaps I should also mention that I can log into the server, open up a 
| python console, and type:
| 
|   import japanese
|   text = 'blahblah'
|   text = unicode(text, 'utf-8')
|   text = text.encode('japanese.iso-2022-jp')
| 
| with no problems.
| 
| 'japanese' is installed in /usr/lib/python2.4/site-packages/
| 
| I removed my recent /home/USERNAME/lib/python2.4 'japanese' install and 
| now 'import japanese', 'print japanese' within Zope reveals that Zope is 
| using the same /usr/lib/python2.4/site-packages/japanese as the python 
| console.
| 
| However I still get an encoding error in Zope Python scripts or External 
| Methods with the above code... code that works fine in the Python console.
| 
| Is there some sort of security within Zope that's stopping me from 
| accessing the encoding?

try doing

import japanese.aliases

and see if that causes an error that's otherwise being hidden.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] python help needed

2010-01-19 Thread Andrew Milton
+---[ Garry Saddington ]--
| I am trying to upload a csv file (called data) using the following script:
| 
| i=0
| d=data.readlines()
| for row in d:
|  i+=1
|  a=row.split(',')
|  if i  1:
|  subjectid=a[0]
|  entry=a[1]
|  type=a[2]
|  studentid=a[3]
|  try:
|  
|  
| 
context.insertestimatesandtargets(subjectid=subjectid,entry=entry,type=type,studentid=studentid)
|  except:
|  continue
| return something good
| 
| (email editor messed up indentation)
| 
| insertestimatesandtargets() is a ZSQLmethod. When the call to this 
| method results in an error the script stops and not all data is 
| inserted. Without an error all the data is inserted.
| So how can I make this script skip over errors and continue? The reason 
| is that there may already be some data in the database table that I want 
| to preserve.

The try/except block should prevent the script from failing when calling
the ZSQL method (assuming your indenting *is* correct in the python
script [look for mixed tabs/spaces, since in the email some of your
indents are 8 and some are 4]).

Your other option is to do transaction sub-commits manually (there's
plenty of google links for how to do this).

You probably can't do this directly from a python script, you'll have to
setup an External Method to do it (or alter the security for the
transaction machinery).

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error in Copy/Import during Migration

2010-01-07 Thread Andrew Milton
+---[ Brian Brinegar ]--
| I'm fairly well versed on the inner workings of Zope, but yesterday I've
| run into a problem that I can grasp.

[snip]

| Anyway, here's what I see. The copy starts, a tempfile is created (on
| the client) and grows to the appropriate size (3.1GB). Then, a
| Data.fs.temp appears on the new server and grows to the appropriate
| size. However, when my script tries to commit the transaction I get an
| EOF error:

File size limits on the new server restricting to say 2GB?


-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error in Copy/Import during Migration

2010-01-07 Thread Andrew Milton
+---[ Christopher N. Deckard ]--
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| On 1/7/10 2:30 PM, Andrew Milton wrote:
|  +---[ Brian Brinegar ]--
|  | I'm fairly well versed on the inner workings of Zope, but yesterday I've
|  | run into a problem that I can grasp.
|  
|  [snip]
|  
|  | Anyway, here's what I see. The copy starts, a tempfile is created (on
|  | the client) and grows to the appropriate size (3.1GB). Then, a
|  | Data.fs.temp appears on the new server and grows to the appropriate
|  | size. However, when my script tries to commit the transaction I get an
|  | EOF error:
|  
|  File size limits on the new server restricting to say 2GB?
| 
| No.  It's an x86-64 RedHat 5 install.  We've had 250GB files on this system.

Got any errors in your ZEO log ?


-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error in Copy/Import during Migration

2010-01-07 Thread Andrew Milton
+---[ Christopher N. Deckard ]--
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| On 1/7/10 2:30 PM, Andrew Milton wrote:
|  +---[ Brian Brinegar ]--
|  | I'm fairly well versed on the inner workings of Zope, but yesterday I've
|  | run into a problem that I can grasp.
|  
|  [snip]
|  
|  | Anyway, here's what I see. The copy starts, a tempfile is created (on
|  | the client) and grows to the appropriate size (3.1GB). Then, a
|  | Data.fs.temp appears on the new server and grows to the appropriate
|  | size. However, when my script tries to commit the transaction I get an
|  | EOF error:
|  
|  File size limits on the new server restricting to say 2GB?
| 
| No.  It's an x86-64 RedHat 5 install.  We've had 250GB files on this system.

Also have you done a cmp(1) of the chunk and the data.fs.tmp file to
make sure you're not just seeing a sparse file of the right size that's
internally truncated?

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Error in Copy/Import during Migration

2010-01-07 Thread Andrew Milton
+---[ Christopher N. Deckard ]--
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| On 1/7/10 2:39 PM, Andrew Milton wrote:
|  +---[ Christopher N. Deckard ]--
|  | -BEGIN PGP SIGNED MESSAGE-
|  | Hash: SHA1
|  | 
|  | On 1/7/10 2:30 PM, Andrew Milton wrote:
|  |  +---[ Brian Brinegar ]--
|  |  | I'm fairly well versed on the inner workings of Zope, but yesterday 
I've
|  |  | run into a problem that I can grasp.
|  |  
|  |  [snip]
|  |  
|  |  | Anyway, here's what I see. The copy starts, a tempfile is created (on
|  |  | the client) and grows to the appropriate size (3.1GB). Then, a
|  |  | Data.fs.temp appears on the new server and grows to the appropriate
|  |  | size. However, when my script tries to commit the transaction I get an
|  |  | EOF error:
|  |  
|  |  File size limits on the new server restricting to say 2GB?
|  | 
|  | No.  It's an x86-64 RedHat 5 install.  We've had 250GB files on this 
system.
|  
|  Got any errors in your ZEO log ?
| 
| Aha!  Our zeo log shows that we are running out of space in /tmp.  What
| is the best way to redefine the location for temp files for the ZEO server?

Set the TMPDIR env var to point to where you want tmp files created in
the shell script that starts your ZEO server

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] exUserFolder and Zope 2.12

2010-01-01 Thread Andrew Milton
+---[ William Heymann ]--
|
|  On Thursday 17 December 2009, Andrew Milton wrote:
|  +---[ Baiju M ]--
|  
|  | Hi,
|  | In exUserFolder there are few exceptions raised like this:
|  |
|  | raise 'LoginRequired', self.docLogin(self, request)
|  |
|  | This will not working in Zope 2.12 (Python 2.6)
|  |
|  | Any idea, how to change it ?
|  
|  Replace the raise with;
|  
|  request.RESPONSE.setStatus(401)
|  request.RESPONSE.setHeader('Content-Type','text/html')
|  request.RESPONSE.write(self.docLogin(self,request))
|  
| 
| I just tried that and it works in Firefox, Chrome and Opera but it is failing
| in IE and Konqueror. I tried a few versions of each of these browsers and
| the results are consistent. I don't see why it is failing though.
| 
| I tried exactly what is up there along with also trying self.docLoginRedirect 
| instead of docLogin. I used wireshark to watch the connection and I don't see 
| anything wrong with it.

[SNIP]

|
| If I go to the page that the Refresh refers to in any of the browers that 
| works fine. The raise form works fine on older versions of zope with no 
issues 
| on any of these browers. Konqueror and IE will both have their icons spinning 
| on that page like they are waiting for something.
| 
| Any ideas or help would be appreciated. I have tried lots of things to get
| it working.

Try adding more padding ... 

IE (not sure about Konq) has this annoying habit of giving you a nice
page instead of the one we want... it used to be if the page was  512
bytes it would give you its own page...

I'll try to look into it over the weekend...

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] exUserFolder and Zope 2.12

2010-01-01 Thread Andrew Milton
+---[ Andrew Milton ]--
| +---[ William Heymann ]--
| |
| |  On Thursday 17 December 2009, Andrew Milton wrote:
| |  +---[ Baiju M ]--
| |  
| |  | Hi,
| |  | In exUserFolder there are few exceptions raised like this:
| |  |
| |  | raise 'LoginRequired', self.docLogin(self, request)
| |  |
| |  | This will not working in Zope 2.12 (Python 2.6)
| |  |
| |  | Any idea, how to change it ?
| |  
| |  Replace the raise with;
| |  
| |  request.RESPONSE.setStatus(401)
| |  request.RESPONSE.setHeader('Content-Type','text/html')
| |  request.RESPONSE.write(self.docLogin(self,request))
| |  
| | 
| | I just tried that and it works in Firefox, Chrome and Opera but it is 
failing
| | in IE and Konqueror. I tried a few versions of each of these browsers and
| | the results are consistent. I don't see why it is failing though.
| | 
| | I tried exactly what is up there along with also trying 
self.docLoginRedirect 
| | instead of docLogin. I used wireshark to watch the connection and I don't 
see 
| | anything wrong with it.
| 
| [SNIP]
| 
| |
| | If I go to the page that the Refresh refers to in any of the browers that 
| | works fine. The raise form works fine on older versions of zope with no 
issues 
| | on any of these browers. Konqueror and IE will both have their icons 
spinning 
| | on that page like they are waiting for something.
| | 
| | Any ideas or help would be appreciated. I have tried lots of things to get
| | it working.
| 
| Try adding more padding ... 
| 
| IE (not sure about Konq) has this annoying habit of giving you a nice
| page instead of the one we want... it used to be if the page was  512
| bytes it would give you its own page...
| 
| I'll try to look into it over the weekend...

I have 2.10 not 2.12, but for FF, Shiretoko (64 bit FF 3.5.5), 
IE7/IE8 (32 and 64 bit), Safari (4.0.4) all work fine with this method.

Konquerer does seem to have an issue, but, I don't know enough about
Konquerer to work out what to try.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DateTime Issues

2009-12-23 Thread Andrew Milton
+---[ Justin Dunsworth ]--
| I am having difficulties with time zones and rendering proper times/dates. My
| time zone is GMT-6 (CST)... mysql reports the proper time/date, running
| dtml-var expr=e.strftime('%c') shows Zope has the right date, running a
| query straight from the SQLMethod shows the proper time in relation to the
| field in mysql. However, when I try and run the variable in the dtml document
| it gives the time in GMT+0.
| ? 
| For example... in mysql I have 2009-12-23 10:41:06 as the? date of
| the? record.? Running the SQL Method returns it as '2009/12/23 10:41:06 GMT+0'
| -- So far so good but when I run dtml-var comment_date fmt=%m-%d-%y %H:%M
| in my document it gives: 12-23-09 04:41.
| ? 
| I can get fmt=ISO (and other similar time functions) working and showing the
| proper date/time but I'd rather have a little more control over how the time 
is
| displayed. Is there any suggestions on what to do? I've looked? many places 
and
| couldn't find the answer.
| ? 
| I am running Zope 2.11.4-final, python 2.4.4, win32
| ? 

using fmt / strftime on Zope DateTime strips the timezone info and
converts to localzone before rendering, which is why your times are out
by 6 hours... your distance from GMT.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DateTime Issues

2009-12-23 Thread Andrew Milton
+---[ Justin Dunsworth ]--
| Ah-ha... that would make sense. Is there a way to display it without stripping
| the timezone information or at least add another time preset?

Not with the same level of flexibility.

The DateTime object contains everything you need to build it up
yourself though.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] DateTime Issues

2009-12-23 Thread Andrew Milton
+---[ Lennart Regebro ]--
| On Wed, Dec 23, 2009 at 18:24, Justin Dunsworth
| justin.dunswo...@gmail.com wrote:
|  I am having difficulties with time zones and rendering proper times/dates.
|  My time zone is GMT-6 (CST)... mysql reports the proper time/date, running
|  dtml-var expr=e.strftime('%c') shows Zope has the right date, running a
|  query straight from the SQLMethod shows the proper time in relation to the
|  field in mysql. However, when I try and run the variable in the dtml
|  document it gives the time in GMT+0.
| 
|  For example... in mysql I have 2009-12-23 10:41:06 as the?date of
|  the?record.?Running the SQL Method returns it as '2009/12/23 10:41:06 GMT+0'
|  -- So far so good but when I run dtml-var comment_date fmt=%m-%d-%y
|  %H:%M in my document it gives: 12-23-09 04:41.
| 
| What would you expect it to be? It seems correct to me.

He expects (as most of us expect at first) the time not to be
converted to the local zone just because you want to format the
time display.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] exUserFolder and Zope 2.12

2009-12-17 Thread Andrew Milton
+---[ Baiju M ]--
| Hi,
| In exUserFolder there are few exceptions raised like this:
| 
| raise 'LoginRequired', self.docLogin(self, request)
| 
| This will not working in Zope 2.12 (Python 2.6)
| 
| Any idea, how to change it ?

Replace the raise with;

request.RESPONSE.setStatus(401)
request.RESPONSE.setHeader('Content-Type','text/html')
request.RESPONSE.write(self.docLogin(self,request))

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] learning BASIC computer skills.

2009-12-15 Thread Andrew Milton
+---[ Donald Evans ]--
| hello,im donald evans.evansdonal...@yahoo.com. i would LOVE to know computer
| basics!  I'M VERY AMBITIOUS. AND HAVE THOUSANDS OF EMAILS.OVER 90% OF THEM
| [ARE] FOR ONLINE OPPERTUNITIES. AND IVE BEEN TAKEN FOR A FEW RIDE'S/RIP OFF
| OFFER'S OR THAY WERE REAL. I JUUST DIDENT KNOW HOW TO SET UP A WEB
| SITE,PAGE,E.T.C. I DID HAVE ONE I REMBER THAT I WOULD HAVE DONE BECAUSE THAY
| WERE THE ONLY ONE THAT TOLD ABOUT HOW YOU NEED TO SET UP A TAX DEAL,OR WHAT
| EVER,I CAINT THINK OF THE WORD IM TRYING TO DESCRIBE. ANY WAY IS THERE ANY ONE
| THAT CAN SEND ME [ANY] INFORMATION ABOUT THE SUBJECT'S I'VE BEEN TALK'ING
| ABOUT  I AM ON DISABILITY. AND IM NOT MARRIED AND AT 51 I DOUGHT THATI 
EVER
| WILL. BUT WHAT IM TRYING TO GIT ACCROSS IS THIS, I AM BROK,AND DONT HAVE BUT
| MABE 50 BUCK'S TO START UP A BUSSINESS. BUT I KNOW I NEED A NEW TOWER BEFORE I
| CAN!!! I DONT EVEN KNOW WHAT THE Cc AT THE TOP OF A REPLY IS REALLY FOR. SO
| THAT TELL'S YOU HOW MUCH I KNOW. BY THE WAY I DO TAKE CARE OF MY 86 YEAR OLD
| MOTHER, AND MENTALLY CHALLINGED SISTER. SO THIS CAUSES IN PART, MY ABILTY TO
| LEARN, AND KEEP UP.THATS ANOUTHER STORY IN ITSELF. ANY ADVISE AT [A L L]  ANY
| ADVISE WOULD BE OF GREAT HELP.THANK'S FOR LISTENING!!!
|   
 
|  Sincerly, Donald Evans.  

Oh man I needed that... haha

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] UTF-8 problem with zope2.10 and postgresql

2009-11-07 Thread Andrew Milton
+---[ Tres Seaver ]--
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| Andrew Milton wrote:
|  +---[ Martijn Pieters ]--
|  |  
|  |  2009/11/6 Garry Saddington ga...@schoolteachers.co.uk:
|  |  I've always been amused by this 'outdated' technology thing, with
|  |  respect to dtml. Someone had better tell Linus to change his programming
|  |  language for the kernel, it's getting a bit old by now. How about c#,
|  |  that should do it.
|  | 
|  | It's a question of resources and maintainability. Few people have the
|  | time or the inclination to keep DTML going. Ergo, it'll die and we let
|  | you know so you can migrate away from it.
|  
|  More likely, someone spiteful will deliberately break it or simply
|  remove it between releases without notice, that seems to be the Zope
|  Way
| 
| Really?  When have we deliberately broken stuff between releases without
| notice?  We've been pretty damned careful about BBB issues, AFAIK.

I don't really want to fill up an email with a litany of stuff, I'm
sure many people have their own pet-peeves about stuff being axed out,
but, I'll give you one.

PageTemplateFile stops Zope from starting if the file they refer to
does not exist, rather than the 'at-access-time' error they used to
generate. When you have place holder code and templates in abstract
base-classes, this sucks the big one let me tell you.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Accessing object properties from __init__.py

2009-09-29 Thread Andrew Milton
+---[ Ajay Deshpande ]--
| Hi All:
| 
| I would like to access a certain property of an object from the __init__.py of
| my Products folder. Is this possible?

To get to it from inside Product code you can import the object

from Products.MyProduct import SomeExportedObject

From any other code you're probably out of luck.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] strange database read conflict error

2009-08-28 Thread Andrew Milton
+---[ Peter Bengtsson ]--
| It's very very hard to reproduce. You have to have really good test
| coverage but even in running tests it's hard because of the fact that
| they're single threaded.
| If I were you I'd look into something some stresstesting tool and
| bombard your localhost till you find where it's causing most of the
| conflict errors.
| NB. Conflict errors aren't errors.

Conflict Errors ARE errors, unless of course you don't care about data
integrity, in which case probably nothing is an error.

Later versions (than 2.8) have fewer Read Conflict problems

Sean Hastings did a fairly good write up a number of years ago;

https://mail.zope.org/pipermail/zope/2004-September/153704.html

Might be a bit dated now, but, might help put things into perspective.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Getting Zope code to output to event.log

2009-08-10 Thread Andrew Milton
+---[ Ken Winter ]--
| Andrew  Chris ~
| 
| Thanks, but it still doesn't work for me.  See details of what happened when
| I tried each of your suggestions below.

[snip]

|  
|  You can also try changing logger.info to logger.warn or logger.error
| 
| 
| Next, I tried logger.warn, and restarted Zope.  
| 
| No change.

I would suggest then that your zope user does not have write access to
the OFS directory (or the files), and cannot create new .pyc files and 
is using the existing ones (without the logging).

Or that you are not changing the code that is being executed...

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Getting Zope code to output to event.log

2009-08-10 Thread Andrew Milton
+---[ Ken Winter ]--
| I do have write access to the Zope files I'm =editing, as I can see the
| updated timestamp change when I save them.  

But Zope might not...

| 
| However, I do notice that there are NO .pyc files in the directories that
| contain the files that I am editing.  I'm way out of my depth here: Does the
| lack of .pyc files mean that the .py files here are not the ones being
| compiled/executed?

It's odd that there are no .pyc files, at a minimum the install normally
byte-compiles them as part of the install.

Perhaps you are editing the unpacked source, instead of the installed
Zope code.

Check your zopectl or runzope script and see what ZOPE_HOME is set to.
The that *should* be the root of your installed zope.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Getting Zope code to output to event.log

2009-08-05 Thread Andrew Milton
+---[ Ken Winter ]--
| To debug my code in my Zope/Plone site, I sometimes need to put logger lines
| into Zope/Plone code, in order to trace my way through an error traceback. 
| 
|  
| 
| I can do this easily with Plone code in the Plone Products folder: Just put in
| the logger line, restart Zope, run my tests, and the output appears in the 
Zope
| event.log.  But when I try the same thing with native Zope code (for example,
| in the OFS directory), the output doesn?t show up in event.log.
| 
|  
| 
| I figure these modules have to be reinstalled or re-somethinged to get my
| changes activated, but I don?t know how to do this.  Can you help?

[this assumes the code is actually being called]

You are probably logging at a level below the level that will be output
into the log.

LOG.info() is about the lowest level that will go out by default.

Without seeing any examples from you it's hard to tell.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Getting Zope code to output to event.log

2009-08-05 Thread Andrew Milton
+---[ Ken Winter ]--
|
|  -Original Message-
|  From: Andrew Milton [mailto:a...@theinternet.com.au]
|  Sent: Wednesday, August 05, 2009 3:49 PM
|  To: Ken Winter
|  Cc: 'Zope List'
|  Subject: Re: [Zope] Getting Zope code to output to event.log
|  
|  +---[ Ken Winter ]--
|  |
|  | I figure these modules have to be reinstalled or re-somethinged to get
|  my
|  | changes activated, but I don?t know how to do this.  Can you help?
|  
|  [this assumes the code is actually being called]
|  
|  You are probably logging at a level below the level that will be output
|  into the log.
|  
|  LOG.info() is about the lowest level that will go out by default.
|  
|  Without seeing any examples from you it's hard to tell.
| 
| Here's an example of the traceback from the error I'm trying to debug.  I
| assume the fact that a module appears in the traceback proves that it is
| being called.

And you have your logging level set to what?

Look in your zope.conf for eventlog it should be similar to;

eventlog
  level INFO
  logfile
path $INSTANCE/log/event.log
  /logfile
/eventlog

You can also try changing logger.info to logger.warn or logger.error

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] moving a zope install

2009-07-30 Thread Andrew Milton
+---[ Garry Saddington ]--
| Before I investigate any further perhaps someone here may be able to 
| save me a little time.
| Is it possible to move a zope installation from one directory to another 
| and have zope.conf pick up the correct paths dynamically?
| I've looked at the zope on a cd but I want the db to be writeable.

Not sure what operating system you're using, but, if you're on a
unix-like system, you can use a UnionFS mount to overlay the CD with a
writable area. You can then either replace the zope.conf with your own
one or the Data.fs with a writable one. This assumes you want to run it
from the CD and not just copy it to a running Zope.

Alternatively you can construct a zope.conf that sets up clienthome
variable for the mountpoint with some known location (reference to
the tmpdir, or a known application area), before you write it to the CD

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Disable local loopback connections

2009-07-28 Thread Andrew Milton
+---[ Tom ]--
| Greetings. I hate computers and especially networks but I love software 
| languages and programming. Zope is tolerable as a medium to allow me to 
| express creative language use.  Thanks for listening. :-)
| 
| BTW, I would like to be able to test my server's connectivity from the 
| Internet. Something goofy occasionally happens with the damned 
| computer/firewall/network interface/network card, etc. etc. etc... A 
| reboot puts things back in order.

Your IP changed and your firewall didn't change its rules to match?

| So, I would like to be able to submit a request via the httplib Python 
| module and have it _not_ use the local loopback. There must be a way to 
| preface a request URL with the gateway or something but I'd have to go 
| back to school to figure it out. And I'm tired of school. It's 
| expensive and not all instructors are worth their class time.

Is there a question in there, or just a statement about things you like
and don't like?

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTP Request Denial of Service Vulnerability

2009-07-24 Thread Andrew Milton
+---[ ryan_per...@mcafee.com ]--
|
| 1.  This is likely a false positive, unless the original poster was running 
ridiculously old software.  

Ridiculously old software is not outside the realms of probability

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] HTTP Request Denial of Service Vulnerability

2009-07-19 Thread Andrew Milton
+---[ Chris McDonough ]--
| This may be true.  However, I notice that whomever makes the Foundstone 
website 
| can't spell either (Costumer for Customer in the How you found out about 
| us dropdown). ;-)  So... guilty till proven innocent as far as I'm concerned.

Don't blame me, I'm not the costumer involved...

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zeo client tracking

2009-06-17 Thread Andrew Milton
+---[ Mikael Kermorgant ]--
| Hello,
| 
| We're using a zope 2.10 setup with a zeo server and several zeo clients behind
| lvs.
| 
| Sometimes, we'd like to track which zeo client handled teh request, and we're
| going to need it as we'd like to proove that ha-proxy handles session
| persistance.
| 
| Is there a way to add a header in the http response or the html code to do 
that
| ?

Well the Zope Request has a bunch of things you can use;

Adding in something into your template that stamps the page with
it should be simple enough.

e.g.

div tal:content=request/HTTP_HOST style=display:none /

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] call http_host script

2009-06-05 Thread Andrew Milton
+---[ iarly selbir | ski0s ]--
| I added following code to a python script and when try to save it returns
| 
| Prints, never read 'printed' variable.
| 
| Code:
| 
| req = context.REQUEST
| addr = req.get('URL')
| print addr

return printed


-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] bug? pagetemplate using strftime

2009-05-07 Thread Andrew Milton
+---[ Miguel Beltran R. ]--
| 
| 
| If you strftime to show the hour and minute too, you will see as I
| previously said it is showing you the time in UTC (as determined by how
| many hours is it out).
| 
| 
| 
| I made a test  with date 2009/05/07 using
| dtml-var fecha.timezone  -- dmYzZ=dtml-var fecha fmt=%d/%m/%Y %z %Z --
| c=dtml-var fecha fmt=%c -- xdtml-var fecha fmt=%x -- Xdtml-var fecha
| fmt=%X
| 
| and show this
| bound )= 07= 05= 2009= datetime(= of= datetime.timezone= 
method=
|  -- dmYzZ=06/05/2009   -- c=05/06/09 19:00:00 -- x05/06/09 -- X19:00:00/
| bound
| 
| here I  see what you said me, the hour is gmt-0500.
| 
| 
| If add in zope.conf
| environment
|   TZ America/Mexico_City
| /environment
| 
| or in runzope.bat
| @set TZ=America/Mexico_City
| 
| nothing change, render the same what before add TZ
| 
| now, how I can show the correct date? help please
| I use MS Sql Server 2000 with field smalldatetime
| I never used before timezone.

You can't use stftime.
You have to manually build a string with the format you want using the
other methods inside DateTime.

e.g. fetcha.aCommonZ() or build up your date using
components such as; fetcha.day()  fetcha.month()  fetcha.year()

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] bug? pagetemplate using strftime

2009-04-22 Thread Andrew Milton
+---[ Miguel Beltran R. ]--
| 
| 
| 'item.fetcha' is what kind of instance? DateTime? datetime?
| 
| How to reproduce the behavior?
| 
| We need something that works on any system.
| 
| 
|  I don't know what type is.
| How can know?
| 
|  
| tr tal:repeat=item container/getData
|   td tal:content=python: item.fecha.strftime('%d-%m-%Y'
| );09-01-2009/td
|   td tal:content=item/fecha2009/01/10/td
| /tr
| 
| getData is a zsql method what connect to postgresql using zpsycopgda 2.0
| conecction with enconding utf-8 serializable (with zope internal datetime
| option enabled and disabled) and not work :(
| 
| This problem happen too with ms sql server 2000 with zpyodbc. Using %d break
| the day.

If you strftime to show the hour and minute too, you will see as I
previously said it is showing you the time in UTC (as determined by how
many hours is it out).

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] bug? pagetemplate using strftime

2009-04-20 Thread Andrew Milton
+---[ Miguel Beltran R. ]--
| Hi list,
| 
| This is a bug in strftime? add to report to launchpad?
| 
| tr tal:repeat=item container/getData
|   td tal:content=python: item.fecha.strftime('%d-%m-%Y');09-01-2009/td
|   td tal:content=item/fecha2009/01/10/td
| /tr
| 
| can someone confirm this?
| using a database postgresql 8.3
| zope 2.11.1
| windows 2003

Zope DateTime objects revert to UTC when using strftime in all versions
of Zope. It's known, and doesn't seem to be thought of as a bug.

The response I received about this was something to the effect of write your 
own DateTime

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-12 Thread Andrew Milton
+---[ Dieter Maurer ]--
| Andrew Milton wrote at 2009-4-11 21:46 +1000:
|  ...
| So your position is, the code is fine, but, the docs suck so don't use
| it. Well the docs have always sucked, the zope-3 docs don't seem any
| better. Perhaps the people deprecating and removing interfaces willy-nilly 
| should document the replacements and how to change over existing consumers 
| of the removed interfaces, or re-implement the removed interfaces using
| the new way.
| 
| These are all issues for The Zope Foundation to address, not for you to
| badger individuals who don't agree with your dogma-de-jour. Badger the
| people responsible to do something. 
| 
| The people driving the Zope Foundation are (mostly) unfortunately heavily in
| favour of what they call cleaning up code and removing backward
| compatibility

Yes the improve with axe methodology has never worked in any other
project, I don't know why anyone thinks Zope2 would be different.

I can see having to write a shim product to get existing code to 
keep working until there's time to fix it all.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-11 Thread Andrew Milton
+---[ Chris Withers ]--
| Andrew Milton wrote:
| My position is that plenty of people use Zope 2 without plone, 
| 
| Your position appeared to be that it's a good idea to tempt new users 
| into using plain zope 2. I assert that it's not because zope.org is 
| dead, the docs have barely changed in 7 years and,

So your position is, the code is fine, but, the docs suck so don't use
it. Well the docs have always sucked, the zope-3 docs don't seem any
better. Perhaps the people deprecating and removing interfaces willy-nilly 
should document the replacements and how to change over existing consumers 
of the removed interfaces, or re-implement the removed interfaces using
the new way.

These are all issues for The Zope Foundation to address, not for you to
badger individuals who don't agree with your dogma-de-jour. Badger the
people responsible to do something. 

Better still start a project and ask for help, you'll certainly get
further than trying to order around other people to do what you want.

| in a specific case, 
| LocalFS has become unmaintained and doesn't work in current Zope 2 releases.

Lots of perfectly stable, very useful Products fall into this category from 
2.10/11 
onwards. I suppose in your new self-appointed role of wtf you think you
are, you'll attempt to randomly assign new maintainers for all that code too.

| | I already maintain a lot of code, 
| | 
| | such as?
| 
| So you really don't go to zope.org.
| 
| That doesn't answer my question. What public code do you actively maintain?

It does (for Zope related code) if you bothered to look, but, as is all
too obvious in most of your emails YOU don't want to DO anything.

| | and I have my own LocalFS-type code so I 
| | don't see the need to maintain a different one.
| | 
| | Then why not release this and advertise is as a maintained alternative 
| | to LocalFS?
| 
| Why bother? 
| 
| Because it's broken on current Zope releases and no-one is maintaining 
| it, meaning every person who wants to use it has to individually patch 
| it and maintain their own local copy.

You're the one with the bug up their arse about it, YOU fix it and
release it, or stfu about it. You could have completely rewritten it in
the time it took you to write all these pointless emails.

I don't use LocalFS, I'm not going to try to maintain it. 

As for the other code, that's not code I want to release as Open
Source.

Since you're more than capable of maintaining LocalFS, you seem to be up in
arms about it, you're making more noise than anyone else, time to put up 
or shut up. 

Contact the maintainer, ask to take it over, gather the patches, get it
working, make a release, maintain it.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-11 Thread Andrew Milton
+---[ Chris Withers ]--
| Andrew Milton wrote:
| +---[ Chris Withers ]--
| | Andrew Milton wrote:
| | My position is that plenty of people use Zope 2 without plone, 
| | 
| | Your position appeared to be that it's a good idea to tempt new users 
| | into using plain zope 2. I assert that it's not because zope.org is 
| | dead, the docs have barely changed in 7 years and,
| 
| So your position is, the code is fine, but, the docs suck so don't use
| it. 
| 
| No, my position if much simpler than that: Zope 2 is dying/dead, and new 
| users shouldn't try and use it. Gmane's graph quite aptly demonstrates this:
| 
| http://dir.gmane.org/gmane.comp.web.zope.general
| 
| You asserted that this is not the case, I invited you to prove this by 
| solving some of the problems that have come up for discussion. You have 
| refused to do so. I think that speaks volumes.

Straw Man.

Issuing a one line patch for LocalFS does not prove anything except that
I can make LocalFS work and put a tarball up for download. LocalFS
ultimately has nothing to do with Zope 2 user take up.

Writing all the docs for it likewise is a job better suited to the many
authors you claim to be around. And likewise proves nothing about the
state of Zope 2.

Perhaps, as I've said before, you should question The Zope Foundation on
what they're doing to promote Zope, to improve the documentation, to
maintain code that might be useful, but, have lost maintainers.

If you want a debate, learn to argue in a meaningful way, and stop just
whining about it.

Is the rate of take up of Zope 2 slowing? Yes probably.

Is the code base such that it's not suitable for production use? No.
Is the code base such that noone should use it all as you assert? No.

Feel free to provide something more substantial than mailing list volume
as an argument, before you insult all the people that still work on it
and with it.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-03 Thread Andrew Milton
+---[ Chris Withers ]--
| Andrew Milton wrote:
| | Plenty of people use it without plone. You might want to crawl out of
| | the vacuum you live in.
| | 
| | Yes, and I'm one of them, but I don't think it's fair to try and tempt 
| | new users into it...
| | 
| | I'm happy to be proven wrong by you writing lots of decent docs, picking 
| | up maintenance of zope.org and LocalFS ;-)
| 
| You're good at volunteering people to do work. 
| 
| I'm not volunteering anyone, I'm saying that if you want to stick by 
| your position then you need to be the one to prove it's true.

My position is that plenty of people use Zope 2 without plone, and I
need to prove that, by writing the docs and maintaining the zope.org 
community resource owned by The Zope Foundation and by usurping the control 
of 3rd party software? I'm not sure of how exactly that proves my point.

In fact it sounds like *you* want something done, but, aren't willing to
do it yourself. Oh I already made that point.

| I already maintain a lot of code, 
| 
| such as?

So you really don't go to zope.org.

| and I have my own LocalFS-type code so I 
| don't see the need to maintain a different one.
| 
| Then why not release this and advertise is as a maintained alternative 
| to LocalFS?

Why bother? LocalFS seems to be sufficient for what people use it for,
and other people are looking after it.

| would happily take it over, in the same way I've given my code over to
| other people to maintain.
| 
| You mean code you've stopped maintaining? ;-)

Yes it's a bit pointless to hand over the code I'm still maintaining.

| As for docs, an army of people continually volunteer on #zope to update
| the zope book.
| 
| ...and then don't follow through on it.

Welcome to the Bazaar.

| Given my other contributions to Zope society, 
| 
| ...
| 
| I'm happy to be a knowledge resource for anyone wanting to update the
| existing book / write a new freely available document.
| 
| A safe offer to make given the number of authors we have floating around ;-)

You can't have it both ways. We have plenty of authors, but, no docs. So
why bother a non-author with stupid non-sequiturs? 

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] LocalFS unsupported and doesn't work without patching...

2009-04-02 Thread Andrew Milton
+---[ Chris Withers ]--
| Dieter Maurer wrote:
|  Chris Withers wrote at 2009-4-2 20:24 +0100:
|  Dieter Maurer wrote:
|  I am very happy about stable packages because I often extend them.
| 
|  For example, I have extended LocalFS to allow configuration of
|  its instances via environment variables. This allows us to synchronize
|  our ZODBs in the test and development environments with the production
|  environment (helpful to perform tests and resolve issues) even though
|  the file system layout is different.
|  Then why not pick it up, release it and support it, since no-one else is 
|  doing so? ;-)
|  
|  I am fine with the current situation (with respect to LocalFS,
|  not with respect to Zope)...
| 
| Then you're part of the Zope problem ;-)

As opposed to random deprecation and removal of interfaces that causes
otherwise working code to break ?

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope 4.0, maybe not such a bad idea...

2009-04-02 Thread Andrew Milton
+---[ Chris Withers ]--
| Remember this:

| Seriously, how do people feel about this?

You can do anything you want with your time... who are we to judge? d8)

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-02 Thread Andrew Milton
+---[ Chris Withers ]--
| Jim Fulton wrote:
|  We and canonical use the Zope Framework.  We don't use an  
|  application.  Zope (aka Zope 2) is an extensible application. We (ZC  
|  and Canonical and others) assemble components from the Zope Framework  
|  to build our own applications.
| 
| Hmm, maybe I got this wrong, but Gary Poster expressed a strong concern 
| that zope 3 the app server needed to keep living.
| 
| I do think the name Zope should never be used on its own again.
| 
| I think Zope Classic would certainly work for Zope 2 the app server, 
| it conveys the right things:
| 
| - mature
| - stable
| - maybe not the best choice for new development.
 ^ for you

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-02 Thread Andrew Milton
+---[ Chris Withers ]--
| Andreas Jung wrote:
|  Andrew  others have been working on this issue at the sprint. There is
|  consensus that www.zope.org must be turned into landing page with some
|  mission statement and then links to the related subprojects. The current
|  zope.org site should be moved to old.zope.org (it must remain
|  available for the time being (with URL redirections to the Products
|  and Member area).
| 
| Why does it need to keep living even at old.zope.org?

Why do you care if it does?

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-02 Thread Andrew Milton
+---[ Chris Withers ]--
| Andrew Milton wrote:
| | - mature
| | - stable
| | - maybe not the best choice for new development.
|  ^ for you
| 
| Indeed, but classic doesn't have any bad connotations as far as I'm 
| concerned, and it'll need to keep living as long as Plone relies on it, 
| which will be forever...

Plenty of people use it without plone. You might want to crawl out of
the vacuum you live in.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] [Zope-dev] Zope 4.0, maybe not such a bad idea...

2009-04-02 Thread Andrew Milton
+---[ Chris Withers ]--
| Andrew Milton wrote:
| | Indeed, but classic doesn't have any bad connotations as far as I'm 
| | concerned, and it'll need to keep living as long as Plone relies on it, 
| | which will be forever...
| 
| Plenty of people use it without plone. You might want to crawl out of
| the vacuum you live in.
| 
| Yes, and I'm one of them, but I don't think it's fair to try and tempt 
| new users into it...
| 
| I'm happy to be proven wrong by you writing lots of decent docs, picking 
| up maintenance of zope.org and LocalFS ;-)

You're good at volunteering people to do work. 

I already maintain a lot of code, and I have my own LocalFS-type code so I 
don't see the need to maintain a different one. If I was using it, I
would happily take it over, in the same way I've given my code over to
other people to maintain.

As for docs, an army of people continually volunteer on #zope to update
the zope book. Given my other contributions to Zope society, there are
people far better suited to writing technical documentation than I.

I'm happy to be a knowledge resource for anyone wanting to update the
existing book / write a new freely available document.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to add existing folder in Zope

2009-03-30 Thread Andrew Milton
+---[ Tim Nash ]--
|

[snip long story about noone paying attention to the actual requirements]

I notice none of them installed plone either.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to add existing folder in Zope

2009-03-28 Thread Andrew Milton
+---[ Tim Nash ]--
| No your response and Jens response are totally inappropriate. We will never
| rebuild this community if all our posts are greeted with personal attacks.

You're not going to rebuild any community if given a choice of two
items, they're told to install the largest most complicated of them.

| Using plone for the said usecase is not inappropriate especially since using a
| directory view does not require using all of plone.

Yes, Jens failed to factor in ideology and laziness into the use-case.

| Please keep your arguments reasonable and focused on the technology or the
| management of that technology.

OK.

LocalFS works. It's small. It does the task that was asked for. There
are various patches around that increase its performance to close to that 
of serving static content directly out of Apache.

Serving from Apache works. It's external to Zope. It does the task that
was asked for, but, can't be managed from inside Zope or it requires the
Zope install to share a filesystem with Apache (to manage from zope).

Plone works. It's huge. It's complicated. It does 1000x more things than 
was asked for and is not a solution that should be recommended to simply 
serve files from the file system.

Get a grip. You might want to install plone to do it, but, 99 times out
of 100 that isn't the correct solution to recommend to *anyone* that
just wants to serve files from the file system.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to add existing folder in Zope

2009-03-28 Thread Andrew Milton
+---[ Tim Nash ]--
| Andrew,
|   If you are going to ignore my arguments about Plone being well tested, easy
| to install and having a better upgrade path than a customized solution like
| patching localFS, then this is just a waste of everybody's time.

translation: If you don't agree with Tim he will stick his fingers in
his ears and go la la la la I'm not listening

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] 404 error

2009-03-21 Thread Andrew Milton
+---[ ga...@schoolteachers.co.uk ]--
| Quoting Andreas Jung li...@zopyx.com:
| 
|  -BEGIN PGP SIGNED MESSAGE-
|  Hash: SHA1
| 
|  On 21.03.2009 13:21 Uhr, ga...@schoolteachers.co.uk wrote:
|  I am trying to verify my site with google but keep getting this error:
| 
|  We've detected that your 404 (file not found) error page returns a 
|  status of 200
|  (Success) in the header.
| 
|  How could I correct this?
| 
| 
|  How to reproduce? URL? Zope does not send a 200 response:
| 
|  aj...@suxmac2:/tmp wget -S http://www.zope.de/does-not-exist
|  - --2009-03-21 13:54:31--  http://www.zope.de/does-not-exist
|  Resolving www.zope.de... 213.187.85.150
|  Connecting to www.zope.de|213.187.85.150|:80... connected.
|  HTTP request sent, awaiting response...
|   HTTP/1.1 404 Not Found
|   Date: Sat, 21 Mar 2009 12:54:31 GMT
|   Server: Zope/(Zope 2.8.6-final, python 2.3.5, linux2) ZServer/1.1
|  Plone/Unknown
|   Bobo-Exception-Line: 644
|   Content-Length: 18937
|   Bobo-Exception-Value: See the server error log for details
|   Content-Language: de
|   Bobo-Exception-File: HTTPResponse.py
|   Bobo-Exception-Type: NotFound
|   Expires: Sat, 01 Jan 2000 00:00:00 GMT
|   Content-Type: text/html;charset=utf-8
|   Connection: close
|  2009-03-21 13:54:31 ERROR 404: Not Found.
| 
| This is the URL I have submitted to Google:
| 
| http://www.reidcarleasing.co.uk/googleb6e4b8f92f9cedbf.html


Your webserver is configured poorly...

Response Headers
Connection  Close
X-R4L-VHOST reidcarleasing.co.uk
Content-Typetext/html
Content-Length  488
DateSat, 21 Mar 2009 13:12:06 GMT
Server  lighttpd

Which redirects using META to your zope (84.45.131.100:8080)
directly.. which THEN gives;

Response Headers
Server  Zope/(Zope 2.9.0-, python 2.4.5, linux2) ZServer/1.1
DateSat, 21 Mar 2009 13:12:06 GMT
Bobo-Exception-Line 656
Content-Length  1039
Bobo-Exception-ValueSee the server error log for details
Content-Typetext/html; charset=iso-8859-15
Bobo-Exception-Type NotFound
Bobo-Exception-File HTTPResponse.py

Which also shows;

(Also, the following error occurred while attempting to render the
standard error message, please see the event log for full details: Not
Found)

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] session data object question

2009-03-11 Thread Andrew Milton
+---[ Dvir Bar-lev ]--
| Hi
| 
|  
| 
| I was wondering if there is a way to connect the creation of a session object
| to a button push.
| 
| I?ll explain in more detail:
| 
|  
| 
| I have a log in from called login_form, and I have a dtml method called
| looged_in that is called when we push the submit button in the log in form.
| 
| What I did is the following, in the log_in_form I get a session data object
| only if it exsists and I check how much time passed and act accordingly, in 
the
| looged_in method I create the data session oblject ans set the start time.
| 
| Unfortuantly that is not good for me because if a user refreshes the page it
| resets the time in the session object, I was wondering if there is a way for 
me
| to know if I can reset the session data time only when the user clicks the
| submit button and not as a result of a refresh call.

Name the submit button and check for the name of the button in the request.

input type=submit name=theButton value=Press Me

theButton will appear in REQUEST (and REQUEST.form) if the button was
pressed.


-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] session data object question

2009-03-11 Thread Andrew Milton
+---[ Dvir Bar-lev ]--
| Hi
| 
| I have a button like that but the the problem is that it also has this
| value if I refresh the page, what I mean Is this, I put in the logged_in
| page:

That is highly unlikely, unless you are refreshing AFTER you submit the
form, in which case you are essentially re-submitting the form.

I would suggest setting a cookie with a timestamp.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] session data object question

2009-03-11 Thread Andrew Milton
+---[ Lennart Regebro ]--
| On Wed, Mar 11, 2009 at 09:32, Dvir Bar-lev dvi...@puresight.com wrote:
|  What I need is a way to know if we loaded the page as a result of
|  pressing the button or as a result of refreshing the page, as I need to
|  do different things in each case.
| 
| There is no difference between a refresh and a normal page load.

Unless you refresh after the form submit :-)

Of course if the broken design posted to a handler script instead of to
itself, a lot of problems could be side-stepped :-)

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Avoiding page redirects from TAL

2009-03-10 Thread Andrew Milton
+---[ Analog Kid ]--
| Hi All:
| 
| I have a customized page template product which subclasses from
| ZopePageTemplate. In this product class, I have a method that redirects to a
| certain fixed page that I have created in the ZMI. One of the objects of this
| type makes calls to this method and also has some conditional redirects (based
| on certain request variables). Here is a representation
| 
| In my Product class, I have a method which conditionally redirects ...
| 
| def check_and_redirect(self):
| request = self.REQUEST
| if request.get('redirect_to_fixed_page', False):
| request.RESPONSE.redirect('http://somefixedurl_in_my_domain')
| 
| def getValue(self):
| self.check_and_redirect()
| # do some more stuff
| 
| 
| return 'some value'
| 
| My ZPT looks like this ...
| ...
| tal:call tal:define=data python:mytemplate.getValue()/
| ...
| ...
| ...
| ...
| tal:redir tal:condition=python:here.REQUEST.has_key('var')
| tal:dummy tal:define=test python:here.REQUEST.RESPONSE.redirect('http://
| someotherurl)/
| /tal:redir
| ...
| ...
| ...
| 
| 
| What is happeninig is that the redirect in the PT is taking precedence over my
| redirect (which Im doing in the method). My question is: Can I make sure that
| my redirect takes precedence without modifying the PT itself. Is there any
| other ZopePageTemplate method which I can patch so that my own redirect kicks
| in first??

add a flag to getValue that says don't redirect

def getValue(self, redirect = False):
   if(redirect):
   self.check_and_redirect()

or pass it up to check_and_redirect

Which means you have to change other calls that aren't in the ZPT
If you're happy to change the one ZPT, you can reverse the flag to be
True and pass False in from the ZPT.

It depends which way is more work.

You'll also find that doing a redirect and then adding more stuff to the
response will cause the redirect to not work under certain browsers
under certain conditions. It's best to terminate processing as soon as
possible when you decide to redirect, so it's probably unwise to
redirect without returning some status to the caller than indicates the
rest of the processing is redundant.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Avoiding page redirects from TAL

2009-03-10 Thread Andrew Milton
+---[ Analog Kid ]--
| hi andrew:
| 
| thx for your help. i dont want to call the method from the PT ... infact I 
dont
| want to modify the PT at all ... i just need to figure out a
| ZopePageTemplate.py method which I can patch so I can do the redirect even
| before the PT is rendered.
| 
| any ideas??

I'm not sure how to detect if a redirect is necessary, I haven't
trundled through the RESPONSE object enough, but, if you can work it
out, you can probably grab the _exec method from PageTemplate, check 
and return empty there, or let it continue through to rendering.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] timeout on a page

2009-03-09 Thread Andrew Milton
+---[ Dvir Bar-lev ]--
| Hi all.
| 
|  
| 
| First of all let me say that I found the solution to my user roles problems by
| using the  coockiecrumbler plugin,  so that?s behind me now J

Goodo.

| I need help with something else, I will explain what I want to accomplish:

[snip]

| Any ideas how I can do this 2 things?

Do some reading, or advertise for a competent zope coder.

I'm all for helping people, but, you don't seem to be doing the minimum
amount of preparation before asking for help.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] psycopg version mismatch (imported 2.0.6 (dec mx dt ext pq3))

2009-03-06 Thread Andrew Milton
+---[ amol kumbhar ]--
| This is my full error Log
| 
| Site Error Log at  /error_log


Yes you also need to update your ZPsycopg in your Zope products (it's
part of the psycopg distribution).

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] psycopg version mismatch (imported 2.0.6 (dec mx dt ext pq3))

2009-03-06 Thread Andrew Milton
+---[ amol kumbhar ]--
| nt-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding:
| quoted-printable Thanks for replying
| but I am still there .
| 
| My DA.py contain this list of allowed_psycopg_version :
| 
| 
| ALLOWED_PSYCOPG_VERSIONS = ('2.0.7','2.0.8','2.0.9')
| 
| 
| and the condition which is generating the ImportError from this file is :
| 
|  # check psycopg version and raise exception if does not match
| if psycopg2.__version__[:9] not in ALLOWED_PSYCOPG_VERSIONS:
| raise ImportError(psycopg version mismatch (imported %s) %
|   psycopg2.__version__)
| 
| could  you please guide me which version should I add in 
| ALLOWED_PSYCOPG_VERSION list

Don't do that unless you're not particularly fond of your data. 2.0.6 is
not in this list because it contains bugs or incompatibilities with the
2.0.9 version of ZPsycopg.

You have a psycopg 2.0.6 *somewhere* (the python package, not the Zope
adapter).

Either in your Zope's lib/python or in your site-packages for your python.

You need to make sure that that is *also* 2.0.9

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to check a user role with data entred by user?

2009-03-05 Thread Andrew Milton
+---[ Dvir Bar-lev ]--
| Hi all.
| 
|  
| 
| I have a question and I hope someone can help me out.
| 
| I?m new to zope and the all web thing, I?m using zope2.
| 
|  
| 
| What I did was this, I created a folder in the ZMI and there I created a user
| folder(acl_users), in the user folder I defined  2 new roles.
| 
| Now, I have a log in form where the user fills out user name and password, I
| want to check if the data he entered matches 1  of the roles I defined in the
| ZMI . I can?t find any info or example how to do it, not on the web nor in the
| documentation.
| 
|  
| 
| I would appreciate any help on the matter.

in a python script;

user = context.acl_users.getUser(theUserNameTheUserEnteredInTheForm)

if user.has_role(['Role1', 'Role2']):
  # User has role log them in I suppose
else:
  # Bad user! Bad!



-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to check a user role with data entred by user?

2009-03-05 Thread Andrew Milton
+---[ Dvir Bar-lev ]--
| First tx for the reply Andrew.
| How do I check that the password that was entered is the correct one for
| that role than?
| As it is presented in the reply the password of the role and the one
| that the user entered aren't any consideration at all

Right you didn't ask about logging them in :-)
You asked about checking the role :-)

You can't directly access the password in the user object from a python
script because it's protected (by virtue of being named '__', and the
getPassword method is named '_getPassword')

Logging them in from a form, without using a user folder product that
caters to that, or a PAS plugin, or using the Cookie Crumbler product,
is a little difficult to do and is probably not worth the effort given
the number of people who have already solved this problem for you.

Since you're new, I would look into PAS (Pluggable Auth Source) plugins
since it seems you want to do your own authentication.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] psycopg version mismatch (imported 2.0.6 (dec mx dt ext pq3))

2009-03-05 Thread Andrew Milton
+---[ amol kumbhar ]--
| 
| Hi
| 
| I am using zope 2.10 , python2.4 and psycopg2-2.0.9 . I had created entry in
| ZIM successfully but while connecting to db it is giving me following error.
| Please pull me out from this ASAP.
| 
| An error was encountered while publishing this resource.
| 
| Error Type: ImportError
| Error Value: psycopg version mismatch (imported 2.0.6 (dec mx dt ext pq3))

Your ZPsycopg and your psycopg don't match up version-wise.

You say you have psycopg 2.0.9 but 2.0.6 was imported...

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problem using dtml-in in ZSQL method

2008-12-12 Thread Andrew Milton
+---[ Fran?oise CONIL ]--
| Trying :
| 
| select * from mytable sqltest mylist multiple type=int column=id


select * from mytable WHERE sqltest mylist multiple type=int column=id
  ^

Missed a where statement... 

| Thanks for your reply

No problem.

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problem using dtml-in in ZSQL method

2008-12-11 Thread Andrew Milton
| - Original Message - 
| From: Fran?oise CONIL
| To: zope@zope.org
| Sent: Thursday, December 11, 2008 11:21 AM
| Subject: [Zope] Problem using dtml-in in ZSQL method
| 
| 
| Hello,
| 
| My ZSQL method receive a *mylist* parameter that should be an integer list :
| [21,35]
| 
| The following code does not work :
| 
| SELECT *
| FROM MyTable
| WHERE
|   id in
| (dtml-in mylist
| dtml-sqlvar sequence-item type=int dtml-if
| sequence-lastdtml-else,/dtml-if
| /dtml-in)

select * from mytable
dtml-sqlgroup where
dtml-sqltest mylist multiple type=int
/dtml-sqlgroup

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problem using dtml-in in ZSQL method

2008-12-11 Thread Andrew Milton
+---[ Andrew Milton ]--
| | - Original Message - 
| | From: Fran?oise CONIL
| | To: zope@zope.org
| | Sent: Thursday, December 11, 2008 11:21 AM
| | Subject: [Zope] Problem using dtml-in in ZSQL method
| | 
| | 
| | Hello,
| | 
| | My ZSQL method receive a *mylist* parameter that should be an integer list :
| | [21,35]
| | 
| | The following code does not work :
| | 
| | SELECT *
| | FROM MyTable
| | WHERE
| |   id in
| | (dtml-in mylist
| | dtml-sqlvar sequence-item type=int dtml-if
| | sequence-lastdtml-else,/dtml-if
| | /dtml-in)
| 
| select * from mytable
| dtml-sqlgroup where
| dtml-sqltest mylist multiple type=int
| /dtml-sqlgroup

Actually the sqlgroup is superfluous in this case;

name your mylist parameter as id 
and
select * from mytable sqltest id multiple type=int

or if you don't want to rename your parameter

select * from mytable sqltest mylist multiple type=int column=id

should work fine

-- 
Andrew Milton
a...@theinternet.com.au
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Call PageTemplateFile class instances

2008-11-13 Thread Andrew Milton
+---[ Peter Bengtsson ]--
| I've kind of work it out. The trick is to write some boiler plate in
| the class definition like this::
| 
| from zope import traversing, component, interface
| from zope.interface import implements
| from zope.traversing.interfaces import ITraversable
| 
| from Products.PageTemplates.PageTemplateFile import PageTemplateFile
| class MyProduct(Folder):
| 
|implements(ITraversable)
|component.provideAdapter(
| traversing.adapters.DefaultTraversable,
| (interface.Interface,),ITraversable)
| 
|meta_type = bla
|page = PageTemplateFile('zpt/foo.pt', globals())
| 
|def render_page(self):
| html = self.page(self.REQUEST) # ERROR!!


why do you do this double shuffle anyway, when you can directly call
page and protect it if necessary...

I certainly don't have the issue you're describing and I don't need to
do all that implements garbage either.

Are you sure you don't have some Product installed that's messing with
it?

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Call PageTemplateFile class instances

2008-11-13 Thread Andrew Milton
+---[ Peter Bengtsson ]--
| I've kind of work it out. The trick is to write some boiler plate in
| the class definition like this::


Does it work when you talk to it through Zope proper instead of trying 
to call it via the test harness?

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] standard_error using zpt

2008-10-29 Thread Andrew Milton
+---[ Miguel Beltran R. ]--
| Hi List
| 
| I remember what old versions from zope haved standard_error using DTML
| How can do it the same using ZPT?
| 
| I already try:
| td tal:content=error/type
| td tal:content=python: error.type
| td tal:content=context/error/type

From memory the following should be available;

options/error_type
options/error_value
options/error_tb
options/error_traceback
options/error_message
options/error_log_url


-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] .html from python

2008-10-17 Thread Andrew Milton
+---[ Garry Saddington ]--
| How would I do this:
| 
| dtml_method = context.singleitemview.html
| s = 
| return s 


dtml_method = getattr(context, 'singleitemview.html')
return dtml_method(client=context, REQUEST={}, foo='bar')

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Zope 2.x for Py 2.6 as 64 bit Windows application?

2008-10-10 Thread Andrew Milton
+---[ Jens Vagelpohl ]--
| -BEGIN PGP SIGNED MESSAGE-
| Hash: SHA1
| 
| 
| On Oct 10, 2008, at 17:00 , Chris Withers wrote:
| 
|  [EMAIL PROTECTED] wrote:
|  I'd be grateful for a rough idea on when there could be a Zope 2.x  
|  release
|  working with Python 2.6 as a 64-bit Windows application.
| 
|  Given that we don't even have Zope 2 on Python 2.5 yet, I'd suggest
|  purchasing some serious chiller units for hell or investing in some
|  bovine aviation devices...
| 
| Congratulations Chris, you have made the step from just being caustic  
| and antagonistic to actually being funny ;-)

Well it would have been funny if it was porcine aviation devices...

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] which platform independent database?

2008-09-23 Thread Andrew Milton
+---[ Jaroslav Lukesh ]--
| Hi all,
|  
| Does somebody know some free database and free database adapter for Zope,
| which exists for Linux and for windows too, please? Do you know some pros/cons
| and some wiev from praxis for that?
|  
| I know, Gadfly, but this is really tiny, with problematic backup (need to
| disconnect, make backup and connect), sometimes it make mishmash in
| datafiles and then you need your backup...
|  
| Many thanks, J. Lukesh

Postgresql ? (http://www.postgresql.org/)
Psycopg or SQLAlchemy both have adapters for Zope for Postgresql

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Displaying PIL Images in Zope Templates

2008-09-18 Thread Andrew Milton
+---[ Nico Grubert ]--
|The span renders PIL.Image.Image instance at 0x23b97500.
|How can I show the image?
| 
|   Call its tag method.
| 
|  span tal:replace=structure item/tag /
| 
| 
| Hi Paul,
| 
| how is the susi going? ;-)
| 
| I tried span tal:replace=structure item/tag / but I get the 
| following error:

You can't do this

What you need to do is associate the image with a URL so it gets
generated when the browser processes the img tag.. UNLESS it's very small
in which case you can use the src=... attribute to contain the data.

So a PIL image should be returned by a script or external method that
you can browse to. Headers such as Content-Type should be set to set the
image type.

Instead of generating the image on the call to your ZPT you form an img
src=/some/url/that/makes/my/image?foo=barbaz=bat e.g. in order to
generate the right image.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] pickle passing over a socket

2008-08-22 Thread Andrew Milton
+---[ David Bear ]--
| It seems to me that it could be usefull to have a zope method for passing
| python pickles to external processes through a unix domain socket. My thinking
| was to use this as a means to abstract a data base connection. Yes, I know
| there are zsql methods, sqlalchemy and other products to do this. But my
| thought was to have a generilzed method for just passing a pickle to an
| external process that could do anything with it. Perhaps it could pass a 
pickle
| to a queue that would handle the pickle if the site need some high volume
| handling of data.
| 
| Then one could have another python process listening on the socket -- ready to
| receive pickles for zope.

Isn't this called ZEO? d8)

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] pickle passing over a socket

2008-08-22 Thread Andrew Milton
+---[ Andreas Jung ]--
|
| ZEO could be a model for this - but ZEO stores the pickles to zodb. What
| if I wanted to queue the pickle up and take some kind of long term
| processing action on it? Store it in a network file system -- which may
| have a high write latency to, put it in a data base for which there were
| no zope connectors, etc.
| 
| Please be _very_ detailed about your particular use. At least from what 
| wrote so far: this sounds like an idea of the last century.

Sounds to me like someone just doesn't want to learn how to use RDBMS
d8)

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some help to get rid of an InvalidObjectReference exception

2008-08-20 Thread Andrew Milton
+---[ chaouche yacine ]--
|
|  As you see, I do not intentionally copy objects from one
|  ZODB to another... Except maybe if the session has a
|  separate storage and that this breaks everything. But then,
|  I could not even use the _getCopy method because nonZODBish
|  do not have a _p_jar attribute.

SESSION does use its own store.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] how to authenticate into zope as external user

2008-08-20 Thread Andrew Milton
+---[ vaibhav pol ]--
| hiii,
|   I am using zope-2.8.1 version and i wish to login into zope without
| facing the login window that zope provides
| i want to make  one DTML page which will be used as login page for ZOPE and
| when I will enter username and password in
| DTML page, this information should be used for zope
| authentication.ultimately i want one kind of hacking to directly
| enter  into zope 

http://www.zope.org/Products/user_management

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some help to get rid of an InvalidObjectReference exception

2008-08-20 Thread Andrew Milton
+---[ chaouche yacine ]--
|
| Ok here's how I did to finally fix it :
| 
| * create a new Transient Object Container (sessionTOC) at root
| * create a new Session Data Manager (sessionDM), with the following settings :
| ** Id : sessionDM
| ** Transient Object Container Path : /sessionTOC
| ** Place SESSION in REQUEST object as : ZODBSESSION
| 
| Now I can put ZODB objects in ZODBSESSION using something like : 
| 
| context.REQUEST.ZODBSESSION.set(object,o)
| 
| Thanks to all of you for your precious help.

Your main ZODB will grow everytime you add or remove something in
ZODBSESSION, you're essentially storing the same object twice in your
ZODB.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some help to get rid of an InvalidObjectReference exception

2008-08-20 Thread Andrew Milton
+---[ chaouche yacine ]--
|
| Correct. I Quit... :( better not to store ZODB objects in the session and try 
to get some way around.

So now you can go look at the Cache objects that Zope provides :-)

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some help to get rid of an InvalidObjectReference exception

2008-08-20 Thread Andrew Milton
+---[ chaouche yacine ]--
|  +---[ chaouche yacine ]--
|  |
|  | Correct. I Quit... :( better not to store ZODB objects in
|  the session and try to get some way around.
|  
|  So now you can go look at the Cache objects that Zope
|  provides :-)
|  
|  -- 
|  Andrew Milton
|  [EMAIL PROTECTED]
| 
| If you are talking about RAM cache, HTTP cache etc., I don't know if they'll 
do the trick because, again, it's about caching objects that do not live in the 
ZODB, i.e I cannot go in the ZMI and click the cache tab on a python script or 
a page template because that's not what I am trying to do.
| 
| But maybe there's the volatile attributes alternative, and that fails too 
then I have no choice but to do the caching mechanism myself...

Whatever you are doing, you are doing the wrong thing.

You are instantiating persistent objects and not storing them in the
ZODB. This is going to cause your ZODB to grow, so you might as well
store them.

Otherwise you need to make non-persistent versions of the objects you
are trying to 'cache' and use those instead.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Need some help to get rid of an InvalidObjectReference exception

2008-08-20 Thread Andrew Milton
+---[ chaouche yacine ]--
| 
|
| Not exactly. I am instantiating non persistent objects that do have a 
reference to persistence objects in the form of an attribute, and then trying 
to cache those non persistent objects.
| 
| Do the fact that these non persistent objects store a reference to persistent 
ones turn them into persistent ? I am curious to know.
| 
| Anyway, I tried the volatile attribute thing 
(http://wiki.zope.org/ZODB/VolatileAttributes) and first tests look fine.

You understand that _v_ attributes are only available in the thread they
were created, and will disappear when the object leaves the object
cache.

If you manage to get a 2nd thread there will be nothing in the _v_
attribute, or wait 10 or so mins between requests...

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] emails

2008-08-18 Thread Andrew Milton
+---[ Michael Arnoldy ]--

| What would do if you were getting as many as 27 of these every day?

I would have looked at the footer of the email where it points to the
mailing list and unsubscribed myself.

| ___
| Zope maillist  -  Zope@zope.org
| http://mail.zope.org/mailman/listinfo/zope


-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] emails

2008-08-18 Thread Andrew Milton
+---[ Michael Arnoldy ]--
| In all of my tries to stop the emails below, I may have blocked any replies 
you
| might have sent me.
| If so you can reach me at my secure address: [EMAIL PROTECTED]

Dickhead

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] python split

2008-08-17 Thread Andrew Milton
+---[ Garry Saddington ]--
| Is it possible to split a string at the first occurence of a non-digit 
| character using a python script in zope, or does this need an external method 
| for security purposes?

You can explicitly allow the re module if you want to split using a regex

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Script (Python) insecure ?

2008-08-12 Thread Andrew Milton
+---[ Andreas Jung ]--
| 
| My conclusion after almost 9 years with Zope: PythonScripts and trusted
| code was a good and nice feature in the early days of Zope. The future
| is clearly trusted code in all its flavors. RestrictedPython, 
| through-the-web editing (ZMI) and stuff like ZClasses should die

+oo

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Timeout on server when python script is running

2008-07-25 Thread Andrew Milton
+---[ [EMAIL PROTECTED] ]--
| 
| Hello everybody!
| 
| I have a python script running from a plone site..it takes a lot of time (1 
| hour maybe more) but I need to run it just for data recovery if something 
| goes wrong. after about 20 minutes a Timeout on server message pops up..
| 
| I tried and found where to change timeouts in zope.conf, but nothing changed. 
| Wrong place? Please help, thanks!

Try writing something (a '.') to the RESPONSE every few minutes to keep it
alive.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] VirtualHostMonster: access to all content in instance

2008-07-04 Thread Andrew Milton
+---[ Jonas Meurer ]--
| Hey Andrew,
| 
| thanks for your fast reply.
| 
| On 04/07/2008 Andrew Milton wrote:
|  | Is this a known issue? I consider that as a quite serious bug, as both
|  | project1 and project3 might be private and should not be published over
|  | the globally available apache rewriterule.
|  
|  Welcome to Acquisition 101.
|  
|  This is known behaviour, and in fact for most of us *wanted* behaviour.
|  You will have to restructure your Zope to avoid this, or set appropriate
|  permissions and acl_users to avoid cross-contamination of the sites.
| 
| Oh, too bad ...
| 
| How to deal with that '*wanted* behaviour' if I do have several public
| projects on the same zope instance but don't want all of them being
| accessible through the domain of every other project? For example two
| competing projects/organisations might be hosted on one and the same
| zope instance, and for sure project 'red' would hate it to make project
| 'green' available through their domain via http://www.red.org/green.

You setup your folders with an acl_users (I assume they actually do have
one).

/projects/red/acl_users

/projects/green/acl_users

Set up Green role on green
Set up Red role on red

Uncheck 'Acquire' from the permissions.

Remove Red permissions on green
Remove Green permissions on red

Make sure each user in the relevant project folder has the right role
too.

Then red.org/green would go

/projects/red/green/

Assuming your username/password pair doesn't exist in both acl_users the
red will authenticate you and give you the 'red' role which won't allow
you to view the green folder.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Annoying when objectValues() doesn't work

2008-07-03 Thread Andrew Milton
+---[ Peter Bengtsson ]--
| 2008/7/3 Andreas Jung [EMAIL PROTECTED]:
| 
| 
|  --On 3. Juli 2008 15:41:52 +0100 Peter Bengtsson [EMAIL PROTECTED] wrote:
| 
|  I'm getting an AssertionError on this!!!
|  After having used objectValues() for so many many years without much
|  trouble my confidence in it just dropped.
| 
|  After years of Zope, you know that we need a full traceback :-)
| 
| 
| The traceback will just say that the AssertionError happened. It
| doesn't mention anything interesting.
| 
| Traceback (innermost last):
|   Module ZPublisher.Publish, line 101, in publish
|   Module ZPublisher.mapply, line 88, in mapply
|   Module ZPublisher.Publish, line 39, in call_object
|   Module Products.ExternalMethod.ExternalMethod, line 225, in __call__
|- __traceback_info__: ((CMFSite instance at 9b924a0,), {}, None)
|   Module 
/home/peterbe/virtualenvzope/Gosh/zope278/Products/SeamusCore/Extensions/wf_script_despatcher.py,
| line 41, in workflowscripts2methods
| AssertionError

It does tell you the script and the line of the External Method that is
causing the problem when being instanced via _getOb() (from
objectValues)


-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Annoying when objectValues() doesn't work

2008-07-03 Thread Andrew Milton
+---[ Peter Bengtsson ]--
| 2008/7/3 Andrew Milton [EMAIL PROTECTED]:
|  +---[ Peter Bengtsson ]--
|  | 2008/7/3 Andreas Jung [EMAIL PROTECTED]:
|  | 
|  | 
|  |  --On 3. Juli 2008 15:41:52 +0100 Peter Bengtsson [EMAIL PROTECTED] 
wrote:
|  | 
|  |  I'm getting an AssertionError on this!!!
|  |  After having used objectValues() for so many many years without much
|  |  trouble my confidence in it just dropped.
|  | 
|  |  After years of Zope, you know that we need a full traceback :-)
|  | 
|  |
|  | The traceback will just say that the AssertionError happened. It
|  | doesn't mention anything interesting.
|  |
|  | Traceback (innermost last):
|  |   Module ZPublisher.Publish, line 101, in publish
|  |   Module ZPublisher.mapply, line 88, in mapply
|  |   Module ZPublisher.Publish, line 39, in call_object
|  |   Module Products.ExternalMethod.ExternalMethod, line 225, in __call__
|  |- __traceback_info__: ((CMFSite instance at 9b924a0,), {}, None)
|  |   Module 
/home/peterbe/virtualenvzope/Gosh/zope278/Products/SeamusCore/Extensions/wf_script_despatcher.py,
|  | line 41, in workflowscripts2methods
|  | AssertionError
| 
|  It does tell you the script and the line of the External Method that is
|  causing the problem when being instanced via _getOb() (from
|  objectValues)
| 
| I know. That was the script I showed and the code only has one obvious
| assert statement. That was my code the assert statement. The point is,
| it shouldn't happen, ever.

Except CMFSite is calling it according to your traceback..


-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Open an HTML file in zope

2008-06-18 Thread Andrew Milton
+---[ sujitha mary ]--
| Hi,
| 
| I need to open and display an HTML file in zope.For that I uploaded the file 
as
| DTML document and tried to retrieve it from a page template.this is code which
| i wrote for this:
| pre
|   span tal:condition=python:n=='geneprot' 
tal:replace=here/PH226this 
| will
|/span/pre
| 'PH226' is the name of my uploaded file.
| If i need to display more than one file at a time wht should i do?i tried to
| modify my code for displaying the files which is selected by the user thru' a
| form.But it didn't work:
| This is the piece of code which i used
| span tal:define=x request/phageid
| pre
|  span tal:condition=python:n=='geneprot' tal:replace=here/xthis  will
|   /span/pre/span

span tal:replace=python getattr(context, request['phageid']) /

OR if you have them stored in a list called pageids;

span tal:repeat='pageid request/pageids'
  span tal:replace=python getattr(context, pageid) /
/span


-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


  1   2   3   >