Use .html instead of .dat so the iframe can display the files
authorW. Trevor King <wking@drexel.edu>
Sun, 18 Jul 2010 17:26:33 +0000 (13:26 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 18 Jul 2010 17:26:33 +0000 (13:26 -0400)
README
dirtag/__init__.py

diff --git a/README b/README
index cc10340b9f7efe3fec42ffdbab437cd3bbed1c90..323d9d28b5d875d911d74cf89e9605ceb65e0e33 100644 (file)
--- a/README
+++ b/README
@@ -10,34 +10,34 @@ For example, with a raw directory like this::
 
     raw
     |-- a
-    |   |-- a1.dat
-    |   |-- a2.dat
-    |   `-- a3.dat
+    |   |-- a1.html
+    |   |-- a2.html
+    |   `-- a3.html
     `-- b
-        |-- b1.dat
-        |-- b2.dat
-        `-- b3.dat
+        |-- b1.html
+        |-- b2.html
+        `-- b3.html
 
 You could create a tag directory like this::
 
     tag/
     |-- 1
-    |   |-- a1.dat -> ../../raw/a/a1.dat
-    |   `-- b1.dat -> ../../raw/b/b1.dat
+    |   |-- a1.html -> ../../raw/a/a1.html
+    |   `-- b1.html -> ../../raw/b/b1.html
     `-- x
-        |-- a2.dat -> ../../raw/a/a2.dat
-        |-- b3.dat -> ../../raw/b/b3.dat
+        |-- a2.html -> ../../raw/a/a2.html
+        |-- b3.html -> ../../raw/b/b3.html
         `-- y
-            `-- b1.dat -> ../../../raw/b/b1.dat
+            `-- b1.html -> ../../../raw/b/b1.html
 
 Corresponding to the following tags::
 
-    a1.dat     1
-    a2.dat     x
-    a3.dat
-    b1.dat     1, x/y
-    b2.dat     
-    b3.dat     x
+    a1.html    1
+    a2.html    x
+    a3.html
+    b1.html    1, x/y
+    b2.html    
+    b3.html    x
 
 Then you could play all your x/y music with::
 
index 22701049635072357293cf253b56a81ce522d634..fb24f31b250129f11dbce01c9c614d954efe8ac3 100644 (file)
@@ -82,19 +82,19 @@ def dir_tree(root_dir):
     >>> t = dir_tree('test/tag')
     >>> print '\\n'.join(['|'.join(x) for x in t.traverse(depth=1)])
     1
-    1|a1.dat
-    1|b1.dat
+    1|a1.html
+    1|b1.html
     x
     x|y
-    x|y|b1.dat
-    x|a2.dat
-    x|b3.dat
+    x|y|b1.html
+    x|a2.html
+    x|b3.html
     >>> print '\\n'.join(['|'.join(x) for x in t.traverse(depth=1, type='files')])
-    1|a1.dat
-    1|b1.dat
-    x|y|b1.dat
-    x|a2.dat
-    x|b3.dat
+    1|a1.html
+    1|b1.html
+    x|y|b1.html
+    x|a2.html
+    x|b3.html
     >>> print '\\n'.join(['|'.join(x) for x in t.traverse(depth=1, type='dirs')])
     1
     x
@@ -125,36 +125,36 @@ class Dirtag (object):
     ...                   for x in d.elements()]
     ...                 )  # doctest: +NORMALIZE_WHITESPACE
     dir       test/raw      a      
-    file      test/raw      a|a1.dat      1
-    file      test/raw      a|a2.dat      x
-    file      test/raw      a|a3.dat      
+    file      test/raw      a|a1.html      1
+    file      test/raw      a|a2.html      x
+    file      test/raw      a|a3.html      
     dir       test/raw      b      
-    file      test/raw      b|b1.dat      1,x/y
-    file      test/raw      b|b2.dat      
-    file      test/raw      b|b3.dat      x
+    file      test/raw      b|b1.html      1,x/y
+    file      test/raw      b|b2.html      
+    file      test/raw      b|b3.html      x
     >>> print '\\n'.join(['|'.join(x) for x in d.elements(['x'])])
     x|y
-    x|y|b1.dat
-    x|a2.dat
-    x|b3.dat
-    >>> print '\\n'.join(['|'.join(x) for x in d.tags(['b', 'b2.dat'])])
+    x|y|b1.html
+    x|a2.html
+    x|b3.html
+    >>> print '\\n'.join(['|'.join(x) for x in d.tags(['b', 'b2.html'])])
     <BLANKLINE>
-    >>> print '\\n'.join(['|'.join(x) for x in d.tags(['b', 'b1.dat'])])
+    >>> print '\\n'.join(['|'.join(x) for x in d.tags(['b', 'b1.html'])])
     1
     x|y
 
-    >>> print d.tag_path(['a', 'a3.dat'], ['x', 'y'])
-    test/tag/x/y/a3.dat
+    >>> print d.tag_path(['a', 'a3.html'], ['x', 'y'])
+    test/tag/x/y/a3.html
     >>> os.listdir('test/tag/x/y')
-    ['b1.dat']
-    >>> d.add_tag(['a', 'a3.dat'], ['x', 'y'])
+    ['b1.html']
+    >>> d.add_tag(['a', 'a3.html'], ['x', 'y'])
     >>> os.listdir('test/tag/x/y')
-    ['a3.dat', 'b1.dat']
-    >>> print 'Z'+os.path.realpath('test/tag/x/y/a3.dat') # doctest: +ELLIPSIS
-    Z.../test/raw/a/a3.dat
-    >>> d.remove_tag(['a', 'a3.dat'], ['x', 'y'])
+    ['a3.html', 'b1.html']
+    >>> print 'Z'+os.path.realpath('test/tag/x/y/a3.html') # doctest: +ELLIPSIS
+    Z.../test/raw/a/a3.html
+    >>> d.remove_tag(['a', 'a3.html'], ['x', 'y'])
     >>> os.listdir('test/tag/x/y')
-    ['b1.dat']
+    ['b1.html']
     """
     def __init__(self, raw_dir, tag_dir):
         self.raw_dir = raw_dir