Make all paths work in-tree, add path portability abstraction layer

Bug #697638 reported by Jason Gerard DeRose
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dmedia
Invalid
Low
Unassigned

Bug Description

I'm a big fan of making it easy to run Python software from the source tree without loss of functionality. Among other benefits, this allows for quick iterations on UI and interaction issues that require human testing. I've done this before on previous Python projects and have had good results (I'll borrow some of this code as a starting point).

It's easy to test whether we're running in-tree by looking for setup.py in the directory containing the Python package. My old Paths class did just this.

Then rather than using hard-coded paths, we'll do something like paths.get('pixmaps', 'dmedia.sgv'), which might return 'TREE/data/dmedia.svg' when running in-tree, and '/usr/share/pixmaps/dmedia.svg' when running from an installed copy. As we wont be using hard-coded paths, this also makes it easy to make Paths return platform appropriate locations when one day dmedia, say, runs on Windows also.

I might be forgetting something, but right now there are just two things that need special in-tree smarts:

1) icons so that icons work without an installation

2) localedir so that translations work without an installation

I'd also really like a way to have the in-tree scripts only talk to the in-tree D-Bus service (would be on a different bus name), but I'll have to see what I can come up with there.

As far as I know, there isn't functionality like this in the Python standard library. If there is a good Python package that does this already, I'm all ears. Although my previous implementation was a very small amount of code, so it might not be worth adding a new dependency for.

Changed in dmedia:
milestone: 0.3 → 0.4
Changed in dmedia:
assignee: Jason Gerard DeRose (jderose) → nobody
Changed in dmedia:
milestone: 0.4 → 0.5
Changed in dmedia:
milestone: 0.5 → 0.7
Changed in dmedia:
milestone: 0.7 → 0.8
Changed in dmedia:
milestone: 11.08 → 11.11
Changed in dmedia:
milestone: 11.11 → 11.12
Changed in dmedia:
milestone: 11.12 → 12.02
Changed in dmedia:
milestone: 12.02 → 12.03
Changed in dmedia:
milestone: 12.03 → 12.04
Changed in dmedia:
milestone: 12.04 → 12.06
Changed in dmedia:
milestone: 12.06 → 12.07
milestone: 12.07 → 12.08
Changed in dmedia:
milestone: 12.08 → 12.10
Changed in dmedia:
milestone: 12.10 → 12.11
Changed in dmedia:
milestone: 12.11 → 12.12
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

I'm going to mark this as invalid as this isn't a particularly high priority, plus we don't currently have a nice way for the DBus service to work in-tree anyway (in many respects).

What *is* a high priority is deciding how best to use gettext from inside our HTML5 UI:

https://bugs.launchpad.net/novacut/+bug/946561

We need to solve that before we worry about making translations work in-tree, because that will determine what constraints we need to work within.

Changed in dmedia:
milestone: 12.12 → none
status: Triaged → Invalid
Changed in dmedia:
importance: High → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.