[ome-users] Couple of admin questions

Josh Moore josh at glencoesoftware.com
Wed Oct 12 10:04:26 BST 2011


On Oct 12, 2011, at 1:50 AM, Leon Kolchinsky wrote:

> Hi,
> 
> 
> On Tue, Oct 11, 2011 at 20:00, Josh Moore <josh at glencoesoftware.com> wrote:
> 
>> 
>> On Oct 11, 2011, at 6:43 AM, Leon Kolchinsky wrote:
>> 
>>> Hello,
>>> 
>>> 1. How do I run auto "cleanse" job via cron (so it won't ask me for
>> username
>>> and password)?
>>> 
>>> "$ /srv/omeroserver/bin/omero -s localhost admin cleanse /srv/omerodata"
>> -
>>> asks for username/pass
>>> "$ /srv/omeroserver/bin/omero -s root at localhost admin cleanse
>>> /srv/omerodata" - asks for pass
>> 
>> There's currently no way to login passwordlessly, but I've added
>> https://trac.openmicroscopy.org.uk/ome/ticket/6957 in order to examine
>> adding support for that. Until then, you'll need to follow the recipes on
>> the backup-and-restore page:
>> 
>> 
>> https://www.openmicroscopy.org/site/support/omero4/server/backup-and-restore
> 
> 
> Thanks, I'll try that.
> 
>> 
>> 
>>> 2. Is it possible to include this patch into Omero releases (from Chris
>>> Allan):
>>> 
>> http://users.openmicroscopy.org.uk/~cxallan/pil_image_import_inline.patch
>>> 
>>> It solves some client issues for us (python 2.6).
>>> 
>>> This is how I patch OMERO web client:
>>> [root at vera144 log]# cd /srv/OMERO.server-Beta-4.3.2/lib/python/
>>> [root at vera144 python]# wget
>>> 
>> http://users.openmicroscopy.org.uk/~cxallan/pil_image_import_inline.patch
>>> [root at vera144 python]# cp omeroweb/webclient/webclient_gateway.py
>>> omeroweb/webclient/webclient_gateway.py.orig
>>> [root at vera144 python]# patch -p0 < pil_image_import_inline.patch
>>> patching file omeroweb/webclient/webclient_gateway.py
>>> [root at vera144 python]# chown omero.omero
>>> omeroweb/webclient/webclient_gateway.pyl
>> 
>> Unfortunately, it's still unclear why this patch is only necessary for your
>> installation, and therefore, it's likely that adding this would break other
>> installations. The import block at the top of that file:
>> 
>> try:
>>   from PIL import Image, ImageDraw # see ticket:2597
>> except ImportError:
>>   try:
>>       import Image, ImageDraw # see ticket:2597
>>   except:
>>       logger.error("You need to install the Python Imaging Library. Get it
>> at http://www.pythonware.com/products/pil/")
>>       logger.error(traceback.format_exc())
>> 
>> should definitely have already imported "Image". If there are any generic
>> fixes you can make to that block so that your installation works without
>> Chris' patch, that would be something we could add to the main codebase.
>> 
> Hmm, I'm not a python user myself so it's kinda Chinese for me.
> Sorry, I don't have any python skills (except of installing one and it's
> modules.....)
> Anyway AFAIK, additional "Import" shouldn't break anything in theory.

The issue with the import is that without the try/except block on any system that requires the "PIL" prefix, it will fail. I'm attaching a zip with a make file, could you unpack it and run it on your system:

/tmp $ unzip pil.zip 
Archive:  pil.zip
   creating: pil/
  inflating: pil/Makefile            
  inflating: pil/t1.py               
  inflating: pil/t2.py               
  inflating: pil/t3.py               
/tmp $ cd pil
/tmp/pil $ make
python t1.py
  Found PIL.Image: <module 'PIL.Image' from '/usr/local/lib/python2.6/site-packages/PIL/Image.pyc'>
python t2.py
  Found Image:<module 'Image' from '/usr/local/lib/python2.6/site-packages/PIL/Image.pyc'>
python t3.py
  Found PIL.Image: <module 'PIL.Image' from '/usr/local/lib/python2.6/site-packages/PIL/Image.pyc'>
  Reimported Image: <module 'Image' from '/usr/local/lib/python2.6/site-packages/PIL/Image.pyc'>


Cheers,
~Josh.

>> Cheers,
>> ~Josh.
>> 
>> 
>>> Thank you,
>>> Leon Kolchinsky
>> 
> 
> Thanks,
> Leon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 243 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20111012/ddb1da2b/attachment.sig>


More information about the ome-users mailing list