HMS

Home Media Server for Roku Players
git clone https://www.brianlane.com/git/HMS
Log | Files | Refs | README | LICENSE

commit 531d3eb73f627a86b4fcb6471c746d6899e37307
parent 290aa9b6ddec5e7202a629d0dde4d42556d7248c
Author: Brian C. Lane <bcl@brianlane.com>
Date:   Tue, 13 Apr 2010 22:12:48 -0700

Add display of local system's external IP address

Diffstat:
MREADME | 5++---
Mserver/hms/hms.py | 11++++++++++-
2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/README b/README @@ -16,13 +16,12 @@ by Brian C. Lane <bcl@brianlane.com> On a rpm based system this should work to install all the requirements: yum groupinstall "development tools" - yum install libcurl-devel libjpeg-devel zlib-devel libmp4v2 python-setuptools - easy_install virtualenv pip + yum install libcurl-devel libjpeg-devel zlib-devel libmp4v2 python-setuptools \ + python-virtualenv python-pip python-imaging == virtualenv setup == Setup the virtual python environment: pip -E pyvirt install -r hms/tornado.pip - pip -E pyvirt install pil . ./pyvirt/bin/activate cd hms ./hms.py diff --git a/server/hms/hms.py b/server/hms/hms.py @@ -52,6 +52,7 @@ import traceback from subprocess import Popen, PIPE import operator import cPickle +import socket # Tornado modules import tornado.httpserver @@ -1563,8 +1564,16 @@ class MainHandler(BaseHandler): def main(): tornado.options.parse_command_line() + # Get the local IP + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + s.connect(("brianlane.com",80)) + local_ip = s.getsockname()[0] + except: + local_ip = "0.0.0.0" + print "Starting Home Media Server" - print "Listening on port %s" % (options.port) + print "Listening on %s:%s" % (local_ip, options.port) # Setup the database if not os.path.exists(options.database):