Browse Source

[core] Remove depender external dependency

Hue used to use depender to load and concat JS. In Hue2, each page carries
the set of JS necessary.
bc Wong 13 years ago
parent
commit
4c77bb268e

+ 0 - 3
desktop/core/ext-py/depender/mootools/README

@@ -1,3 +0,0 @@
-This is a minimal django project to serve the MooTools depender.
-You may use this as a template to include depender in your own
-projects as well.

+ 0 - 0
desktop/core/ext-py/depender/mootools/__init__.py


+ 0 - 11
desktop/core/ext-py/depender/mootools/manage.py

@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-from django.core.management import execute_manager
-try:
-    import settings # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
-    sys.exit(1)
-
-if __name__ == "__main__":
-    execute_manager(settings)

+ 0 - 41
desktop/core/ext-py/depender/mootools/settings.py

@@ -1,41 +0,0 @@
-# Minimal Django settings for mootools depender.
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-    'django.template.loaders.app_directories.load_template_source',
-)
-
-MIDDLEWARE_CLASSES = (
-)
-
-ROOT_URLCONF = 'mootools.urls'
-
-INSTALLED_APPS = (
-    'depender'
-)
-
-# Depender configuration
-
-
-# Configuration of MooTools Depender for Django
-# =============================================
-import os
-import logging
-logging.basicConfig(level=logging.INFO)
-
-DEPENDER_PACKAGE_YMLS = (
-  os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "libs", "core", "package.yml")),
-  os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "libs", "more", "package.yml")),
-  # Don't forget to add the depender client to your libraries!
-  os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "client", "package.yml")),
-)
-DEPENDER_SCRIPTS_JSON = []
-
-# Set to true to re-load all JS every time. (slowish)
-DEPENDER_DEBUG = os.getenv("DEPENDER_DEBUG", "0").lower() not in ["0","false",""]
-
-DEPENDER_YUI_PATH = os.path.join(os.path.dirname(__file__), "../../compressors/yuicompressor-2.4.2.jar")

+ 0 - 6
desktop/core/ext-py/depender/mootools/urls.py

@@ -1,6 +0,0 @@
-from django.conf.urls.defaults import patterns, include
-
-urlpatterns = patterns('',
-    (r'^depender/', include('depender.urls')),
-    (r'^$', 'django.views.generic.simple.redirect_to', {'url': 'depender/'})
-)

+ 0 - 14
desktop/core/ext-py/depender/setup.py

@@ -1,14 +0,0 @@
-from setuptools import setup, find_packages
-import os
-
-base = os.path.join(os.path.dirname(__file__), "src")
-
-setup(
-      name = "depender",
-      version = "0.3",
-      url = 'http://www.mootools.net',
-      description = "Depender: JS Dep loader",
-      install_requires = ['setuptools', 'django', 'PyYAML', 'simplejson'],
-      packages = find_packages(base),
-      package_dir={'': base}
-)

+ 0 - 0
desktop/core/ext-py/depender/src/depender/__init__.py


+ 0 - 490
desktop/core/ext-py/depender/src/depender/core.py

