Skip to content

Commit

Permalink
Refactor filetools
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Aug 15, 2018
1 parent b4c7f36 commit 5add4eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions lib/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,8 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import os

from wlf.path import PurePath
from wlf.pathtools import make_path_finder

ROOT = os.path.abspath(os.path.dirname(__file__))
module_path = make_path_finder(__file__) # pylint: disable = invalid-name
plugin_folder_path = make_path_finder( # pylint: disable = invalid-name
module_path())


def path(*other):
"""Get path relative to `ROOT`.
Returns:
PurePath -- Absolute path under root.
"""

ret = PurePath(ROOT)
for i in other:
ret /= i
return ret
2 changes: 1 addition & 1 deletion lib/pyblish_lite_nuke.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __init__(self, parent=None):
self.resize(*settings.WindowSize)
self.setWindowTitle(settings.WindowTitle)

with open(e(filetools.path("pyblish_lite.css"))) as f:
with open(e(filetools.module_path("pyblish_lite.css"))) as f:
css = u(f.read())

# Make relative paths absolute
Expand Down

0 comments on commit 5add4eb

Please sign in to comment.