[Zope3-Users] Logging level for transcript.log

2007-02-02 Thread Vinny
Hi,

Where can I find the configuration setting for the 
logging level used in the transcript.log file?

I have tried looking in etc/zope.conf, etc/zdaemon.conf
and came up empty handed.  I can see ERROR levels easily
enough.  This works and shows up in transcript.log:  

import logging

logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-8s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S', 

filename='/usr/local/www/Zope3/mv/lib/python/hello/utility/log',
filemode='a') 

logging.error('Pack my box with %d dozen %s', 5, 'liquor jugs')

But this does not show up in transcript.log:

logging.debug('Pack my box with %d dozen %s', 5, 'liquor jugs')

Both messages end up in my local log file.  I think I understand 
that the logging function is using mine and a logger registered
with zope.  Where do I find out about the zope logger?

Thanks in advance!

Vinny

P.S. Gosh this zope 3 stuff is hard.
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Sascha Ottolski
cc: to the list, hope you don't mind.

Am Freitag 02 Februar 2007 schrieb Peter Koppatz:
> > 
> >   Hi, please click
> > here!
> > 
>
>   tal:omit-tag="">Hi, please
>alt="click here"
>   i18n:attributes="alt"
>  i18n:translate="">click
>  tal:omit-tag="">here!
>
> untested but maybe it helps

thanks, but not what I'm looking for. that one would lead to 3 
independent msgids, not easy for a translator to make sense of :-(


Cheers, Sascha

-- 
Lalisio GmbH                                          www.lalisio.com

Puschkinstraße 1                             fon +49-(0)361/541 43 80
99084 Erfurt                                 fax +49-(0)361/541 43 79
                                                 [EMAIL PROTECTED]
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] zope.scheduler and triggering actions on local objects

2007-02-02 Thread Florian Lindner
Am Donnerstag, 1. Februar 2007 13:41 schrieb Alek Kowalczyk:
> Hi,
> I need to trigger periodically activities on various local components (i.e
> stored in ZoDB). I found zope.scheduler package which seem to be nice
> cron-like tool for Zope. But I did not find a clue how to use it with local
> components - in examples it is registered as global utility.
>
> I think about few ways of doing that. Please advice which one is the
> correct one: a) make zope.scheduler call via xml-rpc some URLs to trigger
> the activities 


> b) find (how?) local objects from scheduler global utility 
> and trigger activities c) register scheduler as local utility - it seems to
> be impossible for me, as it rather cannot be persistent, can it?

You can open a connection to the database and use it this way. Here is an 
example code that works but generated an error ofter some calls:

db = getUtility(ZODB.interfaces.IDatabase)
conn = db.open()
root = conn.root().data['Application']
zope.app.component.hooks.setSite(root)

utils = getUtilitiesFor(IYourInterface)
for i in utils:
print "Utility found:", i[0]
   
db.close()

but after some calls it gives an error:

exceptions.ValueError: I/O operation on closed file

Don't know why.


>  d) other solution?
>
> The solution b) is the one I feel is the right one. But how to find local
> objects? Can I hook into DatabaseOpenedWithRoot event and pass the database
> reference to global utility? If yes - how to deal with transactions...?

Regards,

Florian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Alex Furlong
>not really  :-)  your example is of course a valid solution, but in my 
>opinion an inconvenient one, when it comes to the poor translation guy. 

Now, you are getting gready, my friend. :)

I am not sure about the translater thing though. I would certainly prefer  nice 
message ids and not stuff like this:

msgid="Hi, please click here!"

You shold choose message ids that describe your semantics.

Bye

Alex
-- 
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: 
http://www.gmx.net/de/go/promail?ac=OM.GX.GX003K11711T4781a
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Marius Gedminas
On Fri, Feb 02, 2007 at 08:20:42AM +0100, Sascha Ottolski wrote:
> Sure. It might very well be my stupidity, but up to now I couldn't find a 
> solution to this problem. Note that it's not solved like most examples would 
> suggest with
> 
> 
>   Hi, please  i18n:name="click">click here!
> 
> 
> cause that would replace the whole  tag, so the tal:attributes gets lost 
> (and none of the docs I've seen so far has got an example for my case). If 
> I'm not mistaken, that would result in
> 
> msgid="Hi, please ${click} here!"
> 
> which is certainly not what I want.

How about

  
Hi, please click here!
  

?

That should give you two msgids:

Hi, please $click here!

and

click

.

Marius Gedminas
-- 
Life was simple before World War II. After that, we had systems.
-- Grace Murray Hopper, 1987


signature.asc
Description: Digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Sascha Ottolski
Am Freitag 02 Februar 2007 schrieb Alex Furlong:
> >I admit that I might be just too dumb to see the obvious
>
> Perhaps a little lazy to read! :)

not really :-) your example is of course a valid solution, but in my 
opinion an inconvenient one, when it comes to the poor translation guy. 
I think it is way more natural if you have to translate a sentence as a 
whole as in

msgid "Please visit About Plone for more 
information."

as to have this broken into pieces, like your solution does, where the 
translator needs to puzzle which pieces belong together (at least in my 
experience, they don't like that very much; especially if your 
extraction tool decided that the respecitve pieces spread all over 
the .po file...).

Anyway, thanks a lot for taking the time to answer.


Cheers, Sascha


>
> Case 4:
>
>  Please visit
>   
> i18n:translate="mysite_about_plone">About Plone
>for more information.
>  
>
> msgid "mysite_more_plone_info"
> msgstr "Please visit ${about-plone} for more information."
>
> msgid "mysite_about_plone"
> msgstr "About Plone"
>
> You just have to use tal:attributes="href ..." in the 'a' tag...
>

