Permalink
Browse files

auto_subshares is no longer needed, either.

  • Loading branch information...
1 parent d5da698 commit cc83d9ba8b428d485bd69e0c76f44ea03b0ad751 @wmcbrine committed Dec 22, 2008
Showing with 6 additions and 56 deletions.
  1. +0 −19 config.py
  2. +0 −3 pyTivo.conf.dist
  3. +6 −34 pyTivoConfigurator.pyw
View
@@ -96,25 +96,6 @@ def getShares(tsn=''):
if tsnshares:
shares = tsnshares
- for name, data in shares:
- if not data.get('auto_subshares', 'False').lower() == 'true':
- continue
-
- base_path = data['path']
- try:
- for item in os.listdir(base_path):
- item_path = os.path.join(base_path, item)
- if not os.path.isdir(item_path) or item.startswith('.'):
- continue
-
- new_name = name + '/' + item
- new_data = dict(data)
- new_data['path'] = item_path
-
- shares.append((new_name, new_data))
- except:
- pass
-
return shares
def getDebug():
View
@@ -73,9 +73,6 @@ type=video
# For linux: path=/media
path=/home/armooo/Videos
-# Make all subfolders in to top level shares
-#auto_subshares=True
-
# You can have more than one share
#[MyTelevision]
#type=video
View
@@ -4,26 +4,17 @@ import os, sys, ConfigParser
class EditShare(tkSimpleDialog.Dialog):
- def __init__(self, parent, title=None, name='', path='', plugin='',
- subshares=0):
+ def __init__(self, parent, title=None, name='', path='', plugin=''):
self.name = name
self.path = path
self.plugin = StringVar()
self.plugin.set(plugin)
- self.subshares = IntVar()
- self.subshares.set(subshares)
tkSimpleDialog.Dialog.__init__(self, parent, title)
def get_dir(self):
self.e2.delete(0, END)
self.e2.insert(0, os.path.normpath(tkFileDialog.askdirectory()))
- def sub_show(self):
- if self.plugin.get() == 'video':
- self.subbutt.grid(row=2, column=1)
- else:
- self.subbutt.grid_forget()
-
def body(self, master):
Label(master, text="Name:").grid(row=0)
Label(master, text="Path:").grid(row=1)
@@ -42,24 +33,19 @@ class EditShare(tkSimpleDialog.Dialog):
self.e2.grid(row=1, column=1, sticky=W+E)
browse.grid(row=1, column=2)
- self.subbutt = Checkbutton(master, text='Auto subshares',
- variable=self.subshares)
-
if not self.plugin.get():
self.plugin.set('video')
- self.sub_show()
-
for i, name in zip(xrange(3), ('video', 'music', 'photo')):
b = Radiobutton(master, text=name, variable=self.plugin,
- value=name, command=self.sub_show).grid(row=i, column=3)
+ value=name).grid(row=i, column=3)
return self.e1 # initial focus
def apply(self):
name = self.e1.get()
path = self.e2.get()
- self.result = name, path, self.plugin.get(), self.subshares.get()
+ self.result = name, path, self.plugin.get()
class pyTivoConfigurator(Frame):
@@ -107,13 +93,10 @@ class pyTivoConfigurator(Frame):
def add(self):
share = EditShare(self, title='New Share')
if share.result:
- sharename, path, plugin, subshares = share.result
+ sharename, path, plugin = share.result
self.config.add_section(sharename)
self.config.set(sharename, 'type', plugin)
self.config.set(sharename, 'path', path)
- if subshares and plugin == 'video':
- self.config.set(name, 'auto_subshares', 'True')
-
self.updateContainerList()
def delete(self):
@@ -137,27 +120,16 @@ class pyTivoConfigurator(Frame):
path = self.config.get(name, 'path')
plugin = self.config.get(name, 'type')
- if self.config.has_option(name, 'auto_subshares') and \
- self.config.getboolean(name, 'auto_subshares'):
- subshares = 1
- else:
- subshares = 0
-
share = EditShare(self, title='Edit Share', name=name, path=path,
- plugin=plugin, subshares=subshares)
+ plugin=plugin)
if share.result:
- name, path, plugin, subshares = share.result
+ name, path, plugin = share.result
if name != self.section:
self.config.remove_section(self.section)
self.config.add_section(name)
self.section = name
self.config.set(name, 'type', plugin)
self.config.set(name, 'path', path)
- if subshares and plugin == 'video':
- self.config.set(name, 'auto_subshares', 'True')
- else:
- self.config.remove_option(name, 'auto_subshares')
-
self.updateContainerList()
def updateContainerList(self):

0 comments on commit cc83d9b

Please sign in to comment.