Browse Source

make it so that things don't go belly up when importing the optional

modules...

[git-p4: depot-paths = "//depot/": change = 842]
v0.3
John-Mark Gurney 18 years ago
parent
commit
e553e7808f
1 changed files with 15 additions and 6 deletions
  1. +15
    -6
      pymediaserv

+ 15
- 6
pymediaserv View File

@@ -9,15 +9,24 @@
#

# Modules to import, maybe config file or something?
import dvd
import shoutcast
import ZipStorage # w/ tarfile support, it will gobble up empty files!
def tryloadmodule(mod):
try:
return __import__(mod)
except ImportError:
import traceback
traceback.print_exc()
pass

# ZipStorage w/ tar support should be last as it will gobble up empty files.
modules = [ 'dvd', 'shoutcast', 'ZipStorage' ]
modmap = {}
for i in modules:
modmap[i] = tryloadmodule(i)

import debug # my debugging module
debug.doDebugging(True) # open up debugging port
debug.insertnamespace('dvd', dvd)
debug.insertnamespace('shoutcast', shoutcast)
debug.insertnamespace('ZipStorage', ZipStorage)
for i in modules:
debug.insertnamespace(i, modmap[i])

from DIDLLite import TextItem, AudioItem, VideoItem, ImageItem, Resource, StorageFolder
from FSStorage import FSDirectory


Loading…
Cancel
Save