Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1257 (closed enhancement: fixed)

Opened 12 years ago

Last modified 12 years ago

[PATCH] modname OR pkg_resources.Requirement for resource links please

Reported by: robinbryce2 Owned by: alberto
Priority: high Milestone:
Component: ToscaWidgets Version: 1.0
Severity: normal Keywords:
Cc:

Description

The purpose of this patch is to enable resource links like this:

    css = [CSSLink(modname=Requirement.parse('otherproj >= 1.3'),
            filename='button-tabs/button-tabs.shaped.css')
        ]

A particularly use full feature of pkg_resources: resource_filename(Requirement.parse(modname), '') yields the file system path to the directory that contains the .egg-info dir for modname.

For python setup.py develop installs this gives you the src root. For egg installs (zip_safe=False), this gives you the ability to have *versioned* intra package url references. Any user passing a vanilia module name, ie resource_filename(__name__, "packaged/data.file") gets the same behaviour as before.

Attachments

toscawidgets-package_or_requirement-r2343.diff Download (1.0 KB) - added by robinbryce2 12 years ago.
[PATCH] against r2343, support package_or_requirement for registered directories

Change History

Changed 12 years ago by robinbryce2

[PATCH] against r2343, support package_or_requirement for registered directories

comment:1 Changed 12 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone 1.0.2 deleted

Comitted at [2420]. Thanks! :)

Alberto

Note: See TracTickets for help on using tickets.