[svn r830] fixed config file to expand dir trunk
authormelunko
Thu Aug 23 20:24:11 2007 +0100 (2007-08-23)
branchtrunk
changeset 824e711a64ba03d
parent 823 8b729aff6f81
child 825 32ec09590cf2
[svn r830] fixed config file to expand dir
gmyth-stream/server/0.3/lib/gmsconfig.py
gmyth-stream/server/0.3/lib/request_handler.py
gmyth-stream/server/0.3/server.conf
     1.1 --- a/gmyth-stream/server/0.3/lib/gmsconfig.py	Thu Aug 23 14:24:46 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/lib/gmsconfig.py	Thu Aug 23 20:24:11 2007 +0100
     1.3 @@ -16,12 +16,11 @@
     1.4      __CONFIG_FILE__ = "server.conf"
     1.5      __CONFIG_DIRS__ =  [os.path.join (os.path.expanduser("~"), ".gms"), \
     1.6                         os.path.join ("/", "etc", "gms"), \
     1.7 -                       "."]
     1.8 +		       "."]
     1.9  
    1.10      def __init__(self):
    1.11          for path in self.__CONFIG_DIRS__:
    1.12              file_name = os.path.join (path, self.__CONFIG_FILE__)
    1.13 -            print "test config file: %s" % file_name
    1.14              if os.path.exists (file_name):
    1.15                  fp = open (file_name, "r")
    1.16                  self.config.readfp (fp)
    1.17 @@ -30,7 +29,7 @@
    1.18  
    1.19      def get_transcoded_location (self):
    1.20          try:
    1.21 -            return self.config.get("PATHS", "transcoded")
    1.22 +            return os.path.realpath (self.config.get("PATHS", "transcoded"))
    1.23          except:
    1.24              return None
    1.25      # get_transcoded_location()
     2.1 --- a/gmyth-stream/server/0.3/lib/request_handler.py	Thu Aug 23 14:24:46 2007 +0100
     2.2 +++ b/gmyth-stream/server/0.3/lib/request_handler.py	Thu Aug 23 20:24:11 2007 +0100
     2.3 @@ -355,8 +355,12 @@
     2.4      # serve_file_info()
     2.5  
     2.6      def serve_stream(self, body):
     2.7 -        filename = self.query.get("file", None)[0]
     2.8 +	args = self.query.get("file", None)
     2.9 +	if not args:
    2.10 +	    self.send_error(404, "File not found")
    2.11 +	    return
    2.12  
    2.13 +        filename = args[0];	
    2.14          if not filename:
    2.15              self.send_error(404, "File not found")
    2.16              return
     3.1 --- a/gmyth-stream/server/0.3/server.conf	Thu Aug 23 14:24:46 2007 +0100
     3.2 +++ b/gmyth-stream/server/0.3/server.conf	Thu Aug 23 20:24:11 2007 +0100
     3.3 @@ -1,2 +1,2 @@
     3.4  [PATHS]
     3.5 -transcoded=.transcoded
     3.6 +transcoded=./.transcoded