Ivars 5 years ago
parent
commit
bfbebcabe2
2 changed files with 4 additions and 2 deletions
  1. 3
    1
      ContentSources.py
  2. 1
    1
      playstreamproxy.py

+ 3
- 1
ContentSources.py View File

21
     def __init__(self, plugin_path, cfg_file="streams.cfg", cfg_file2=None):
21
     def __init__(self, plugin_path, cfg_file="streams.cfg", cfg_file2=None):
22
         self.plugins = {}
22
         self.plugins = {}
23
         self.error_content = [("..atpakaļ", "back", "back.png", "Kļūda, atgriezties atpakaļ")]
23
         self.error_content = [("..atpakaļ", "back", "back.png", "Kļūda, atgriezties atpakaļ")]
24
+        if not plugin_path:
25
+            plugin_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sources")
24
         sys.path.insert(0, plugin_path)
26
         sys.path.insert(0, plugin_path)
25
         #for f in os.listdir(plugin_path):
27
         #for f in os.listdir(plugin_path):
26
         #for f in next(os.walk(plugin_path))[2]:
28
         #for f in next(os.walk(plugin_path))[2]:
31
             fname = os.path.split(fname)[1]
33
             fname = os.path.split(fname)[1]
32
             if fname == "__init__": continue
34
             if fname == "__init__": continue
33
             if ext == '.py':
35
             if ext == '.py':
34
-                print "Importing %s"%fname
36
+                #print "Importing %s"%fname
35
                 mod = __import__(fname)
37
                 mod = __import__(fname)
36
                 reload(mod)
38
                 reload(mod)
37
                 if "Source" in dir(mod):
39
                 if "Source" in dir(mod):

+ 1
- 1
playstreamproxy.py View File

57
 sessions = {}
57
 sessions = {}
58
 
58
 
59
 cfg_file = "streams.cfg"
59
 cfg_file = "streams.cfg"
60
-sources = ContentSources("sources", cfg_file)
60
+sources = ContentSources("", cfg_file)
61
 
61
 
62
 class StreamHandler(BaseHTTPRequestHandler):
62
 class StreamHandler(BaseHTTPRequestHandler):
63
 
63