Re: [Zope] import error

2006-01-11 Thread SER.RI-TIC-Alexis Roda

David Bear wrote:
Will attempting to import a zexp file (and exported plone site) I get 
the following error:


result=apply(object,args) # Type scr to step into published object.
  File /home/webenv/zope/lib/python/OFS/ObjectManager.py, line 532, in 
manage_importObject

raise BadRequest, 'Invalid file name %s' % escape(file)
BadRequest: Invalid file name InfoTechnical.zexp


Acording to ObjectManager source this exception is raised because you're 
suplying a path with a directory component (some/dir/InfoTechnical.zexp)


def manage_importObject(self, file, REQUEST=None, set_owner=1):
Import an object from a file
dirname, file=os.path.split(file)
if dirname:
raise BadRequestException, 'Invalid file name %s' % 
escape(file)



HTH
--
   
  (@ @)
oOO(_)OOo--
   Ojo por ojo y el mundo acabara ciego
/\ Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
---

___
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] Sharing global data between threads / locking a method

2005-06-27 Thread SER.RI-TIC-Alexis Roda

Jonathan wrote:

A possible solution:  create a property field on the folder where the 
external methods are stored.  Have your external method update this 
property field when the external method starts and again when it exits.  
This way you can test whether or not the external method is currently in 
operation.  You could store this property field on a temp_folder for 
faster performance.


Not sure if this will work. If I understand correctly how does Zope/ZODB 
transaction machinery works, if you set a property on some persistent 
object the change will be visible only after the transaction has been 
commited, wich usually happens at the end of the request, so other 
threads/requests will always get a long_process_finished value for the 
property.


Regarding Max M question, a simple solution could be to use a file 
(filesystem, not zope) as lock.




HTH
--
   
  (@ @)
oOO(_)OOo--
   Ojo por ojo y el mundo acabara ciego
/\ Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
---

___
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-dev] Re: [Zope-Checkins] CVS: Products/PluginIndexes/common- UnIndex.py:1.20.2.7

2005-05-31 Thread SER.RI-TIC-Alexis Roda

Chris Withers wrote:

Tres Seaver wrote:


+if set is None:
+set = IISet(())
+elif type(set) is IntType: # isinstance(set, int) for 
2.8



How come isinstance is only to be used for 2.8?


Hi,
when I wrote the patch and the test case I tried to be consistent with 
the actual code. On 2.7 the check was done with type() while on 2.8 with 
isinstance(), so I added a comment. Probably I should have stated this 
in the collector entry.




Regards
--
   
  (@ @)
oOO(_)OOo--
   Ojo por ojo y el mundo acabara ciego
/\ Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
---

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