-- 
Lalisio GmbH                                          www.lalisio.com

Puschkinstraße 1                             fon +49-(0)361/541 43 80
99084 Erfurt                                 fax +49-(0)361/541 43 79
                                                 [EMAIL PROTECTED]
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] PT, i18n and dynamic attributes...how to?

2007-02-02 Thread David Johnson
I'm very experienced at this stuff myself, I must admit.  However it  
seems Stephan's online book discusses it here: http://wiki.zope.org/ 
zope3/webgui.html in the later part of the chapter.


--
David
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Alex Furlong
>I admit that I might be just too dumb to see the obvious

Perhaps a little lazy to read! :)

Case 4:

 Please visit 
  
About Plone
   for more information.
 

msgid "mysite_more_plone_info"
msgstr "Please visit ${about-plone} for more information."

msgid "mysite_about_plone"
msgstr "About Plone"

You just have to use tal:attributes="href ..." in the 'a' tag...

Bye

Alex

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] newbie database adapter questions

2007-02-02 Thread Maciej Wisniowski

> It seems like most of the examples only explain how to create forms by
> using interfaces and objects.  
I've noticed this too.

> I don't want a user within zope to create a form in the ZODB, I just
> want to them to open up a location to url and see results from my
> database.  
Currently I'm doing something like that. It it supposed to work this way:
1. You enter url like
http://localhost:8080/manage_customer_form?in.customer_id=23
2. Form is displayed that contains data from underlying RDBMS
3. If you want another customer then you need to change in.customer_id
parameter value

There also other possiblities, eg. "Container/Folder that contains
object from a database.
The container is persistent.  The container however loads the content
from an SQL database"
This is from David Johnson post to this list at: 2007.01.26 in thread:
"Access to request in content object and object path in doctests". David
declared that
he may share his code but so far I don't have it. I'll try to remind him.


My implementation is like:

I've created content object that has two functions:
1. to get data from RDBMS (but this is not necessarily RDBMS)
2. to store data to RDBMS
Typically these functions will do 'select ... from' and 'update ...'

Then I've attached formlib view based on FormBase to this content object.
My setUpWidgets function gets input parameters from request, passes
them to get_data function of content object to receive data from RDBMS
and then uses setUpDataWidgets to set up widgets. Save action causes
to save_data function to be called.
There are some drawbacks, eg. you need to remember input parameters
somewhere etc.

My code is not ready yet but should be soon.
I'll try to publish it somwhere if somebody is interested.

-- 
Maciej Wisniowski
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Sascha Ottolski
On Friday 02 February 2007 09:35:58 Alex Furlong wrote:
> >I'm wondering if there is a proper solution to a common problem:
> >translating a page template with dynamic attributes. If I put something
> >like ...
>
> You probably want to look at i18n:attribute and i18n:name for the
> translation of dynamic content.
>
> Here is a page with some examples.
> http://www.upfrontsystems.co.za/Members/jean/mysite-i18n
>
> The examples are Plone oriented but you should be able to extract the
> things you need.

thanks a lot, but still: if I'm not blind, there is no concrete example that 
would cleanly solve my case. I don't want to translate an attribute, thats 
straight forward. 

I have a href attributes, that need to be computed dynamic, while the content 
of the  tag is part of a bigger piece thats is to be translated as 
a "sentence". I'm looking for an equivalent markup to express

msgid="Hi, please click here!"

in a page template, i.e. something close to


  Hi, please click here!


I admit that I might be just too dumb to see the obvious :-(


Cheers, Sascha

-- 
Lalisio GmbH                            www.lalisio.com

Puschkinstraße 1                   fon +49-(0)361/541 43 80
99084 Erfurt                       fax +49-(0)361/541 43 79
                                       [EMAIL PROTECTED]
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: PT, i18n and dynamic attributes...how to?

2007-02-02 Thread Alex Furlong
>I'm wondering if there is a proper solution to a common problem: 
>translating a page template with dynamic attributes. If I put something 
>like ...

You probably want to look at i18n:attribute and i18n:name for the translation 
of dynamic content.

Here is a page with some examples. 
http://www.upfrontsystems.co.za/Members/jean/mysite-i18n

The examples are Plone oriented but you should be able to extract the things 
you need.

There are some more links here:
http://wiki.zope.org/zope2/Internationalization

>Both Zope books are particularly good in explaining this.

This is not true. The Zope3 books say not much about the i18n namespace. That 
is not in the focus of these books as i18n stuff has been around since a while.

Bye

Alex
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] win32 setup

2007-02-02 Thread Ivan Horvath

Dear All,

i've downloaded the latest zope version 
(http://www.zope.org/Products/Zope3/3.3.0/Zope-3.3.0.win32-py2.4.exe).
how can i customize the installation path? because it is installed on 
the site_packages folder in python/lib folder.


i would prefer to put the complete zope package in a different folder 
outside python, because in this way i can manage the update more precisely.


--

Best Regards,

Iván Horváth
Chief Programmer

Alcatel NSD
PMS 2000 Product Team

H-1116, Budapest
Kondorfa u. 10.
Tel.: +36 1 209 9546
Fax.: +36 1 209 9599
Mobil: +36 30 257 0235
E-mail: [EMAIL PROTECTED] 
Check my Web Page 

/Anyone who has never made a mistake has never tried anything new./

/

/Albert Einstein/

/
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users