Commit ffb41151 authored by scottywz's avatar scottywz

* Fixed to not try downloading any Dilbert strips before 1989-04-16 (when the...

* Fixed to not try downloading any Dilbert strips before 1989-04-16 (when the first one was published)
* Fixed fetch-dilbert giving exit code 0 if there was a problem downloading a strip or strips using the --date/--dates argument
* Both scripts now expand ~ (*nix home directory) and environment variables in argument values

git-svn-id: http://dilbert-tools.googlecode.com/svn/trunk@29 73f34498-e950-0410-84e0-e5c8a7cfc46c
parent 613b8b0b
Dilbert Tools by Scott Wallace
Version r25
Version r29
http://code.google.com/p/dilbert-tools
Changelog
* 2009-02-22 (r29)
o Fixed to not try downloading any Dilbert strips before 1989-04-16 (when
the first one was published)
o Fixed fetch-dilbert giving exit code 0 if there was a problem downloading
a strip or strips using the --date/--dates argument
o Both scripts now expand ~ (*nix home directory) and environment variables
in argument values
* 2008-07-15 (r25)
o Rewritten in Python
o Requires Python 2.5 and Python Imaging Library (PIL)
......
Dilbert Tools
Copyright (C) 2008 Scott Wallace
Copyright (C) 2008-2009 Scott Wallace
http://code.google.com/p/dilbert-tools/
This program is free software; you can redistribute it and/or modify
......
Dilbert Tools by Scott Wallace
Version r25
Version r29
http://code.google.com/p/dilbert-tools
Readme File
......@@ -41,7 +41,11 @@ where C:\Python25 is where you installed Python.
What else do I need?
If you're not using the Windows EXEs*, you need Python 2.5 and the Python
Imaging Module (PIL).
* If you want to MAKE the EXE files, you will need Python and PIL. (See below.)
NOTE: Python 3.x will probably NOT WORK! Use Python 2.5 or 2.6 (untested)
instead.
(* If you want to MAKE the EXE files, you will need Python and PIL. (See
below.))
If you're on Ubuntu, you can install them using:
$ sudo apt-get install python python-imaging
......
#!/usr/bin/env python
# Dilbert Tools (build script)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -27,7 +27,7 @@ import optparse, platform, os, shutil
def main():
p = optparse.OptionParser(
description='Builds the dilbert-tools suite.',
prog='build')
prog='build.py')
p.add_option("--output", "-o", default=None, help="directory to save the resulting files to. Defaults to unix for Unices and windows for Windows.")
p.add_option("--no-exes", "-n", default=False, action="store_true", help="do not make EXE files on Windows, but make regular Python files instead. Only applicable on Windows.")
options, args = p.parse_args()
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
from PIL import Image
import StringIO, os, time, urllib
import StringIO, os, time, urllib, sys
# Dilbert Tools (common functions)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -26,31 +26,39 @@ import StringIO, os, time, urllib
def fetch_strip(date, output):
'''Downloads a Dilbert strip, makes it a PNG, and puts it in output. Requires PIL module (python-imaging package in Ubuntu)'''
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
try:
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
else:
return False
else:
return False
else:
except KeyboardInterrupt:
print
sys.exit()
except:
return False
def generate_year_list(year, format, todate = False):
last_day = int(time.strftime("%j", time.strptime(year + "-12-31", "%Y-%m-%d")))
year = int(year)
last_day = int(time.strftime("%j", time.strptime(str(year) + "-12-31", "%Y-%m-%d")))
first_dilbert = time.strftime(format, time.strptime("1989-04-16", "%Y-%m-%d"))
if todate == True:
days = int(time.strftime("%j"))
elif last_day == 366:
......@@ -59,10 +67,12 @@ def generate_year_list(year, format, todate = False):
days = 365
array = []
while days > 0:
array.append(
time.strftime(format,
time.strptime(str(year) + "-" + str(days), "%Y-%j")))
days = days - 1
day_str = time.strftime(format, time.strptime(str(year) + "-" + str(days), "%Y-%j"))
array.append(day_str)
if year == 1989 and day_str == first_dilbert:
days = 0
else:
days = days - 1
array.sort()
return array
......
#!/usr/bin/env python
# Dilbert Tools (fetch-dilbert)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,11 +22,11 @@
# for convenience only. It is not covered under the above license statement.
# See its source files (e.g. pyinstaller/Build.py) for its license information.
import optparse, time
import optparse, time, os, sys
def main():
'''Handles options and does the magic'''
error_msg = "fetch-dilbert: error downloading the strip for "
error_msg = "fetch-dilbert: error downloading the strip for "
modes = ['date', 'dates', 'year']
p = optparse.OptionParser(
description='Downloads a given Dilbert strip or strips.',
......@@ -36,6 +36,7 @@ def main():
p.add_option("--year", "-y", help="download all strips from YEAR.")
p.add_option("--output", "-o", default='.', help="directory to save the strip(s) to. Defaults to the current directory.")
options, args = p.parse_args()
output = os.path.abspath(os.path.expanduser(os.path.expandvars(options.output)))
mode = None
for i in modes:
if hasattr(options, i) and getattr(options, i) != None:
......@@ -48,16 +49,22 @@ def main():
use_date = time.strftime("%Y-%m-%d")
else:
use_date = d
if fetch_strip(use_date, options.output) != True:
error(error_msg + use_date)
if fetch_strip(use_date, output) != True:
error(error_msg + use_date, code=1)
elif mode == 'year':
year = time.strftime("%Y")
if options.year == year:
array = generate_year_list(options.year, "%Y-%m-%d", True)
else:
array = generate_year_list(options.year, "%Y-%m-%d")
failed = 0
for d in array:
if fetch_strip(d, options.output) != True:
error(error_msg + d)
if fetch_strip(d, output) != True:
print error_msg + d
failed = failed + 1
if failed == 1:
print "fetch-dilbert: there was a problem while downloading one strip."
elif failed > 1:
print "fetch-dilbert: there were problems while downloading %s strips." % str(failed)
else:
p.print_help()
#!/usr/bin/env python
# Dilbert Tools (update-dilbert)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,7 +22,7 @@
# for convenience only. It is not covered under the above license statement.
# See its source files (e.g. pyinstaller/Build.py) for its license information.
import optparse, os, time
import optparse, os, time, sys
def main():
'''Handles options and does the magic'''
......@@ -36,12 +36,13 @@ def main():
help="give details about what the program is doing.")
p.add_option("--path", "-p", default='.', help="path to your Dilbert collection. Should have one subdirectory for each year of Dilberts you have (e.g. 1999, 2000, etc.), each with one strip for each day of the year, named YYYY-MM-DD.png.")
options, args = p.parse_args()
path = os.path.abspath(os.path.expanduser(os.path.expandvars(options.path)))
if options.verbose == None:
verbose = False
else:
verbose = True
if update_collection(options.path, verbose) != True:
exit(1)
if update_collection(path, verbose) != True:
sys.exit(1)
def update_collection(path, verbose):
......@@ -77,7 +78,7 @@ def update_collection(path, verbose):
if verbose == True:
print "failed!"
else:
print "update-dilbert: problem downloading strip for " + d
print "update-dilbert: problem downloading strip for " + d
failed = failed + 1
else:
if verbose == True:
......@@ -87,8 +88,8 @@ def update_collection(path, verbose):
if failed == 0:
return True
elif failed == 1:
print "There was a problem while downloading one strip."
print "update-dilbert: there was a problem while downloading one strip."
return False
elif failed > 1:
print "There was a problem while downloading %n strips." % failed
print "update-dilbert: there were problems while downloading %s strips." % str(failed)
return False
#!/usr/bin/env python
# Dilbert Tools (fetch-dilbert)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,11 +22,11 @@
# for convenience only. It is not covered under the above license statement.
# See its source files (e.g. pyinstaller/Build.py) for its license information.
import optparse, time
import optparse, time, os, sys
def main():
'''Handles options and does the magic'''
error_msg = "fetch-dilbert: error downloading the strip for "
error_msg = "fetch-dilbert: error downloading the strip for "
modes = ['date', 'dates', 'year']
p = optparse.OptionParser(
description='Downloads a given Dilbert strip or strips.',
......@@ -36,6 +36,7 @@ def main():
p.add_option("--year", "-y", help="download all strips from YEAR.")
p.add_option("--output", "-o", default='.', help="directory to save the strip(s) to. Defaults to the current directory.")
options, args = p.parse_args()
output = os.path.abspath(os.path.expanduser(os.path.expandvars(options.output)))
mode = None
for i in modes:
if hasattr(options, i) and getattr(options, i) != None:
......@@ -48,25 +49,31 @@ def main():
use_date = time.strftime("%Y-%m-%d")
else:
use_date = d
if fetch_strip(use_date, options.output) != True:
error(error_msg + use_date)
if fetch_strip(use_date, output) != True:
error(error_msg + use_date, code=1)
elif mode == 'year':
year = time.strftime("%Y")
if options.year == year:
array = generate_year_list(options.year, "%Y-%m-%d", True)
else:
array = generate_year_list(options.year, "%Y-%m-%d")
failed = 0
for d in array:
if fetch_strip(d, options.output) != True:
error(error_msg + d)
if fetch_strip(d, output) != True:
print error_msg + d
failed = failed + 1
if failed == 1:
print "fetch-dilbert: there was a problem while downloading one strip."
elif failed > 1:
print "fetch-dilbert: there were problems while downloading %s strips." % str(failed)
else:
p.print_help()
from PIL import Image
import StringIO, os, time, urllib
import StringIO, os, time, urllib, sys
# Dilbert Tools (common functions)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -90,31 +97,39 @@ import StringIO, os, time, urllib
def fetch_strip(date, output):
'''Downloads a Dilbert strip, makes it a PNG, and puts it in output. Requires PIL module (python-imaging package in Ubuntu)'''
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
try:
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
else:
return False
else:
return False
else:
except KeyboardInterrupt:
print
sys.exit()
except:
return False
def generate_year_list(year, format, todate = False):
last_day = int(time.strftime("%j", time.strptime(year + "-12-31", "%Y-%m-%d")))
year = int(year)
last_day = int(time.strftime("%j", time.strptime(str(year) + "-12-31", "%Y-%m-%d")))
first_dilbert = time.strftime(format, time.strptime("1989-04-16", "%Y-%m-%d"))
if todate == True:
days = int(time.strftime("%j"))
elif last_day == 366:
......@@ -123,10 +138,12 @@ def generate_year_list(year, format, todate = False):
days = 365
array = []
while days > 0:
array.append(
time.strftime(format,
time.strptime(str(year) + "-" + str(days), "%Y-%j")))
days = days - 1
day_str = time.strftime(format, time.strptime(str(year) + "-" + str(days), "%Y-%j"))
array.append(day_str)
if year == 1989 and day_str == first_dilbert:
days = 0
else:
days = days - 1
array.sort()
return array
......
#!/usr/bin/env python
# Dilbert Tools (update-dilbert)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,7 +22,7 @@
# for convenience only. It is not covered under the above license statement.
# See its source files (e.g. pyinstaller/Build.py) for its license information.
import optparse, os, time
import optparse, os, time, sys
def main():
'''Handles options and does the magic'''
......@@ -36,12 +36,13 @@ def main():
help="give details about what the program is doing.")
p.add_option("--path", "-p", default='.', help="path to your Dilbert collection. Should have one subdirectory for each year of Dilberts you have (e.g. 1999, 2000, etc.), each with one strip for each day of the year, named YYYY-MM-DD.png.")
options, args = p.parse_args()
path = os.path.abspath(os.path.expanduser(os.path.expandvars(options.path)))
if options.verbose == None:
verbose = False
else:
verbose = True
if update_collection(options.path, verbose) != True:
exit(1)
if update_collection(path, verbose) != True:
sys.exit(1)
def update_collection(path, verbose):
......@@ -77,7 +78,7 @@ def update_collection(path, verbose):
if verbose == True:
print "failed!"
else:
print "update-dilbert: problem downloading strip for " + d
print "update-dilbert: problem downloading strip for " + d
failed = failed + 1
else:
if verbose == True:
......@@ -87,17 +88,17 @@ def update_collection(path, verbose):
if failed == 0:
return True
elif failed == 1:
print "There was a problem while downloading one strip."
print "update-dilbert: there was a problem while downloading one strip."
return False
elif failed > 1:
print "There was a problem while downloading %n strips." % failed
print "update-dilbert: there were problems while downloading %s strips." % str(failed)
return False
from PIL import Image
import StringIO, os, time, urllib
import StringIO, os, time, urllib, sys
# Dilbert Tools (common functions)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -121,31 +122,39 @@ import StringIO, os, time, urllib
def fetch_strip(date, output):
'''Downloads a Dilbert strip, makes it a PNG, and puts it in output. Requires PIL module (python-imaging package in Ubuntu)'''
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
try:
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
else:
return False
else:
return False
else:
except KeyboardInterrupt:
print
sys.exit()
except:
return False
def generate_year_list(year, format, todate = False):
last_day = int(time.strftime("%j", time.strptime(year + "-12-31", "%Y-%m-%d")))
year = int(year)
last_day = int(time.strftime("%j", time.strptime(str(year) + "-12-31", "%Y-%m-%d")))
first_dilbert = time.strftime(format, time.strptime("1989-04-16", "%Y-%m-%d"))
if todate == True:
days = int(time.strftime("%j"))
elif last_day == 366:
......@@ -154,10 +163,12 @@ def generate_year_list(year, format, todate = False):
days = 365
array = []
while days > 0:
array.append(
time.strftime(format,
time.strptime(str(year) + "-" + str(days), "%Y-%j")))
days = days - 1
day_str = time.strftime(format, time.strptime(str(year) + "-" + str(days), "%Y-%j"))
array.append(day_str)
if year == 1989 and day_str == first_dilbert:
days = 0
else:
days = days - 1
array.sort()
return array
......
#!/usr/bin/env python
# Dilbert Tools (fetch-dilbert)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,11 +22,11 @@
# for convenience only. It is not covered under the above license statement.
# See its source files (e.g. pyinstaller/Build.py) for its license information.
import optparse, time
import optparse, time, os, sys
def main():
'''Handles options and does the magic'''
error_msg = "fetch-dilbert: error downloading the strip for "
error_msg = "fetch-dilbert: error downloading the strip for "
modes = ['date', 'dates', 'year']
p = optparse.OptionParser(
description='Downloads a given Dilbert strip or strips.',
......@@ -36,6 +36,7 @@ def main():
p.add_option("--year", "-y", help="download all strips from YEAR.")
p.add_option("--output", "-o", default='.', help="directory to save the strip(s) to. Defaults to the current directory.")
options, args = p.parse_args()
output = os.path.abspath(os.path.expanduser(os.path.expandvars(options.output)))
mode = None
for i in modes:
if hasattr(options, i) and getattr(options, i) != None:
......@@ -48,25 +49,31 @@ def main():
use_date = time.strftime("%Y-%m-%d")
else:
use_date = d
if fetch_strip(use_date, options.output) != True:
error(error_msg + use_date)
if fetch_strip(use_date, output) != True:
error(error_msg + use_date, code=1)
elif mode == 'year':
year = time.strftime("%Y")
if options.year == year:
array = generate_year_list(options.year, "%Y-%m-%d", True)
else:
array = generate_year_list(options.year, "%Y-%m-%d")
failed = 0
for d in array:
if fetch_strip(d, options.output) != True:
error(error_msg + d)
if fetch_strip(d, output) != True:
print error_msg + d
failed = failed + 1
if failed == 1:
print "fetch-dilbert: there was a problem while downloading one strip."
elif failed > 1:
print "fetch-dilbert: there were problems while downloading %s strips." % str(failed)
else:
p.print_help()
from PIL import Image
import StringIO, os, time, urllib
import StringIO, os, time, urllib, sys
# Dilbert Tools (common functions)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -90,31 +97,39 @@ import StringIO, os, time, urllib
def fetch_strip(date, output):
'''Downloads a Dilbert strip, makes it a PNG, and puts it in output. Requires PIL module (python-imaging package in Ubuntu)'''
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
try:
url = urllib.urlopen("http://www.dilbert.com/fast/%s/" % date)
html = url.read()
url.close()
if html != '':
pieces = html.split('<img src="/dyn/str_strip/0', 1)
pieces2 = pieces[1].split(".strip.print.gif", 1)
output_file = output + "/" + date + ".png"
image = urllib.urlopen("http://www.dilbert.com/dyn/str_strip/0" + pieces2[0] + ".strip.gif")
strip = image.read()
image.close()
if strip != '':
imagestring = StringIO.StringIO(strip)
imagedata = Image.open(imagestring)
imagedata.save(output_file)
imagestring.close()
thetime = time.mktime(time.strptime(date, "%Y-%m-%d"))
os.utime(output_file, (thetime, thetime))
return True
else:
return False
else:
return False
else:
except KeyboardInterrupt:
print
sys.exit()
except:
return False
def generate_year_list(year, format, todate = False):
last_day = int(time.strftime("%j", time.strptime(year + "-12-31", "%Y-%m-%d")))
year = int(year)
last_day = int(time.strftime("%j", time.strptime(str(year) + "-12-31", "%Y-%m-%d")))
first_dilbert = time.strftime(format, time.strptime("1989-04-16", "%Y-%m-%d"))
if todate == True:
days = int(time.strftime("%j"))
elif last_day == 366:
......@@ -123,10 +138,12 @@ def generate_year_list(year, format, todate = False):
days = 365
array = []
while days > 0:
array.append(
time.strftime(format,
time.strptime(str(year) + "-" + str(days), "%Y-%j")))
days = days - 1
day_str = time.strftime(format, time.strptime(str(year) + "-" + str(days), "%Y-%j"))
array.append(day_str)
if year == 1989 and day_str == first_dilbert:
days = 0
else:
days = days - 1
array.sort()
return array
......
#!/usr/bin/env python
# Dilbert Tools (update-dilbert)
# Copyright (C) 2008 Scott Wallace
# Copyright (C) 2008-2009 Scott Wallace
# http://code.google.com/p/dilbert-tools/
#
# This program is free software; you can redistribute it and/or modify
......@@ -22,7 +22,7 @@
# for convenience only. It is not covered under the above license statement.