@@ -1,490 +0,0 @@
-#!/usr/bin/env python
-"""
-Depender manages packages and components, which may
-have dependencies upon each other.
-
-There are historically two ways to specify a package:
-  - package.yml specifies a package name and files
-    it includes, and then the files have yaml headers
-    specifying what they require and provide
-  - scripts.json specifies a library (roughly equivalent
-    to a package) which has files; the components
-    are simply the filenames
-The newer package.yml form lets you have multiple components
-with the same name, if they're in different packages.
-
-Here is how the classes are structured:
-
- DependerData:
-   Inputs: package.yml files, scripts.json files (legacy)
-     package -> PackageData
-       metadata
-       component -> FileData
-         file_name/content
-         provides: [(package, component)]
-         requires: [(package, component)]
-     legacy_component_name -> [packages]
-    
- Components tend to be referred by (package, component) tuples.
-
-TODO: Use a ComponentId class instead of a tuple.
-"""
-
-import re
-import yaml
-import os
-import simplejson
-import logging
-
-# Matches the bit inbetween --- and ...
-YAML_SECTION = re.compile(".*^---$(.*)^\.\.\.$.*", re.MULTILINE | re.DOTALL)
-
-LOG = logging.getLogger(__name__)
-
-class DependerData(object):
-  """
-  Main class that holds all the data.
-  """
-  def __init__(self, package_ymls=None, script_jsons=None):
-    """
-    package_ymls is list of filenames; script_jsons
-    is list of (library_name, filename) pairs.
-    """
-    if package_ymls is None:
-      package_ymls = []
-    if script_jsons is None:
-      scripts_json = []
-
-    self.packages = {}
-    self.package_aliases = {}
-    self.unqualified_components = {}
-
-    self.script_json_packages = []
-
-    package_ymls = package_ymls or []
-    self.yaml_packages = [ YamlPackageData(f) for f in package_ymls ]
-    self.script_json_packages = [ ScriptsJsonPackage(pkg_name, scripts_json_file) for 
-      pkg_name, scripts_json_file in script_jsons ]
-
-    all_packages = self.yaml_packages + self.script_json_packages
-
-    for p in all_packages:
-      if p.key in self.packages:
-        raise Exception("Duplicate package: " + p.key)
-      self.packages[p.key] = p
-      if hasattr(self.packages[p.key], 'aliases'):
-        for alias in self.packages[p.key].aliases:
-          self.package_aliases[alias] = p.key
-      for component_name, file_data in p.components.iteritems():
-        self.unqualified_components.setdefault(component_name, []).append(file_data)
-
-    # Resolve script_json dependencies
-    for p in self.script_json_packages:
-      for fd in p.components.itervalues():
-        try:
-          fd.resolve_dependencies(self)
-        except: 
-          LOG.exception("Error in %s" % p.scripts_json_filename)
-          raise
-    try:
-      self.self_check()
-    except:
-      LOG.exception("Depender self check failed.  Continuing with abandon.")
-
-  def resolve_unqualified_component(self, component, preferred_package=None):
-    """
-    Returns a (package, component) tuple given only a component name.
-    This is useful when only the component is known (legacy scripts.json).
-
-    This is only possible when the name is unique or when
-    there's a preferred package (because we might prefer
-    the "current" package).
-    """
-    possibilities = self.unqualified_components.get(component, [])
-    if len(possibilities) == 0:
-      raise Exception("Could not find dependency %r." % component)
-    elif len(possibilities) == 1:
-      return possibilities[0].package.key, component
-    elif len(possibilities) > 1:
-      # Prefer dependencies inside the same package
-      if preferred_package is not None:
-        if component in self.packages[preferred_package].components:
-          LOG.warn("Multiple dependencies were possible for component %r" % component)
-          return (preferred_package, component)
-      else:
-        raise Exception("Could not resolve ambiguous dependency %r" % component)
-
-  def self_check(self):
-    """
-    Checks that no dependencies are unsatisfied.
-
-    TODO: Does not check that there are no cycles
-    in the dependency graph.
-    """
-    out = "Loaded components\n"
-    for package_name, package in sorted(self.packages.items()):
-      out += "\t%s:\n" % package_name
-      for c, fd in sorted(package.components.iteritems()):
-        out += "\t\t%s (%s)\n" % (c, fd.filename)
-
-    out += "\tAliases:\n"
-    for alias, package in sorted(self.package_aliases.items()):
-      out += "\t\t%s (%s)\n" % (alias, package)
-
-    LOG.debug(out)
-
-    for p in self.packages.values():
-      for f in p.files:
-        for id in f.requires:
-          # This throws if it doesn't find something.
-          try:
-            self.get(id)
-          except:
-            LOG.exception("Error in: " + f.filename)
-            raise
-          
-  def get(self, id):
-    """
-    Retrieves a FileData object given (package, component) pair.
-    """
-    pkg_key, component_key = id
-    if pkg_key in self.package_aliases:
-      pkg_key = self.package_aliases[pkg_key]
-    if pkg_key not in self.packages:
-      raise Exception("Package not found while looking for id: %s " % repr(id))
-    p = self.packages[pkg_key]
-    if component_key not in p.components:
-      raise Exception("Component %s not found in package %s." % (component_key, pkg_key))
-    return p.components[component_key]
-
-  def get_client_js(self, components, url):
-    """
-    returns the javascript necessary to integrate with Depender.Client.js
-
-    @param components: Component ids loaded in this pass.
-    @param url: the url of the builder view
-    """
-    out = "\n\n"
-    if len(components) > 0:
-      out += "Depender.loaded.combine(['"
-      out += "','".join([ "/".join(c) for c in components ]) + "']);\n\n"
-    out += "Depender.setOptions({\n"
-    out += "	builder: '" + url + "'\n"
-    out += "});"
-    return out;
-
-  def graph(self):
-    """
-    Returns a pydot.Dot object representing the dependency graph.
-    Requires pydot to be available.
-    """
-    import pydot
-    edges = set()
-    for p in self.packages.values():
-      for f in p.files:
-        for id in f.requires:
-          f2 = self.get(id)
-          edges.add( ("--".join([p.key, f.shortname]), "--".join([f2.package.key, f2.shortname])) )
-    return pydot.graph_from_edges(edges, directed=True)
-
-  def _get_transitive_dependencies_helper(self, target, excluded_set, accumulator, depth_limit=30):
-    """
-    @param target is a single required component id
-    @param excluded_set is a list of components already loaded or previously included
-    @param accumulator is an ordered list of components to load
-
-    It would be possible to combine excluded_set and accumulator into one
-    if python had built-in ordered sets, but note that excluded_set might
-    be non empty at the beginning.
-    """
-    if depth_limit <= 0:
-      raise Exception("Dependency depth limit exceeded, resolving: %s" % (str(target),) )
-    if target in excluded_set:
-      return
-    for c in self.get(target).requires:
-      if c not in excluded_set:
-        self._get_transitive_dependencies_helper(c, excluded_set, accumulator, depth_limit=depth_limit-1)
-    accumulator.append(target)
-    excluded_set.add(target)
-
-  def get_transitive_dependencies(self, required, excluded=None):
-    """
-    required and excluded are lists of (package, component) pairs
-
-    Returns an ordered list of (package, component) pairs.
-    """
-    required = set(required)
-    if excluded is None:
-      excluded = []
-    orig_excluded = excluded
-    excluded = set(excluded)
-    accumulator = []
-    for c in required:
-      self._get_transitive_dependencies_helper(c, excluded, accumulator)
-    LOG.debug("Calculated dependencies: %s - %s: %s" % (repr(required), repr(orig_excluded), repr(accumulator)))
-    return accumulator
-
-  def expand_package(self, pkg):
-    """
-    Expands a package name into all its components.
-    """
-    return [ (pkg, c) for c in self.packages[pkg].components ]
-
-  def get_files(self, components, excluded_components=None):
-    """
-    Retrieves list of DataFile objects given required components.
-
-    Note that we have to expand excluded components into their
-    files: Say A depends on B, and (B,C) are colocated in one file.
-    If we already have C, we must already have B, even if we
-    don't know it.
-
-    TODO: arguably, this is a bug in get_client_js, which
-    should expand everything.
-    """
-    if excluded_components is None:
-      excluded_components = []
-  
-    # List of already processed or excluded
-    files_set = set()
-    excluded_files_set = set()
-    files = []
-    
-    for c in excluded_components:
-      excluded_files_set.add(self.get(c))
-
-    for c in components:
-      f = self.get(c)
-      if f not in files_set and f not in excluded_files_set:
-        files_set.add(f)
-        files.append(f)
-    return files
-
-def _coerce_string_to_list(potential_string):
-  if isinstance(potential_string, basestring):
-    return [ potential_string ]
-  else:
-    return potential_string
-
-class YamlFileData(object):
-  """Source file pointed to by a package.yml."""
-  def __init__(self, shortname, filename, package, metadata):
-    self.shortname = shortname
-    self.filename = filename
-    self.content = _force_unicode(file(filename).read())
-    self.metadata = metadata
-    self.package = package
-    self.provides = [(package.key, module) for module in _coerce_string_to_list(metadata["provides"])]
-    self.requires = []
-    self.requires = [ self._parse_component_string(r) for r in _coerce_string_to_list(metadata.get("requires", [])) ]
-
-  def _parse_component_string(self, component):
-    """
-    Parses package:version/component string into (package, component).
-    """
-    # In package.yml files, the syntax is "package:version/component",
-    # and an empty package:version implies "current package".
-    # This code ignores version.
-    package_component = component.split("/", 2)
-    if len(package_component) == 1:
-      package_key = self.package.key
-      component = package_component[0]
-    else:
-      package, component = package_component
-      if package is "":
-        package_key = self.package.key
-      else:
-        package_key = package.split(":")[0]
-    return package_key, component
-
-class ScriptsJsonFileData(object):
-  """Source file pointed to by a scripts.json"""
-  def __init__(self, module_name, shortname, filename, package, metadata):
-    self.filename = filename
-    self.shortname = shortname
-    self.content = _force_unicode(file(filename).read())
-    self.package = package
-    self.metadata = metadata
-    self.provides = [ (package.key, module_name) ]
-
-  def resolve_dependencies(self, all_data):
-    """
-    We resolve dependencies after everything has been loaded, to 
-    be able to notice ambiguous dependencies.
-    """
-    self.requires = []
-    for dep in self.metadata["deps"]:
-      key = (self.package.key, dep)
-      if key in self.provides:
-        raise Exception("Package shouldn't depend on itself: %s" % repr(key))
-      self.requires.append( all_data.resolve_unqualified_component(dep, self.package.key) )
-        
-class YamlPackageData(object):
-  def __init__(self, package_filename):
-    self.components = {}
-    self.files = []
-    try:
-      self.metadata = yaml.load(file(package_filename))
-    except:
-      LOG.exception("Could not parse: " + package_filename)
-      raise
-
-    self.aliases = []
-    if "aliases" in self.metadata:
-      self.aliases = self.metadata["aliases"]
-
-    rootdir = os.path.dirname(package_filename)
-    self.key = self.metadata["name"]
-    for source_file in self.metadata["sources"]:
-      filename = os.path.join(rootdir, source_file)
-      metadata = _parse_js_file(filename)
-      assert len(metadata["provides"]) > 0
-      try:
-        fd = YamlFileData(source_file, filename, self, metadata)
-      except:
-        LOG.exception("Error processing: " + filename)
-        raise
-      self.files.append(fd)
-      for pkg_key, component in fd.provides:
-        assert pkg_key == self.key
-        if component in self.components:
-          raise Exception("Two files provide %s: %s and %s" % (component, self.components[component].filename, fd.filename))
-        self.components[component] = fd
-
-class ScriptsJsonPackage(object):
-  def __init__(self, package_name, scripts_json_filename):
-    self.components = {}
-    self.files = []
-    self.key = package_name
-    self.metadata = simplejson.load(file(scripts_json_filename))
-    self.scripts_json_filename = scripts_json_filename
-    rootdir = os.path.dirname(scripts_json_filename)
-    for category, components in self.metadata.iteritems():
-      for component, metadata in components.iteritems():
-        filename = os.path.join(rootdir, category, component) + ".js"
-        shortname = os.path.join(category, component)
-        if not os.path.exists(filename):  
-          raise Exception("File not found: " + filename)
-        fd = ScriptsJsonFileData(component, shortname, filename, self, metadata)
-        if component in self.components:
-          raise Exception("Two files provide %s: %s and %s" % (component, self.components[component].filename, fd.filename))
-        self.components[component] = fd
-        self.files.append(fd)
-
-  def rewrite(self):
-    """Edits the scripts to use the new YaML syntax."""
-    for f in self.files:
-      metadata = dict()
-      metadata["description"] = f.metadata.get("desc", "Unknown")
-      metadata["script"] = os.path.basename(f.filename)
-      metadata["requires"] = []
-      for package, component in f.requires:
-        if package == self.key:
-          metadata["requires"].append("/" + component)
-        else:
-          metadata["requires"].append(package + "/" + component)
-      metadata["provides"] = [ p[1] for p in f.provides ]
-      # Resolve symlinks
-      real_filename = os.path.realpath(f.filename)
-      LOG.info("Editing: " + real_filename)
-      new_filename = f.filename + ".new"
-      new = file(new_filename, "w")
-      new.write("/*\n---\n")
-      new.write(yaml.dump(metadata))
-      new.write("\n...\n*/\n")
-      new.write(file(f.filename).read())
-      new.close()
-      os.rename(new_filename, real_filename)
-
-    package_data = dict()
-    package_data["name"] = self.key
-    package_data["sources"] = []
-    package_data["version"] = "Unknown"
-    package_data["copyright"] = "Unknown"
-    package_data["description"] = "Unknown"
-    target_dir = os.path.dirname(self.scripts_json_filename)
-    # package.yml is typically in the parent of the scripts.json dir
-    if os.path.basename(target_dir) == "Source":
-      target_dir = os.path.dirname(target_dir)
-    target_filename = os.path.join(target_dir, "package.yml")
-    for f in self.files:
-      common = os.path.commonprefix([target_filename, f.filename])
-      source_file = f.filename[len(common):]
-      package_data["sources"].append(source_file)
-    LOG.info("Writing: " + target_filename)
-    out = file(target_filename, "w")
-    out.write(yaml.dump(package_data))
-    out.close()
-
-def _force_unicode(data):
-  """Encodings of the js files are unclear; force things
-  into unicode, somewhat hackily."""
-  try:
-    data = unicode(data, "utf-8")
-  except UnicodeDecodeError:
-    data = unicode(data, "latin1")
-  return data
-          
-def _parse_js_file(filename):
-  """Find yaml section in javascript file."""
-  data = _force_unicode(file(filename).read())
-
-  m = YAML_SECTION.match(data)
-  if not m:
-    raise Exception("Could not succesfully find YAML section in %r." % filename)
-    return None
-  try:  
-    return yaml.load(m.groups(0)[0])    
-  except:
-    LOG.exception("Could not parse: " + filename)
-    raise
-
-#############################################
-#
-# Below are commands run by the "main", which provide
-# some handy utilities.
-#
-# TODO(philip): Move these into management commands.
-def graph(data, args):
-  if len(args) != 1:
-    LOG.fatal("Expected output filename.")
-    return 1
-  g = data.graph()
-  g.write_png(args[0])
-  print "Wrote " + args[0]
-
-def resolve(data, args):
-  required = args[0].split(",")
-  if len(args) > 1:
-    excluded = args[1].split(",")
-  else:
-    excluded = []
-  def make_ids(data):
-    return [ tuple(x.split("/", 2)) for x in data ]
-  print data.get_transitive_dependencies(make_ids(required), make_ids(excluded))
-
-# TODO: The migration of these commands into Django management commands
-# is already in progress!
-if __name__ == "__main__":
-  LOG.basicConfig(level=logging.INFO)
-  import sys
-  yamls = []
-  scripts_json = []
-
-  paths = sys.argv[1].split(",")
-  for path in paths:
-    if path.endswith(".yml"):
-      yamls.append(path)
-    elif path.endswith(".json"):
-      scripts_json.append(path.split(":", 2))
-    else:
-      raise Exception("Unexpected path: " + path)
-  data = DependerData(yamls, scripts_json)
-  command = sys.argv[2]
-
-  if command == "graph":
-    sys.exit(graph(data, sys.argv[3:]) or 0)
-  elif command == "resolve":
-    sys.exit(resolve(data, sys.argv[3:]) or 0)
-  else:
-    raise Exception("Unrecognized command: " + command)

