diff -urN moss-0.1rc1.orig/AUTHORS moss-0.1rc1/AUTHORS --- moss-0.1rc1.orig/AUTHORS Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/AUTHORS Sat Jul 24 12:34:55 2004 @@ -2,7 +2,8 @@ ============ Developers - * ¹Ú¸í°ï(Myung-gon, Park) + * ¹Ú¸í°ï(Myung-Gon, Park) Thanks * liongo + * supermania diff -urN moss-0.1rc1.orig/ChangeLog moss-0.1rc1/ChangeLog --- moss-0.1rc1.orig/ChangeLog Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/ChangeLog Sat Jul 24 12:34:59 2004 @@ -1,5 +1,11 @@ MOSS ChangeLog ============== +2004-07-24 Myung-Gon, Park + * moss.py, web.py: ÅÛÇø´ Àû¿ë À§Ä¡ º¯°æ + +2004-07-23 Myung-Gon, Park + * moss.py: ¼³Á¤ÆÄÀÏ Ã¼Å© ºÎºÐ ¹ö±× ¼öÁ¤ + 2004-07-11 Myung-Gon, Park * Release 0.1 RC1 diff -urN moss-0.1rc1.orig/NEWS moss-0.1rc1/NEWS --- moss-0.1rc1.orig/NEWS Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/NEWS Sat Jul 24 12:35:13 2004 @@ -1,6 +1,6 @@ MOSS NEWS ========= -Version 0.1 +Version 0.1 RC1 * Initial release. diff -urN moss-0.1rc1.orig/fileinfo.py moss-0.1rc1/fileinfo.py --- moss-0.1rc1.orig/fileinfo.py Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/fileinfo.py Sat Jul 24 12:34:44 2004 @@ -5,9 +5,9 @@ # Description: Get file information. # # Created: 2004. 06. 24 -# RCS-ID: $Id: fileinfo.py,v 1.11 2004/07/01 13:00:49 myunggoni Exp $ +# RCS-ID: $Id: fileinfo.py,v 1.12 2004/07/23 07:10:51 myunggoni Exp $ # Copyright: (c) 2004 by myunggoni -# Licence: GNU General Public License +# License: GNU General Public License # Author: Myung-Gon, Park #---------------------------------------------------------------------------- diff -urN moss-0.1rc1.orig/live.py moss-0.1rc1/live.py --- moss-0.1rc1.orig/live.py Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/live.py Sat Jul 24 12:34:44 2004 @@ -5,9 +5,9 @@ # Description: Live streaming routine. # # Created: 2004. 06. 26 -# RCS-ID: $Id: live.py,v 1.30 2004/07/02 02:27:59 myunggoni Exp $ +# RCS-ID: $Id: live.py,v 1.32 2004/07/24 01:55:05 myunggoni Exp $ # Copyright: (c) 2004 by myunggoni -# Licence: GNU General Public License +# License: GNU General Public License # Author: Myung-Gon, Park #---------------------------------------------------------------------------- @@ -467,8 +467,6 @@ client.socket.close() self.source.clients.remove(client) - sys.exit(0) - def accept(self): try: self.client_socket, self.client_address = self.socket.accept() diff -urN moss-0.1rc1.orig/moss.conf moss-0.1rc1/moss.conf --- moss-0.1rc1.orig/moss.conf Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/moss.conf Sat Jul 24 12:36:09 2004 @@ -32,5 +32,5 @@ [extra] -template-dir = templates +template-dir = /home/moss/templates template = default.tmpl diff -urN moss-0.1rc1.orig/moss.py moss-0.1rc1/moss.py --- moss-0.1rc1.orig/moss.py Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/moss.py Sat Jul 24 12:34:44 2004 @@ -2,12 +2,12 @@ #---------------------------------------------------------------------------- # Project Name: MOSS # File Name: moss.py -# Description: run server. +# Description: Run server. # # Created: 2004. 06. 20 -# RCS-ID: $Id: moss.py,v 1.47 2004/07/01 00:41:44 myunggoni Exp $ +# RCS-ID: $Id: moss.py,v 1.50 2004/07/24 01:55:06 myunggoni Exp $ # Copyright: (c) 2004 by myunggoni -# Licence: GNU General Public License +# License: GNU General Public License # Author: Myung-Gon, Park #---------------------------------------------------------------------------- @@ -18,9 +18,9 @@ import sys import getopt import template +import os import web import live -import os try: import ogg.vorbis @@ -151,7 +151,7 @@ if opt in ("-c", "--config"): config_file = arg - if os.path.isfile(config_file): + if not os.path.isfile(config_file): print "MOSS: No such configuration file" print_usage() sys.exit(1) @@ -165,23 +165,6 @@ server_mode = config.get("server", "server-mode") if server_mode == "web": - config = ConfigParser.ConfigParser() - config.add_section("extra") - config_defaults = config.defaults() - config_defaults["template-dir"] = "templates" - config_defaults["template"] = "default.tmpl" - config.read(config_file) - template_path = config.get("extra", "template-dir") - template_file = config.get("extra", "template") - template_file = os.path.join(template_path, template_file) - - if os.path.isfile(template_file): - template_file = os.path.realpath(template_file) - web.template = template.Template(template_file) - else: - print "MOSS: No such template file" - sys.exit(1) - web.debug_mode = debug_mode elif server_mode == "live": live.debug_mode = debug_mode diff -urN moss-0.1rc1.orig/template.py moss-0.1rc1/template.py --- moss-0.1rc1.orig/template.py Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/template.py Sat Jul 24 12:34:44 2004 @@ -5,9 +5,9 @@ # Description: Processing template routine. # # Created: 2004. 06. 20 -# RCS-ID: $Id: template.py,v 1.15 2004/07/01 00:24:12 myunggoni Exp $ +# RCS-ID: $Id: template.py,v 1.16 2004/07/23 07:10:51 myunggoni Exp $ # Copyright: (c) 2004 by myunggoni -# Licence: GNU General Public License +# License: GNU General Public License # Author: Myung-Gon, Park #---------------------------------------------------------------------------- from htmltmpl import TemplateManager, TemplateProcessor diff -urN moss-0.1rc1.orig/web.py moss-0.1rc1/web.py --- moss-0.1rc1.orig/web.py Sat Jul 24 12:34:08 2004 +++ moss-0.1rc1/web.py Sat Jul 24 12:34:44 2004 @@ -2,12 +2,12 @@ #---------------------------------------------------------------------------- # Project Name: MOSS # File Name: web.py -# Description: web-based streaming server routine. +# Description: Web-based streaming server routine. # # Created: 2004. 06. 20 -# RCS-ID: $Id: web.py,v 1.12 2004/07/02 01:56:54 myunggoni Exp $ +# RCS-ID: $Id: web.py,v 1.15 2004/07/24 01:11:39 myunggoni Exp $ # Copyright: (c) 2004 by myunggoni -# Licence: GNU General Public License +# License: GNU General Public License # Author: Myung-Gon, Park #---------------------------------------------------------------------------- @@ -44,6 +44,7 @@ self.config.add_section("server") self.config.add_section("sources") self.config.add_section("acl") + self.config.add_section("extra") config_defaults = self.config.defaults() @@ -52,6 +53,7 @@ config_defaults["log"] = "stdout" config_defaults["max-connection"] = 10 config_defaults["read-size"] = 8192 + config_defaults["template"] = "default.tmpl" self.config.read(config_file) self.log = self.config.get("server", "log") @@ -72,6 +74,21 @@ else: self.log = sys.stdout + try: + template_path = self.config.get("extra", "template-dir") + except ConfigParser.NoOptionError: + self.log_message("ERROR: Template directory was not specified") + sys.exit(1) + + template_file = self.config.get("extra", "template") + template_file = os.path.join(template_path, template_file) + + if os.path.isfile(template_file): + self.template = template.Template(template_file) + else: + self.log_message("ERROR: No such template file") + sys.exit(1) + self.acls = [] try: @@ -360,13 +377,11 @@ return 0 def display_page(self, url, subdirs, songs = []): - global template - self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() - template.generate(self.wfile, url, subdirs, songs) + self.server.template.generate(self.wfile, url, subdirs, songs) def translate_path(self): parts = string.split(urllib.unquote(self.path), '/')