I am trying to use the BOINC Python libraries as a means of getting direct
access to the BOINC internals. My script is executing from an arbitrary
directory *not* in the BOINC project directory.
Here is how I am importing the BOINC code:
# setup global import bindings
configxml,projectxml = None,None
def boinc_import_hack(proj_path):
global configxml,projectxml
bin_path = os.path.join(proj_path, "bin")
if not bin_path in sys.path:
sys.path.append(bin_path)
# Some BOINC libs will search for config files using these vars
os.environ['BOINC_CONFIG_XML'] = os.path.join(proj_path, 'config.xml')
os.environ['BOINC_PROJECT_XML'] = os.path.join(proj_path, 'project.xml')
os.environ['BOINC_RUN_STATE_XML'] = os.path.join(proj_path,
'run_state.xml')
import configxml,projectxml # database, etc...
# called from some other function:
boinc_import_hack("the path to the boinc project")
This feels really kludgey. Is this really necessary or is there a
better/cleaner/smarter way?
Thanks,
Jeremy
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.