pkg_resources is used inconsistently to load files

Bug #393838 reported by Matt Nordhoff
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
loggerhead
Triaged
Low
Unassigned
loggerhead-breezy
Triaged
Low
Unassigned

Bug Description

Loggerhead uses pkg_resources.resource_filename() to load templates, but it doesn't when serving static files. Which is correct? Does it matter?

loggerhead/zptsupport.py:

    tfile = pkg_resources.resource_filename(
        package, "%s.%s" % (basename, "pt"))

loggerhead/apps/__init__.py:

static = os.path.join(
    os.path.dirname(os.path.dirname(__file__)), 'static')

Tags: cleanup
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hysterical reasons. Let's stop using pkg_resources.

Revision history for this message
Matt Nordhoff (mnordhoff) wrote :

Stop using it completely, or just for this?

Changed in loggerhead:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I meant just for this.

We should probably cope better with it's absence for the version checks.

Jelmer Vernooij (jelmer)
Changed in loggerhead-breezy:
status: New → Triaged
importance: Undecided → Low
tags: added: cleanup
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.