+ 0 - 0
desktop/core/ext-py/depender/src/depender/management/__init__.py


+ 0 - 0
desktop/core/ext-py/depender/src/depender/management/commands/__init__.py


+ 0 - 12
desktop/core/ext-py/depender/src/depender/management/commands/depender_check.py

@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-from django.core.management.base import NoArgsCommand
-from depender import views
-
-class Command(NoArgsCommand):
-  """
-  Runs depender's self_check command.  Effectively
-  initializes depender.
-  """
-  def handle_noargs(self, **options):
-    views.depender.self_check()

+ 0 - 13
desktop/core/ext-py/depender/src/depender/management/commands/depender_rewrite.py

@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-
-from django.core.management.base import NoArgsCommand
-from depender import views
-
-class Command(NoArgsCommand):
-  """
-  Rewrites all script_json packages to use package.yml
-  syntax.
-  """
-  def handle_noargs(self, **options):
-    for p in views.depender.script_json_packages:
-      p.rewrite()

+ 0 - 2
desktop/core/ext-py/depender/src/depender/models.py

@@ -1,2 +0,0 @@
-#!/usr/bin/env python
-# Django asks that apps have models files, even if empty.

+ 0 - 44
desktop/core/ext-py/depender/src/depender/static/test.html

@@ -1,44 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-	<head>
-		<title>Depender - A MooTools Dependency Builder</title>
-		<link rel="stylesheet" href="/depender/static/reset.css" type="text/css" media="screen" title="no title" charset="utf-8">
-		<link rel="stylesheet" href="/depender/static/depender.css" type="text/css" media="screen" title="no title" charset="utf-8">
-		<script src="/depender/build?client=true"></script>
-	</head>
-	<body>
-		<style>
-		#success {
-			width: 200px;
-			height: 64px;
-			border: 1px solid #000;
-			background: #fff;
-			font-size: 16px;
-			line-height: 16px;
-			padding: 80px 0px 40px;
-			text-align: center;
-			visibility: hidden;
-		}
-		</style>
-		<script>
-		Depender.enableLog().require({
-			scripts: ['Element.Position', 'Fx.Tween'],
-			callback: function(){
-				console.log('loaded!');
-				$('success').position({
-					relative: document.body,
-					position: 'top',
-					edge: 'center',
-					offset: {y: 200}
-				}).setStyles({
-					opacity: 0,
-					visibility: 'visibile'
-				}).tween('opacity', 1);
-			}
-		});
-		</script>
-		<div id="success">
-			Woot! It works!
-		</div>
-	</body>
-</html>

+ 0 - 11
desktop/core/ext-py/depender/src/depender/urls.py

@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-
-from django.conf.urls.defaults import patterns, url
-import os
-
-urlpatterns = patterns('',
-  url(r'^build$', 'depender.views.build'),
-  url(r'^test$', 'depender.views.test'),
-  (r'^static/(?P<path>.*)$', 'django.views.static.serve',
-    {'document_root': os.path.join(os.path.dirname(__file__), '..', '..', '..', 'styles')}),
-)

+ 0 - 139
desktop/core/ext-py/depender/src/depender/views.py

@@ -1,139 +0,0 @@
-#!/usr/bin/env python
-#
-# JavaScript depender.  Loads and concatenates necessary
-# JavaScript files.
-
-import logging
-
-from django.http import HttpResponse
-from django.conf import settings
-from django.core import urlresolvers
-
-from depender.core import DependerData
-
-LOG = logging.getLogger(__name__)
-
-def make_depender():
-  try:
-    return DependerData(settings.DEPENDER_PACKAGE_YMLS, settings.DEPENDER_SCRIPTS_JSON)
-  except:
-    logging.exception("Could not build JavaScript dependency map.")
-    return None
-
-depender = make_depender()
-
-def get_depender(reset):
-  global depender
-  if settings.DEPENDER_DEBUG:
-    return make_depender()
-  else:
-    if reset == "true":
-      depender = make_depender()
-    return depender
-
-def massage(depender, components, packages):
-  """
-  @param depender: A DependerData object
-  @param components: Component names, in either package/component format, or just
-    "naked" (hopefully unique) components.
-  @param packages: Package names, which expand into their constituent components.
-  @return A set of all components specified.
-  """
-  ret = set()
-  for package in packages:
-    ret.update(depender.expand_package(package))
-  for component in components:
-    if "/" in component:
-      ret.add( tuple(component.split("/", 2)) )
-    else:
-      ret.add( depender.resolve_unqualified_component(component) )
-  return ret
-
-def build(request):
-  """
-    builds a library given required scripts to includes and other arguments
-    accepted URL arguments:
-
-    all - if set to "true", returns all the javascript, except as specified by exclude.  require and requireLibs are ignored.
-    require - a comma separated list of *files*(components) to require; can also be specified in the php style as "require[]=foo&require[]=bar"
-    requireLibs - a comma separated list of *libraries*(packages) to require - these are the names defined in our *congfig.json* in the *libs* section. So, for example, *requireLibs=mootools-core,mootools-more* using the default config would include both the complete inventories of MooTools Core and More. This can also be specified as a comma separated list or the php style (*requireLibs[]=mootools-core&requireLibs[]=mootools-more*).
-    exclude - exactly like the *require* value, except it's a list of files to exclude. This is useful if you have already loaded some scripts and now you require another. You can specify the scripts you already have and the one you now need, and the library will return only those you do not have.
-    excludeLibs - just like the *exclude* option but instead you can specify entire libraries.
-    NOT IMPLEMENTED: cache - if set to *true* you'll be returned a cached version of the script even if the server is set to *false* and vice versa.
-    compression - you'll be returned the compression type you specify regardless of the server default. Note that if you specify a compression type that the server does not allow, you'll be returned which ever one it does. If it does not support compression at all, you will not be returned a compressed file. You can also specify "none" which is useful for development and debugging.
-  """
-  def get(name):
-    return request.GET.get(name)
-  def get_arr(name):
-    val = get(name)
-    if val:
-      return val.split(",")
-    else:
-      return []
-
-  all = get("all")
-  require = get_arr("require")
-  exclude = get_arr("exclude")
-  excludeLibs = get_arr("excludeLibs")
-  requireLibs = get_arr("requireLibs")
-  download = get("download")
-  reset = get("reset")
-  client = get("client")
-  compression = get("compression")
-
-  dpdr = get_depender(reset)
-  if dpdr is None:
-    return HttpResponse("alert('Javascript dependency loader unavailable. Contact your administrator to check server logs for details.')")
-    
-  if compression is None:
-    compression = "none"
-    # TODO: implement compression
-    # compression = dpdr.default_compression
-  if settings.DEPENDER_DEBUG:
-    compression = "none"
-
-  if client == "true" and "Depender.Client" not in require:
-    require.append("Depender.Client")
-
-  if all == "true":
-    require = []
-    requireLibs = depender.packages.keys()
-
-  required = massage(depender, require, requireLibs)
-  excluded = massage(depender, exclude, excludeLibs)
-
-  deps = dpdr.get_transitive_dependencies(required, excluded)
-  files = dpdr.get_files(deps, excluded)
-  output = "//No files included for build"
-
-  if len(files) > 0:
-    #TODO: add copyrights
-    #TODO: add link to download link
-    #TODO: add download file stuff
-    output = u""
-    output += "\n//This library: " + request.build_absolute_uri(request.get_full_path())
-    output += "\n//Contents: "
-    output += ", ".join([ i.package.key + ":" + i.shortname for i in files ])
-    output += "\n\n"
-  
-    for f in files:
-      output += "// Begin: " + f.shortname + "\n"
-      output += f.content + u"\n\n"
-
-  if client == "true":
-    url = request.build_absolute_uri(
-      urlresolvers.reverse("depender.views.build"))
-    output += dpdr.get_client_js(deps, url)
-
-  response = HttpResponse(output, content_type="application/x-javascript")
-  if download == "true":
-    response['Content-Disposition'] = 'attachment; filename=built.js'
-  return response
-build.login_notrequired = True
-
-def test(request):
-  #this seems silly
-  import os
-  p = os.path.join(os.path.dirname(__file__), "static", "test.html")
-  f = file(p)
-  return HttpResponse(f.read())