Mercurial > hg > config
comparison python/dlna.py @ 655:cd73d951ae5b
remove ephemeral directory
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Fri, 28 Mar 2014 23:23:34 -0700 |
| parents | d325f380e2fb |
| children | 4d9df2370659 |
comparison
equal
deleted
inserted
replaced
| 654:d325f380e2fb | 655:cd73d951ae5b |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
| 3 | 3 |
| 4 import argparse | 4 import argparse |
| 5 import os | 5 import os |
| 6 import shutil | |
| 6 import subprocess | 7 import subprocess |
| 7 import sys | 8 import sys |
| 8 import tempfile | 9 import tempfile |
| 9 from which import which | 10 from which import which |
| 10 | 11 |
| 44 command = [dlna, '-f', name, '-d', '-p', str(options.port)] | 45 command = [dlna, '-f', name, '-d', '-p', str(options.port)] |
| 45 print (subprocess.list2cmdline(command)) | 46 print (subprocess.list2cmdline(command)) |
| 46 subprocess.check_call(command) | 47 subprocess.check_call(command) |
| 47 | 48 |
| 48 os.remove(name) | 49 os.remove(name) |
| 50 shutil.rmtree(options.db_dir) | |
| 49 | 51 |
| 50 if __name__ == '__main__': | 52 if __name__ == '__main__': |
| 51 main() | 53 main() |
