Skip to content

Commit

Permalink
Used get_include_contents; improved mixin search logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusf committed Jun 3, 2015
1 parent 2c3c9b8 commit 91f4cec
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,27 @@ def save(self, theme_name):
inclusions = self.data["include"]
inclusions.reverse()
already_included = [theme_name]
in_include_directory = get_include_contents()
while len(inclusions) > 0:
i = inclusions.pop()
# prevents recursive dependency, since it only looks in the same directory
if i not in already_included:
if i in already_included:
print("%s is already included." % (i))
else:
already_included.append(i)
print("Looking for %s in %s..." % (i, self.directory), end=' ')
_, entries = load_json_data(os.path.join(self.directory, i + '.json'))
if entries is None:
print("Searching in Packages/synesthesia/include...")
_, entries = load_json_data(os.path.join(sublime.packages_path(), "synesthesia", "include", i + '.json'))
if entries is not None:
print("Found!")
else:
print("Looking in %s..." % (SYNESTHESIA_INCLUDE_PATH), end=' ')
if i in in_include_directory:
print("Found!")
_, entries = load_json_data(sublime.load_resource(os.path.join(SYNESTHESIA_INCLUDE_PATH, i + '.json')), False)
else:
print("Could not find %s." % (i))

# Proceed if after all that we actually ended up with some input
if entries is not None:
print("%s included." % (i + '.json'))
if "include" in entries:
Expand Down

0 comments on commit 91f4cec

Please sign in to comment.