Skip to content

Commit

Permalink
Added docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtumnus authored Mar 28, 2017
1 parent 0e79d04 commit 24dbb01
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MirageLauncher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/python
# Author: Elliott Partridge
# Date: 2017-03-28
"""Python launcher script for Mirage Realms MMORPG"""

import os
from urllib2 import urlopen, URLError, HTTPError, Request
Expand All @@ -11,6 +12,7 @@

# From http://stackoverflow.com/a/4028894/973624
def get_url(url):
"""Download a URL resource"""
# Open the url
try:
f = urlopen(url)
Expand All @@ -27,6 +29,7 @@ def get_url(url):
print "URL Error:", e.reason, url

def get_url_info(url):
"""Retrieve headers for a URL"""
# Get URL headers only
# derived from http://stackoverflow.com/a/4421485/973624
request = Request(url)
Expand All @@ -36,6 +39,7 @@ def get_url_info(url):
return response.info()

def get_url_mtime(url):
"""Get the Last-Modified header for a URL as a datetime"""
url_info = get_url_info(url)

# Parse Last-Modified time
Expand Down

0 comments on commit 24dbb01

Please sign in to comment.