Changeset cf1319956bf7411ce216cc5ab34e65b98755a9d1

Show
Ignore:
Timestamp:
11/18/07 20:16:11 (1 year ago)
Author:
Jason Michalski <armooo@armooo.net>
git-committer:
Jason Michalski <armooo@armooo.net> 1195438571 -0600
git-parent:

[6ddab42fe78f34a472b3b1ad2d44b217a7e112d6]

git-author:
Jason Michalski <armooo@armooo.net> 1195438571 -0600
Message:

Added auto subshares

Create a share for all subfolders

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • config.py

    r8698247 rcf13199  
    4343 
    4444def getShares(): 
    45     return ( (section, dict(config.items(section))) for section in config.sections() if not(section.startswith('_tivo_') or section == 'Server') ) 
     45    shares = [ (section, dict(config.items(section))) for section in config.sections() if not(section.startswith('_tivo_') or section == 'Server') ] 
     46 
     47    for name, data in shares: 
     48        if not data.get('auto_subshares', 'False').lower() == 'true': 
     49            continue 
     50 
     51        base_path = data['path'] 
     52        for item in os.listdir(base_path): 
     53            item_path = os.path.join(base_path, item) 
     54            if not os.path.isdir(item_path): 
     55                continue 
     56 
     57            new_name = name + '/' + item 
     58            new_data = dict(data) 
     59            new_data['path'] = item_path 
     60 
     61            shares.append( (new_name, new_data) ) 
     62 
     63    return shares 
     64 
    4665 
    4766def getDebug(): 
  • pyTivo.conf.dist

    r10fc438 rcf13199  
    5454path=/home/armooo/Videos 
    5555 
     56#Make all subfolders in to top level shares 
     57#auto_subshares= True 
     58 
     59 
    5660 
    5761##You can have more than one share