Anonymous committed a06b771

Create cookies.catalog, fix bug, apply hints from cookies.

Comments (0)

Files changed (2)

+# "cookies" for toolshelf.
+# When you try to dock a source tree, toolshelf looks in this file to
+# see if it is listed here.  If it is, and if you didn't specify any hints,
+# it uses the hints listed in this file.
 class Cookies(object):
     def __init__(self):
-        self.filename = os.path.join(TOOLSHELF, 'cookies.catalog')
+        self.filename = os.path.join(
+            TOOLSHELF, '.toolshelf', 'cookies.catalog'
+        )
         self._source_map = None
     def source_map(self):
         if self._source_map is None:
             problems = []
-            sources = Source.from_spec('external', self.filename, problems)
+            sources = Source.from_catalog('external', self.filename, problems)
             if problems:
                 raise ValueError(problems)
             self._source_map = {}
     # TODO: improve this
     if problems:
         raise SourceSpecSyntaxError(repr(problems))
+    COOKIES.apply_hints(sources)
     for source in sources: