Permalink
Browse files

Remove unecessary Sources class

  • Loading branch information...
1 parent 461e0e9 commit 74f3c254347fae88453385199aea588ebf341a05 @treyhunner treyhunner committed Apr 15, 2012
Showing with 5 additions and 15 deletions.
  1. +2 −2 pycco/main.py
  2. +3 −13 pycco/utils.py
View
4 pycco/main.py
@@ -497,8 +497,8 @@ def main():
sources = [i for i in get_all_files(filepath or '.', filetype)]
global SOURCES
- SOURCES = Sources(sources, start)
-
+ SOURCES = [Source(name, start) for name in sources]
+
process(SOURCES, outdir=opts.outdir, preserve_paths=opts.paths)
# If the -w / --watch option was present, monitor the source directories
View
16 pycco/utils.py
@@ -32,6 +32,9 @@ def relative_path(self, source):
rel = os.path.relpath(source.dirpath, self.dirpath)
return "%s/%s" % (rel, html(source.title))
+ def __cmp__(self, other):
+ return cmp(self.name, other.name)
+
def relative_paths(self, sources):
root_ = ''
list_ = []
@@ -54,16 +57,3 @@ def relative_paths(self, sources):
if len(list_) == 1:
list_[0]['display'] = 'block'
return list_
-
-
-class Sources:
- def __init__(self, sources, start):
- self.list = [Source(name, start) for name in sources]
- self.get = lambda x: self.list[index]
-
- def names(self):
- return [i.name for i in self.list]
-
- def __iter__(self):
- for i in self.list:
- yield i

0 comments on commit 74f3c25

Please sign in to comment.