Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8358 closed defect (fixed)

Config getpath() issues

Reported by: osimons Owned by: osimons
Priority: normal Milestone: 0.11.5
Component: general Version: 0.11-stable
Severity: normal Keywords: config
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

2 issues:

  1. The getpath() method is not available at configuration level.
  2. The Section.getpath() does not do reading correctly.

Patch follows.

Attachments (3)

t8358-config_getpath-r8262-011.diff (2.4 KB ) - added by osimons 15 years ago.
Patch for the 2 getpath() issues in description + tests.
t8358-config_getpath-r8262-011.2.diff (1.4 KB ) - added by osimons 15 years ago.
Updated patch - only for point 1, and ignore 2…
t8358-config_getpath-r8288-011.diff (3.6 KB ) - added by osimons 15 years ago.
Updated patch that also handles Option.registry.

Download all attachments as: .zip

Change History (7)

by osimons, 15 years ago

Patch for the 2 getpath() issues in description + tests.

comment:1 by osimons, 15 years ago

Actually, my second point does not seem to be correct (my mistake)… Updated patch shortly.

by osimons, 15 years ago

Updated patch - only for point 1, and ignore 2…

comment:2 by osimons, 15 years ago

So, latest patch basically addes getpath() to config level and adds tests.

A number of places we use our own methods for converting to absolute path (like repository dir, plugins_dir, log file and so on). For these we use various bases, and converting these to standardize on getpath() would lead to errors (all configs would need to be updated).

Basically this patch just makes the method of doing getpath() available, and returns a result relative to the location of the config file the option is found in.

Wait a minute… One issue does actually remain with getpath(). It does not actually support the Option registry and it's own PathOption… For that we would need a base from which to convert relative paths. What would we use? The project trac.ini location?

by osimons, 15 years ago

Updated patch that also handles Option.registry.

comment:3 by osimons, 15 years ago

Milestone: 0.11.60.11.5
Version: none0.11-stable

The latest patch fixes all issues, I believe. It also includes reading relative paths from Option.registry, and if configuration files are chained they will all keep a record of the location of the first file in the chain for use when calculating relative paths from option defaults. New tests are included.

It should be ready for 0.11.5. Testing welcome.

comment:4 by osimons, 15 years ago

Resolution: fixed
Status: newclosed

Last patch committed in [8303:8304].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from osimons to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.