Make P1tr independent from the operating system

Registered by Chris Ortner

At the moment all paths in P1tr are Unix-like-OS-specific because they contain "/". Windows paths look slightly different, nevertheless P1tr can be used like this on Windows.

Another option than generalizing the paths is to create a seperate P1tr distribution for windows with corrected paths, but that's not really a great way to solve the whole problem.
A, in my opinion, better approach is creating a function in lib.helpers which takes a list as argument. This list contains all elements of a path. This list can look as follows:
['folder_in_p1tr_root', 'subfolder', 'file.txt']
If the OS is something else than Windows the function returns a string 'folder_in_p1tr_root/subfolder/file.txt'. Otherwise the returned string looks like 'folder_in_p1tr_root\\subfolder\\file.txt'.
In lib.plugins.PluginLoader some changes have to be done that it works with the different paths on different operating systems.

The config component will need some minor changes in some places to search common places for config files on other operating systems too.

If anyone has something to add feel free to add this to the whiteboard.

Blueprint information

Status:
Started
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Needs approval
Assignee:
Chris Ortner
Definition:
Approved
Series goal:
Accepted for 0.1
Implementation:
Beta Available
Milestone target:
milestone icon beta
Started by
Chris Ortner

Related branches

Sprints

Whiteboard

Currently replacing OS-dependent paths with os.path.join('folder', 'subfolder', 'file.txt'). Changes contained in revision 100
c-ortner

Executable under Windows since revision 133

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.