Re: [Zope-dev] refactoring site functionality

2009-06-05 Thread Martijn Faassen
Chris McDonough wrote:
 On 6/4/09 11:59 AM, Martijn Faassen wrote:
[snip]
 I don't think it's complicated. It's nice to install an object somewhere
 that stores data and has a UI and also be able to register it as a local
 utility. If you were to have mutable global configuration, you'd need
 some way to expose it to the UI and content-space too.
 
 This is true.  OTOH, I've never really been keen on the idea that the CA API 
 should be bent around the idea that you're going to often want to find a 
 persistent registry.  It seems just as reasonable to:
 
 - put a persistent object someplace (with its own UI) that isn't registered as
a CA utility.
 
 - find it via the location API when you need it in your code.

By location API, you mean something like mycurrentapp()['foo']['bar']?

 - *Pass* it to global utilities (or adapters) when you need to vary behavior
based on location.

Doesn't this make you have to scatter a lot of location-getting and 
context-passing code throughout your codebase? I guess it depends on how 
your codebase is factored.

But say you have a utility that sends email, and can be configured with 
the email address to send it to somewhere in a config screen, you could 
have 10 places in your code that need to get the configured email 
address and then pass it to the utility. Now that's probably easy enough 
to encapsulate in a function, but:

* but if you have your configuration right there in the local utility it 
comes pre-encapsulated. Now you got two bits, one that knows how to send 
email and one that is being configured. This separation into bits may be 
right in some cases, but it seems overkill in many.

* you're going to have to pass your current application context in each 
time you want to send email. That's avoided with a utility lookup (as 
this is implicit).

So, I'm having trouble seeing the benefits to this alternative approach, 
could you explain?

Regards,

Martijn

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


[Zope-dev] Zope Tests: 8 OK

2009-06-05 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Jun  4 12:00:00 2009 UTC to Fri Jun  5 12:00:00 2009 UTC.
There were 8 messages: 8 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Jun  4 20:47:01 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011867.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Jun  4 20:49:03 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011868.html

Subject: OK : Zope-trunk Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Jun  4 20:51:03 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011869.html

Subject: OK : Zope-trunk Python-2.5.4 : Linux
From: Zope Tests
Date: Thu Jun  4 20:53:03 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011870.html

Subject: OK : Zope-trunk Python-2.6.1 : Linux
From: Zope Tests
Date: Thu Jun  4 20:55:03 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011871.html

Subject: OK : Zope-trunk-alltests Python-2.4.6 : Linux
From: Zope Tests
Date: Thu Jun  4 20:57:04 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011872.html

Subject: OK : Zope-trunk-alltests Python-2.5.4 : Linux
From: Zope Tests
Date: Thu Jun  4 20:59:08 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011873.html

Subject: OK : Zope-trunk-alltests Python-2.6.1 : Linux
From: Zope Tests
Date: Thu Jun  4 21:01:08 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/011874.html

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


[Zope-dev] release zope.testing?

2009-06-05 Thread Wolfgang Schnerring
Hello,

I've recently fixed two bugs in zope.testing that I find annoying on
an almost daily basis (commandline option -1 doesn't work and readline
is broken in pdb).

Could someone review the changes on the trunk and cut a release of
zope.testing?

Thanks,
Wolfgang
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope] call http_host script

2009-06-05 Thread iarly selbir | ski0s
There are some variable similar $_SERVER['HTTP_HOST'] ( in php ) using
Plone?

Thanks in advance.


Regards,

- -
iarly selbir | ski0s

:wq!
___
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 Andreas Jung
On 05.06.09 14:40, iarly selbir | ski0s wrote:
 There are some variable similar $_SERVER['HTTP_HOST'] ( in php ) using
 Plone?
The 'request' object has everything you need.

-aj
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd.  Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:i...@zopyx.com
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

___
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 Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

iarly selbir | ski0s wrote:
 There are some variable similar $_SERVER['HTTP_HOST'] ( in php ) using
 Plone?

http://docs.zope.org/zope2/zope2book/source/BasicScripting.html#accessing-the-http-request


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKKULF+gerLs4ltQ4RAoaDAKCKsUpBH0Ehoeq1P7atU4jmMP31sQCfcbrO
r5zVeV4j6W8ViON0vxrPrRo=
=uaBa
-END PGP SIGNATURE-

___
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 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


Regards,

- -
iarly selbir | ski0s

:wq!


On Fri, Jun 5, 2009 at 1:07 PM, Tres Seaver tsea...@palladion.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 iarly selbir | ski0s wrote:
  There are some variable similar $_SERVER['HTTP_HOST'] ( in php ) using
  Plone?


 http://docs.zope.org/zope2/zope2book/source/BasicScripting.html#accessing-the-http-request


 Tres.
 - --
 ===
 Tres Seaver  +1 540-429-0999  tsea...@palladion.com
 Palladion Software   Excellence by Designhttp://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFKKULF+gerLs4ltQ4RAoaDAKCKsUpBH0Ehoeq1P7atU4jmMP31sQCfcbrO
 r5zVeV4j6W8ViON0vxrPrRo=
 =uaBa
 -END PGP SIGNATURE-

 ___
 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 )

___
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 )