diff options
author | Diogo Laginha <dmachado@ipn.pt> | 2011-12-21 12:59:05 +0000 |
---|---|---|
committer | Diogo Laginha <dmachado@ipn.pt> | 2011-12-21 12:59:05 +0000 |
commit | b1a42d3ef8ac83feeccf8479b2bf263fb35f32a7 (patch) | |
tree | 032513ef80cb3ffa402e4001980f582013958691 | |
parent | 6483d6069401d71c2b78d19560de5544ddc79b9a (diff) | |
download | pycco-b1a42d3ef8ac83feeccf8479b2bf263fb35f32a7.tar.gz |
change css display property according to the number of folders selected for processing
-rw-r--r-- | pycco/main.py | 5 | ||||
-rw-r--r-- | pycco/utils.py | 6 | ||||
-rw-r--r-- | pycco_resources/__init__.py | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/pycco/main.py b/pycco/main.py index 76309da..f72fce3 100644 --- a/pycco/main.py +++ b/pycco/main.py @@ -487,13 +487,12 @@ def main(): opts, sources = parser.parse_args() - filepath = os.path.dirname( sources[0] ) start, filetype = os.path.splitext( sources[0] ) + print start if start.endswith( '*' ): - return - #raise NoFilesFound() + raise NoFilesFound() else: start = os.path.dirname( os.path.dirname( start ) ) diff --git a/pycco/utils.py b/pycco/utils.py index ffffd49..9698b53 100644 --- a/pycco/utils.py +++ b/pycco/utils.py @@ -44,7 +44,7 @@ class Source: def relative_paths(self, sources): root_ = ''; list_ = []; dict_ = {}; id_ = 1 title = lambda s: { 'title': s.title, 'url': self.relative_path( s ) } - new_dict = lambda s: { 'id': id_, 'dirname': s.dirname, 'titles': [ title( s ) ], } + new_dict = lambda s: { 'id': id_, 'dirname': s.dirname, 'display': 'none', 'titles': [ title( s ) ], } for source in sources: if source.dirpath != root_: @@ -55,8 +55,10 @@ class Source: id_ += 1 else: dict_[ 'titles' ].append( title( source ) ) - + list_.append( dict_ ) + if len( list_ ) == 1: + list_[0]['display'] = 'block' return list_ diff --git a/pycco_resources/__init__.py b/pycco_resources/__init__.py index a3c3dbe..673a914 100644 --- a/pycco_resources/__init__.py +++ b/pycco_resources/__init__.py @@ -208,7 +208,6 @@ html = """\ main = "#".concat( main ); details = "#".concat( details ); $(main).click( function() { - console.log('fff'); if ( $( details ).is( ':hidden' ) ) { $( main ).addClass( "active" ); $( details ).slideDown( 'fast' ); @@ -235,7 +234,7 @@ html = """\ <a class="source" id="pathname"> {{ dirname }} </a> </div> - <div id="{{ id }}_titles" style="display:none;"> + <div id="{{ id }}_titles" style="display: {{ display }};"> {{#titles}} <a class="source" id="filename" href="{{ url }}"> {{ title }} </a> {{/titles}} |