Re: [Zope-dev] ghost product
If you set the environment variable STUPID_LOG_FILE to a file path before starting Zope, you will be able to capture the debug output from the product import procedure in that file. This usually has useful information in it about product registration failures. - Original Message - From: "Tim McLaughlin" <[EMAIL PROTECTED]> To: "'Chris McDonough'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, January 04, 2001 3:35 PM Subject: RE: [Zope-dev] ghost product > > Thanks for the delete issue, however that puts me at ground 0 again. THis > product will not show up in the products list... here's the __init__.py > > import ZSQLTable > > def initialize(context): > """Initialize the ZSQLTable product. > """ > context.registerClass( > ZSQLTable.ZSQLTable, > permission='Add Z SQL Tables', > constructors = (ZSQLTable.manage_addZSQLTableForm, > ZSQLTable.manage_addZSQLTable), > icon = 'zsqltable.gif') > > anything look strange?, anything? > > TYA > > -Original Message- > From: Chris McDonough [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 04, 2001 3:38 PM > To: Tim McLaughlin; [EMAIL PROTECTED] > Subject: Re: [Zope-dev] ghost product > > > Delete the product from the Control Panel management interface. > - Original Message - > From: "Tim McLaughlin" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, January 04, 2001 3:10 PM > Subject: [Zope-dev] ghost product > > > > In fact (to clarify my preceding problem), when I removed the product > > folder, Zope still shows the product and error after restarting. Am I > being > > stupid? I must be missing something > > > > Thanks > > > > ___ > > Zope-Dev maillist - [EMAIL PROTECTED] > > http://lists.zope.org/mailman/listinfo/zope-dev > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope ) > > > > > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) > > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] CatalogAware
Erik Enge wrote: > > [Michael Bernstein] > > | When called, they find the nearest (acquisition-wise) ZCatalog > | (named Catalog by default), > > I think you can specify the ZCatalog it should index itself in by > putting the default_catalog attribute in your class. Your example is correct as far as it goes, but as I understand it, you are not really specifying the default catalog per se, but the default catalog *name*. Therefore, it will then look for the nearest catalog of the name that you have redefined as the default. So if you redefine it to be ZCatalog1, and you have the following structure: / |-/Catalog | |-/ZCatalog1 | |-/folder1 | | | |-/folder1/ZCatalog1 | |-/folder2 Assuming a CatalogAware ZClass has had it's default_catalog defined to be 'ZCatalog1', and that an instance of this ZClass is then added in /folder2, it will index itself in /ZCatalog1, whereas an instance that is added in /folder1 will index itself in /folder1/ZCatalog1. This is my current understanding, I apologise if what I've said is incorrect. HTH, Michael Beernstein. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Hacking Splitter.c
Hello, I have been hard at work implementing version 2.0 of our Zope based CRM software. I need a bit of help figuring out Splitter.c (lib/python/SearchIndex/Splitter.c) I have commented out both the parts that don't index numbers and single letter words. The numbers seem to be indexing fine, but the single letter words are not. :( My goal is to be able to find 'C' and 'C++' in a TextIndex search. Can anyone tell me why '+' doesn't get indexed, and where to change that? 'C' isn't in the Lexicon stop words, and neither is the '+'. Thanks in advance. All my best, Jason Spisak CIO __ ___ ____ / // (_)_/_ __/__ / / ___ ___ __ _ / _ / / __/ -_) / / -_) __/ _ \(_-<_/ __/ _ \/ ' \ /_//_/_/_/ \__/_/ \__/\__/_//_/___(_)__/\___/_/_/_/ 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Product dev
Dieter Maurer wrote: > For some problems during product import, Zope > decides to keep the old state rather than show > the error. I wonder whether the product's version.txt might have something to do with it. Remove version.txt and see if it has any effect. Then try creating a new version.txt. Another thing to watch out for is file permissions. "chmod -R 777 productname" and see if there's any difference. Are you running Zope in "-D" debug mode and watching the output? I can't imagine debugging products in normal mode. Note, however, that Zope 2.1.7 and before don't even show anything in the terminal window when a product has syntax errors. One of the first things I did at Digital Creations was make sure that got fixed. :-) Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Product dev
Tim McLaughlin writes: > I'm building a Product in Python and seem to be having some issues with the > new registerClass method of Product registering. If I build it all fine as > noted in Shane's recent HowTo, the product does not show up in the control > panel. Then after much other chasing, I make a purposeful syntax error in > the code, and the Product shows up to reflect its brokenness and shows me > the syntax error. Then when I try to fix the error, and do a restart, the > error still shows as if I had not changed the code. I checked _many, many_ > times, and now the code is different, but Zope seems not to recognize the > changed code in spite of my deletion of the pyc files. I have seen this several times: For some problems during product import, Zope decides to keep the old state rather than show the error. This is *very* confusing. If you have a sufficiently recent Zope version (I think, at least Zope 2.2.2), then enabling the "stupid logging mechanism" should give you an error indication in the log file. You activate this logging through a parameter: STUPID_LOG_FILE=zope.log for your start script. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] case insensitive sorts
Chris Withers writes: > Dieter Maurer wrote: > > > > Chris Withers writes: > > > Andrew > > > bart > > > David > > > sophie > > > Wayne > > Why in hell do you switch caseness for similar objects? > > Who said anything about objects? Maybe, I should have said subjects. Your example strings seem to name persons. It is very strange (and should be punished, as it is by Python's default sort ;-)) to use caseness inconsistently for these same type subjects/objects/entities (whatever you like). I am not against an option to specify what comparison function should be used for sorting (when I would implement it, I would probably follow Python's sort interface and provide an optional function rather than have a collection of attributes specifying the sort order). However, I am against a change of the sort order in the *management interface* (unless I can easily switch back). The reason: I make sensible use of the ASCII based sort order and would not like to loose it. Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: [Zope] Lobbying (was: [Zope] html_quote in python methods?)
From: Chris Withers <[EMAIL PROTECTED]> > > Only if you add security declarations to expose functionality from > > xmlrpclib. > > Is that hacky and nasty? :-S In Zope 2.3, you place the following code somewhere that it will get executed at startup (a custom Product's __init__ is the best bet): from AccessControl import ModuleSecurityInfo security = ModuleSecurityInfo('xmlrpclib') security.declarePublic('Server') # or security.setDefaultAccess(1), if you feel lucky. Cheers, Evan @ digicool & 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns; possible bug?
At 06:03 PM 1/4/01 +, Steve Alexander wrote: > >I think what is happening in the broken example is that when the zope >security machinery asks for __roles__, name is also computed. The >machinery must request __roles__ before changing anything. > The behavior is as documented, though I'm not sure I'd call it "intended", exactly. :) You can fix this with either a seperate statement, as you've noticed, OR by placing the __roles__ computation *first* in the WITH SELF statement. This will ensure that it is already computed before the other items execute. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Python Scripts update
Python Scripts have gone through a fair number of changes and bugfixes recently. They should now work properly as methods of ZClasses. When you download the source of a Python Script, the title, parameter list, and bindings are added to the source in the form of specially formatted comments. If source with these comments is uploaded or pasted into a Python Script, it will properly set the properties mentioned in the comment block. The default bindings have been changed to be more sensible. If you want to give Python Scripts a try, you can go to http://ps.4-am.com:9000/ , pick a password, and you'll get your own private area in a trunk CVS checkout of Zope in which to play. I promised examples when I first announced this site, and haven't gotten around to writing any. If you have created a script or set of objects on the demo site that you would like to share as an example, please mail me the URL. Cheers, Evan @ digicool & 4-am ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] ghost product
Thanks for the delete issue, however that puts me at ground 0 again. THis product will not show up in the products list... here's the __init__.py import ZSQLTable def initialize(context): """Initialize the ZSQLTable product. """ context.registerClass( ZSQLTable.ZSQLTable, permission='Add Z SQL Tables', constructors = (ZSQLTable.manage_addZSQLTableForm, ZSQLTable.manage_addZSQLTable), icon = 'zsqltable.gif') anything look strange?, anything? TYA -Original Message- From: Chris McDonough [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 04, 2001 3:38 PM To: Tim McLaughlin; [EMAIL PROTECTED] Subject: Re: [Zope-dev] ghost product Delete the product from the Control Panel management interface. - Original Message - From: "Tim McLaughlin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 04, 2001 3:10 PM Subject: [Zope-dev] ghost product > In fact (to clarify my preceding problem), when I removed the product > folder, Zope still shows the product and error after restarting. Am I being > stupid? I must be missing something > > Thanks > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) > > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ghost product
Delete the product from the Control Panel management interface. - Original Message - From: "Tim McLaughlin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 04, 2001 3:10 PM Subject: [Zope-dev] ghost product > In fact (to clarify my preceding problem), when I removed the product > folder, Zope still shows the product and error after restarting. Am I being > stupid? I must be missing something > > Thanks > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) > > ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ghost product
In fact (to clarify my preceding problem), when I removed the product folder, Zope still shows the product and error after restarting. Am I being stupid? I must be missing something Thanks ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Product dev
I'm building a Product in Python and seem to be having some issues with the new registerClass method of Product registering. If I build it all fine as noted in Shane's recent HowTo, the product does not show up in the control panel. Then after much other chasing, I make a purposeful syntax error in the code, and the Product shows up to reflect its brokenness and shows me the syntax error. Then when I try to fix the error, and do a restart, the error still shows as if I had not changed the code. I checked _many, many_ times, and now the code is different, but Zope seems not to recognize the changed code in spite of my deletion of the pyc files. TYA, Tim ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Internationalization
Hello, Has anyone translated a site within Zope ? I have tried the ZBabel Translation System (http://www.zope.org/Members/TheJester/ZBabel) and didn't think it did really what I was after. I need to translate the site into French , German , and Japanese . I assume the best way is to pull the different languages from a database via a python external method or just Zmysql Any help would be appreciated Keith Larson ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] ZPatterns; possible bug?
I have a specialist "Instructors". It holds a rack, containing DataSkin-derived ZClasses of meta-type "Instructor". The Instructor class has a DataSkin Attribute propertysheet called "Basic", and this has properties for forename, surname, address, areas. I have some skinscript in the Instructors specialist: WITH SELF COMPUTE name='%s %s' % (forename, surname), areas_comma_sep=_.string.join(areas, ','), address_lines=_.string.join(address, '\n'), address_comma_sep=_.string.join(address, (', ')) WITH SELF COMPUTE __roles__=_.None # XXX publicly visible!! Nutter!! # change __roles__ to ('Operator',) later. This works fine. The __roles__ bit is a hack to make Zope 2.3 ZCatalog play nicely with the Specialist and __bobo_traverse__. I have some other skinscript that keeps an instructors index in a ZCatalog inside Instructors. WHEN OBJECT ADDED CALL Catalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/')) WHEN OBJECT DELETED CALL Catalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')) WHEN OBJECT CHANGED CALL Catalog.uncatalog_object(_.string.join(self.getPhysicalPath(),'/')), Catalog.catalog_object(self, _.string.join(self.getPhysicalPath(),'/')) This worked fine. When I changed the first skinscript to make one WITH SELF statement, I got some strange inconsistencies: WITH SELF COMPUTE name='%s %s' % (forename, surname), areas_comma_sep=_.string.join(areas, ','), address_lines=_.string.join(address, '\n'), address_comma_sep=_.string.join(address, (', ')), __roles__=_.None On changing an instructor's properties using manage_changeProperties on its propertysheet, I'd see the change in the instructor. However, the ZCatalog metadata would always have the most recent value for "surname", but the last value for "name". Changing the skinscript back to using two statements makes cataloging function normally again. I could tell when the catalog was doing by instrumenting the recordify method of Catalog.py: def recordify(self, object): """ turns an object into a record tuple """ print "recordify %s" % (object) record = [] # the unique id is allways the first element for x in self.names: try: attr = getattr(object, x) if(callable(attr)): attr = attr() except: attr = MV print " appending %s:%s" % (x, attr) record.append(attr) return tuple(record) A typical (wrong) debug output would be: recordify appending id:instructor-977678608 appending meta_type:Instructor appending bobobase_modification_time:2001/01/04 17:26:01.35408 GMT appending name:Bob Collins8 appending surname:Collins9 appending areas_comma_sep:M12 This is after changing the surname of the instructor from "Collins8" to "Collins9". The cause of the problem? I don't know. Maybe I'm doing something silly. I think what is happening in the broken example is that when the zope security machinery asks for __roles__, name is also computed. The machinery must request __roles__ before changing anything. After that, surname gets changed. However, changing "surname" only invalidates "surname" in the cache; not anything that is computed using surname. At the end of the transaction, when the triggers are called, name is already in the dataskin's attribute cache, so it does not get recomputed. In the working example, when __roles__ is requested, it is in a different skinscript statement, so it does not cause "name" to be computed. Thus, "name" can be computed freshly after "surname" is set. Is this behaviour intended, is it a bug, or is it an unimplemented feature? Thanks. Oh, almost forgot: ZPatterns-0-4-3b2 -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net I ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] CatalogAware
[Michael Bernstein] | When called, they find the nearest (acquisition-wise) ZCatalog | (named Catalog by default), I think you can specify the ZCatalog it should index itself in by putting the default_catalog attribute in your class. I think, that this object (in pseudo) would index itself in ZCatalog1 def myClass(CatalogAwareness): default_catalog = 'ZCatalog1' def __init__(self): self.index_object() If you have the path: mysite.com/ZCatalog1/ZCatalog2/Folder1/myClassInstance Yeah? ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns question
Hi! > > Well, virtual in the sense as a specialist is no real folder but can > > provide content from different sources. Thus what I mean is some mechanism > > which emulates objectIds() etc. so it looks to the user (and the ones > > using it via dtml) like a normal folder object. > > Somehow like the Customizer but without the need for actually creating > > Zope objects. Something inbetween Specialist and Customizer this would be > > I guess. > > yeah, this is exactly what I'm after too. I'd like the virtual objects > the specialist is responsible for to have normal Zope management > screens. Well, I think this shouldn't be too difficult to create. Just a subclass of Specialist and add some Contents-Tab, define objectIds() etc. in the Methods tab and call it in the management screen of "Contents". Though the more advanced things like Copy/Paste/Rename might then not be available.. But for me actually it would be sufficient to get the contents. > Also, much mroe trickily, I'd like them to be able to contain each > other, although Steve A's __bobo_traverse__ trick might help with this > bit... What do you mean? Nesting Specialists (or these virtual folder specialists)? cheers, Christian -- COM.lounge http://comlounge.net/ communication & design [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] CatalogAware
Chris Withers wrote: > > Erik Enge wrote: > > > > Are you saying that, as a general rule, inheriting from CatalogAware > > and using index_object, reindex_object and unindex_object does not > > work? > > It probably does, but if you're a catalog yourself anyway, as Squishdot > is, it just more overhead rather than calling your own catalog_object > and uncatalog_object methods ;-) Aha! You're saying that catalog_object and uncatalog_object are methods of the catalog, so when the catalog contains the objects directly, it's all that's neccessary, correct? index_object, unindex_object, and reindex_object (the CatalogAware methods) are all methods on the object to be indexed, not methods of the catalog, as I understand. When called, they find the nearest (acquisition-wise) ZCatalog (named Catalog by default), and cause catalog_object and uncatalog_object to be called on it (I'm not sure what method reindex_object causes to be called). So, postings would only need to be CatalogAware if you wanted them to be able to 'live' anywhere within the Zope heirarchy, instead of being contained directly within the Squishdot object (which inherits from ZCatalog). Do I have this correct? Michael Bernstein. ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] RE: objectIds accessiblilty & and a proposal
> > > I did have a proposal for just this on dev.zope.org, but I see someone > has deleted it :-( > > cheers, > > Chris Are you talking about 'ProtocolAccessibility'? It's still there (though Jim has done some rearranging of things there lately)... Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] case insensitive sorts
Shane Hathaway wrote: > def sort_strings(data): > sortable_data = list(map(lambda s: (lower(s), s), data)) > sortable_data.sort() > return map(lambda s: s[1], sortable_data) ... Or better, you could pass a comparison function to sort() like Tres suggested. :-) Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] case insensitive sorts
Chris Withers wrote: > > Dieter Maurer wrote: > > > > Chris Withers writes: > > > Andrew > > > bart > > > David > > > sophie > > > Wayne > > Why in hell do you switch caseness for similar objects? > > Who said anything about objects? I was just talking about lists of > strings and in general, people prefer sorting based on the character to > take precedence over sorting based on the case of that character. > > Sadly, python's default sort does it the other way round :-( This is not wrong. Again, if the default sort tried to sort case-insensitively, it would yield incorrect results for existing code that sorts lists of strings containing data rather than text. And again, what you really want is a "textops" module that does something like this: def sort_strings(data): sortable_data = list(map(lambda s: (lower(s), s), data)) sortable_data.sort() return map(lambda s: s[1], sortable_data) Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] case insensitive sorts
> > * collation (which letters belong together) is highly locale >sensitive (e.g., does a-accent-grave sort with a? etc.) > A Fair point. The answer is whatever seems _naturally_ correct from a users point of view. I think the answer is yes. Elephant entropy écrit élan i.e. In the order in which they would appear in a dictionary. > * Should strings which differ only in case be equal (*NOT*!) > 'Ant' is not equal to 'ant' but 'Ant'<'ant'<'Ante'<'ante' i.e. Ant ant Ante ante Would be a sensible sort order. I hope that makes things a bit clearer. -Andy ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] WIN2K batch problem
I'm trying to run Zope 2.2.2 under win2000 in a batch file. I'm just watching error messages and prints. I find that when zope has written a page to the cmd.exe window it locks further prints from python until I hit a key in the window and then it releases another page full. Is there a Win NT/2K guru who knows about such things and how to prevent this? -- Robin Becker ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] case insensitive sorts
Chris Withers <[EMAIL PROTECTED]> wrote: > Andy McKay wrote: > > > > They want information fast and most users expect case insensitive sorts. Its > > simpler and easy. I think having the ignore_case option for a -tree and -in > > helps Zope by increasing the ease of development and friendliness to the > > user. > > And my point was that this is so universally true that the _pthyon_ sort > function (which is at fault here) should be fixed :-) Python's sort already allows you to pass an alternate comparison function:: [/var/home/tres] $ python Python 1.5.2 (#1, Feb 1 2000, 16:32:16) [GCC egcs-2.91.66 19990314/Linux (egcs- on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> foo = [ 'z', 'y', 'x' ] >>> foo.sort() >>> foo ['x', 'y', 'z'] >>> foo.sort( lambda x, y: cmp(y,x) ) >>> foo ['z', 'y', 'x'] I believe Andy's patch makes use of this feature. You are missing a couple of points if you *require* a case-insensitive sort: * collation (which letters belong together) is highly locale sensitive (e.g., does a-accent-grave sort with a? etc.) * Should strings which differ only in case be equal (*NOT*!) Tres. -- === Tres Seaver[EMAIL PROTECTED] Digital Creations "Zope Dealers" http://www.zope.org ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Objects with multiple parents and storage flexibility, ZPatterns?
Hi Chris, > "Chris" == Chris Withers <[EMAIL PROTECTED]> writes: Chris> Steve Spicklemire wrote: >> I think that if you make your DataSkins folderish it will be >> hard to make the storage anything other than ZODB. Chris> Well, I don't mind the 'skins' being stored in the ZODB, Chris> but, as Steve A mentioned, I _would_ like stuff created in Chris> the RDBMS to 'magically appear' in the Zope side of Chris> things. I guess that means FwCS and folder-subclassing Chris> DataSkins are a no-no? No... I don't think so! If you don't mind keeping stuff in ZODB then you *could* have a traversal interface that made stuff 'appear' wherever you want it to, though its persistent storage would 'really' be in a Rack or FwCS. >> Let's say your objects have an attribute that defines them in >> the context of their parent (e.g., dataskin2 in your example >> URL), Chris> their id in Zope parlance, right? Hmm. not really... the Zope 'id' is used by the Rack to keep track of all the objects of a single type. If all your 'X's are kept in one Rack, they all need a unique 'id'. The idea context_id is an id-like attribute that 'plays the role of id' in the context of a particular parent. It's probably a bad name... but all I could think of in 5 minutes... >> let's call it 'context_id'. You may have six objects with the >> same context_id, but they would all have different parents. Chris> They may each have mutliple parents too ;-) The point for Chris> me is that the id (context_id in your example) is unique in Chris> terms of _only_ the following constraint: No parent may Chris> have more than one child with the same id. This is Chris> actually how the ZODB works except that it objects in the Chris> ZODB may only have one parent (well, at least ZODBs managed Chris> with Zope ;-) Wow... multiple parents, multiple children.. it's almost incestuous! So long as you can write queries for 'find parents for child x' and 'find children for parent y' it shouldn't matter. If not you'll need to keep references to parents/childred stored in the objects and that can be bothersome, but possible. >> Now.. you could implement a search interface that finds an >> object in context. >> >> GetObjectInContextOfParent( context_id, parent_id ) Chris> might be better if it resolved a path into an object, like Chris> Zope does, hence my keenness to see if there isn't a simple Chris> way I can make Zope and Zpatterns do the bulk of the work, Chris> just with the tweaks I need... I'm not sure how the path will help you at this point... but if you need it you can always ask Zope for it once traversal is complete. >> Now for the traversal interface: >> >> def __bobo_traverse__(self, REQUEST, name): ob = getattr(self, >> name, _marker) if ob is _marker: ob = >> self.GetObjectInContextOfParent( context_id = name, parent_id = >> self.id) if ob is not None: return ob raise 'NotFound' return >> ob Chris> looks good... >> Totally untested of course. ;-) Anyway the idea would be to >> *not* use folderish DataSkins, but to build a hierarchy out of >> them that could be traversed. Chris> Hurm... I'd love them to have a UI identical to normal Zope Chris> folders/objectmanagers, though, with properties, a security Chris> tab, and, in a dream world, the ability to drop normal DTML Chris> methods, python Scripts and the like into the foldersish Chris> objects. Chris> Is this asking for too much? ;-) You can never *ask* for too much. ;-) Seriously though... for this you'll probably need to store the objects persistently in the Rack(s), though you could farm some of their attributes out to other data storage systems with SkinScript. Nothing will prevent you from making your DataSkins inherit from ObjectManager or Folder, but you won't be able to completely 'virtualize' them. The only way I *think* you could make this work with completely virtual data-skins is to create 'sister' classes to everything you wanted to add (e.g. 'SkinDTML Method' and 'SkinPython Script' which would be new classes that inherit from DataSkin *and* the class you want to emulate (and probably yet another class that hanldles the interconnection glue parents/context and all that). Then you'd need to add whatever attribute providers were necessary to keep all the attributes of the original classes (e.g., DTML Method) in your external storage. But it sounds like you just want to keep 'some' of the associated data in the external source... so I don't think any of that will be necessary. good luck! -steve Chris> Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.
Re: [Zope-dev] Objects with multiple parents and storageflexibility, ZPatterns?
"Phillip J. Eby" wrote: > > You can't really "nest" DataSkins inside each other in a rack, and you > really don't want to, anyway. I kindof agree, I guess nesting doesn't mean a lot in RDBMS terms? ;-) > But there's nothing that says you can't > create a DataSkin subclass whose __bobo_traverse__ looks up related > objects. Hurm, could something similar be doen so a DataSkin could implement the objectmanager interface? > You just can't "really" store the DataSkins inside each other. I don't want to, I only want it to appear to Zope, ZPublisher and the Management Interface as if that was the case. The only difference being that 'objects' can appear under more than one parent. > Note that if your __bobo_traverse__ uses a specialist "getXforY()" call, > you can "store" objects from different databases (racks) "inside" each > other. :) I like the sound of that :-) Well, thanks for the help so far, I'm going to have to bite the bullet and start implementing tomorrow :-S cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: Objects with multiple parents and storage flexibility, ZPatterns?
Steve Alexander wrote: > > If you use a Folder w/ Customizer Support, you'll need to create all the > DataSkin instances in the ZODB, just as if they were normal ZClass (or > whatever) instances. Thus, the instances all need to be "in there" to > start with. Shame, although if I'm really brutal and XP about this, that might not matter... > You can't add data to your external database, and expect a > new Dataskin instance to pop up in the ZODB. This is what is meant by > "When using Folder with Customizer Support, DataSkins are anchored in > the ZODB". Is this always going to be the case or just the current implementation? > You can get the data for your dataskins from a variety of sources, > whether you choose to use Specialists or Folder w/ Customizer Support. Cool... would creating a folder objects that subclasses FwCS _and_ DataSkin be a very bad thing, or could I maybe get what I want doing that and supplying things like objectIds with an attribute provider? > However, if you use Specialists, you can have the DataSkin instances > appear only when requested. Thus, you can add records to your external > database, and thereby have new Dataskins available from your application. Hurm... could this not be achvieved if, like I mentioned earlier, objectIds, and whatever else is neeeded, is supplied by something ZPatterns-ish? > I briefly described this on zope-dev a couple of days ago. Yup, I saw :-) Many thanks for all the help, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Objects with multiple parents and storage flexibility, ZPatterns?
Thanks... this sounds a lot like what I'm after :-) Steve Spicklemire wrote: >I think that if you make your DataSkins folderish it will be hard > to make the storage anything other than ZODB. Well, I don't mind the 'skins' being stored in the ZODB, but, as Steve A mentioned, I _would_ like stuff created in the RDBMS to 'magically appear' in the Zope side of things. I guess that means FwCS and folder-subclassing DataSkins are a no-no? > Let's say your objects have an attribute that > defines them in the context of their parent (e.g., dataskin2 in your > example URL), their id in Zope parlance, right? > let's call it 'context_id'. You may have six objects > with the same context_id, but they would all have different parents. They may each have mutliple parents too ;-) The point for me is that the id (context_id in your example) is unique in terms of _only_ the following constraint: No parent may have more than one child with the same id. This is actually how the ZODB works except that it objects in the ZODB may only have one parent (well, at least ZODBs managed with Zope ;-) > Now.. you could implement a search interface that finds an object > in context. > > GetObjectInContextOfParent( context_id, parent_id ) might be better if it resolved a path into an object, like Zope does, hence my keenness to see if there isn't a simple way I can make Zope and Zpatterns do the bulk of the work, just with the tweaks I need... > Now for the traversal interface: > > def __bobo_traverse__(self, REQUEST, name): > ob = getattr(self, name, _marker) > if ob is _marker: > ob = self.GetObjectInContextOfParent( context_id = name, parent_id = >self.id) > if ob is not None: > return ob > raise 'NotFound' > return ob looks good... > Totally untested of course. ;-) Anyway the idea would be to *not* use folderish > DataSkins, but to build a hierarchy out of them that could be traversed. Hurm... I'd love them to have a UI identical to normal Zope folders/objectmanagers, though, with properties, a security tab, and, in a dream world, the ability to drop normal DTML methods, python Scripts and the like into the foldersish objects. Is this asking for too much? ;-) Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] CatalogAware
Erik Enge wrote: > > Are you saying that, as a general rule, inheriting from CatalogAware > and using index_object, reindex_object and unindex_object does not > work? It probably does, but if you're a catalog yourself anyway, as Squishdot is, it just more overhead rather than calling your own catalog_object and uncatalog_object methods ;-) Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] CatalogAware
[Chris Withers] | The point behind CatalogAware was, as I understand it, that the object | inheriting from CatalogAware wouldn't have to worry about managing its | own indexing. Sadly, that didn't work out... I haven't been following this discussion, so my question may be redundant, and if it is I'm sorry. :) Are you saying that, as a general rule, inheriting from CatalogAware and using index_object, reindex_object and unindex_object does not work? Or, probably more likely, are you saying that since you have to put index_object in the __init__ method you consider it to be managing its own indexing? Thanks :) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] ZPatterns question
Christian Scholz wrote: > > Well, virtual in the sense as a specialist is no real folder but can > provide content from different sources. Thus what I mean is some mechanism > which emulates objectIds() etc. so it looks to the user (and the ones > using it via dtml) like a normal folder object. > Somehow like the Customizer but without the need for actually creating > Zope objects. Something inbetween Specialist and Customizer this would be > I guess. yeah, this is exactly what I'm after too. I'd like the virtual objects the specialist is responsible for to have normal Zope management screens. Also, much mroe trickily, I'd like them to be able to contain each other, although Steve A's __bobo_traverse__ trick might help with this bit... cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Acquisition wishlist :-)
Dieter Maurer wrote: > > > acquisition.donotacquire('index_html') > This would be great. Indeed :-) > > class MyClass (Acquisition.Explicit): > > > > acquisition = ClassAcquisitionInfo() > > > > acquisition.acquire('index_html') > > acquisition.acquire('fred') > You already can do that, though with a different syntax > (I would need to search for in the documentation). You may mean that if x is an Acquisition.Explicit object, you can do: x.aq_acquire('your_attribute') (syntax may be wrong ;-) What I meant is that through a declaration in the class you could saying acquire the 'your_attribute' attribute but nothing else. So, you could still do: x.your_attribute ...which would be acquired, but... x.index_html ...which wouldn't be acquired. cheers, Chris > > Dieter > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] CatalogAware
Michael Bernstein wrote: > > In fact, if > catalog_object and uncatalog_object are interchangeable with > index_object and unindex_object, then I'm sure I don't > understand the point of inheriting from CatalogAware at all. Hehe... many would agree with that sentiment. The point behind CatalogAware was, as I understand it, that the object inheriting from CatalogAware wouldn't have to worry about managing its own indexing. Sadly, that didn't work out... cheers, Chris > Is it reindex_object, which doesn't seem to have an > equivalent? yup... > Scratching-my-head-over-this-whole-CatalogAware-thing-ly Hehe... it's probably not worth worrying about ;-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] case insensitive sorts
Dieter Maurer wrote: > > Chris Withers writes: > > Andrew > > bart > > David > > sophie > > Wayne > Why in hell do you switch caseness for similar objects? Who said anything about objects? I was just talking about lists of strings and in general, people prefer sorting based on the character to take precedence over sorting based on the case of that character. Sadly, python's default sort does it the other way round :-( Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] How to confuse the publishing process
Steve Spicklemire wrote: > > I don't see the behavior you describe.. What did I > misunderstand? Prolly nothing. I was more than likely just doing something stupid :-) cheers, Chris ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )