changeset 710:7f910ce4da04

STUB: python/dlna.py
author Jeff Hammel <k0scist@gmail.com>
date Sat, 06 Sep 2014 07:59:16 -0700
parents c24a1b531b7e
children ab831c7621e9 02aec49585ab
files python/dlna.py
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/python/dlna.py	Fri Sep 05 14:55:11 2014 -0700
+++ b/python/dlna.py	Sat Sep 06 07:59:16 2014 -0700
@@ -1,6 +1,10 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+"""
+serve DLNA
+"""
+
 import argparse
 import os
 import shutil
@@ -13,10 +17,9 @@
 string = (str, unicode)
 
 def main(args=sys.argv[1:]):
+    """CLI"""
 
-    dlna = which('minidlna')
-    assert dlna
-
+    # parse command line
     parser = argparse.ArgumentParser(description=__doc__)
     parser.add_argument('--name', dest='name', default='protest servant',
                         help="friendly name")
@@ -30,6 +33,11 @@
     parser.add_argument('audio', nargs='+')
     options = parser.parse_args(args)
 
+    # dlna location
+    dlna = which('minidlnad')
+    if not dlna:
+        parser.error("minidlna command not found")
+
     lines = [('friendly_name', options.name),
              ('db_dir', options.db_dir),
              ('log_dir', options.db_dir),