Bug #846

PYTHON addEventScript needs to evaluate the "~" in the scripts full path name

Added by Zack Settel 12 months ago. Updated 9 months ago.

Status:Closed Start date:2012-07-03
Priority:Normal Due date:
Assignee:Louis Bouchard % Done:

100%

Category:-
Target version:-
Version:

Description

context: spin server running on a remote linux box, with spin messages sent from a PDprocess on an OSX machine:

When the SPIN server receives a message: addEventScript , the full path to the script must be provided, otherwise the script will not be found (this was not the case when Balljam was created and ran on OSX... then, only the name of the script had to be passed in the message).

e.g.
/note-name addEventScript S repelscript setParam /home/zack/svn/balljam/patches/repel.py args

problem:
Using a tilde in the message (e.g. "~/zack/svn/balljam/patches/repel.py args" ) generates an error, so the spin server should be fixed to evaluate the tilde (which is currently not the case).

The fu

History

Updated by Alexandre Quessy 12 months ago

import os print(os.path.expanduser("~/foo.py"))

Updated by Alexandre Quessy 12 months ago

Also, we generally face the following issue: Sometimes the location of the files might change from one computer to another, if the user name is not the same everywhere. Do we expand the tilde to $HOME on the server's side or on each of the client's side? It might be a good idea to expand it only at the very last minute (on the client's side) for assets, so that each client might have a different user name with no problem.

Updated by Mike Wozniewski 10 months ago

  • Assignee changed from Mike Wozniewski to Louis Bouchard

Assigning this to Louis.

There is a method you can use in spinUtil.h called getAbsolutePath(). Check it out.

A comment for Alex: yes, it does the expansion locally / on the client-side.

Updated by Louis Bouchard 9 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

fixed and tested with both pdsheefa python examples.

Also, it now stops complaining if the script cannot be found.

Updated by Mike Wozniewski 9 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF