import sublime

import os


FTYPE_EXT_KEYMAP        = ".sublime-keymap"
FTYPE_EXT_COMPLETIONS   = ".sublime-completions"
FTYPE_EXT_SNIPPET       = ".sublime-snippet"
FTYPE_EXT_BUILD         = ".sublime-build"
FTYPE_EXT_SETTINGS      = ".sublime-settings"
FTYPE_EXT_TMPREFERENCES = ".tmPreferences"
FTYPE_EXT_TMLANGUAGE    = ".tmLanguage"


def root_at_packages(*leafs):
    """Combines leafs with path to Sublime's Packages folder.
    """
    return os.path.join(sublime.packages_path(), *leafs)


def root_at_data(*leafs):
    """Combines leafs with Sublime's ``Data`` folder.
    """
    data = os.path.join(os.path.split(sublime.packages_path())[0])
    return os.path.join(data, *leafs)


def path_to_dict(file_path):
    """Returns a dict with the following fields:
    file_path, path, file_name, ext, no_ext
    """
    path, file_name = os.path.split(file_path)
    base_name, ext = os.path.splitext(file_name)
    return dict(
        file_path=file_path,
        path=path,
        file_name=file_name,
        ext=ext,
        no_ext=os.path.join(path, base_name)
    )

@@ -7,18 +7,79 @@
  sublime
-%0D%0A
+ as _sublime%0D%0Afrom collections import namedtuple as _namedtuple
 %0D%0Aimport
@@ -81,16 +81,23 @@
 mport os
+ as _os
 %0D%0A%0D%0A%0D%0AFT
@@ -521,32 +521,33 @@
 %22%22%22%0D%0A    return 
+_
 os.path.join(sub
@@ -543,16 +543,17 @@
 th.join(
+_
 sublime.
@@ -684,16 +684,17 @@
  data = 
+_
 os.path.
@@ -698,16 +698,17 @@
 th.join(
+_
 os.path.
@@ -713,16 +713,17 @@
 h.split(
+_
 sublime.
@@ -755,16 +755,17 @@
  return 
+_
 os.path.
@@ -784,24 +784,113 @@
 leafs)%0D%0A%0D%0A%0D%0A
+PathDict = _namedtuple(%22PathDict%22, %22file_path path file_name base_name ext no_ext%22)%0D%0A%0D%0A%0D%0A
 def path_to_
@@ -1033,16 +1033,17 @@
 _name = 
+_
 os.path.
@@ -1081,16 +1081,17 @@
 , ext = 
+_
 os.path.
@@ -1122,17 +1122,21 @@
  return 
-d
+PathD
 ict(%0D%0A  
@@ -1145,18 +1145,8 @@
     
-file_path=
 file
@@ -1165,13 +1165,8 @@
     
-path=
 path
@@ -1189,12 +1189,22 @@
 name
-=fil
+,%0D%0A        bas
 e_na
@@ -1216,20 +1216,16 @@
         
-ext=
 ext,%0D%0A  
@@ -1237,16 +1237,17 @@
  no_ext=
+_
 os.path.

Use a named tuple for sublime_lib.path.path_to_dict