Skip to content

Commit

Permalink
adding py 2.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tal committed Mar 8, 2014
1 parent 8c251d8 commit f93689d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Expand Up @@ -2,3 +2,11 @@
omit =
*/python?.?/*
*/site-packages/nose/*
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
[run]
source = ddate
2 changes: 2 additions & 0 deletions .travis.yml
@@ -1,13 +1,15 @@
language: python

python:
- '2.6'
- '2.7'
- '3.2'
- '3.3'

before_install:
- pip install --upgrade coveralls
- pip install --upgrade coverage
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install --upgrade unittest2; fi

script: "nosetests --with-coverage --cover-package=ddate"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2014,
Copyright (c) 2014, Adam Talsma <adam@talsma.ca>
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
6 changes: 3 additions & 3 deletions bin/ddate
Expand Up @@ -14,7 +14,7 @@ from __future__ import print_function
import sys
import datetime

import ddate
from ddate import DDate


def main():
Expand All @@ -38,12 +38,12 @@ def main():
day=int(sys.argv[3]),
)
except ValueError as error:
print("error: {}".format(error), file=sys.stderr)
print("error: {0}".format(error), file=sys.stderr)
elif len(sys.argv) == 1:
date = datetime.date.today()

if date:
print(ddate.DDate(date))
print(DDate(date))
else:
raise SystemExit("usage: ddate [year month day]")

Expand Down
1 change: 0 additions & 1 deletion src/__init__.py → ddate/__init__.py
@@ -1,2 +1 @@
from ddate import DDate
import ddate
2 changes: 1 addition & 1 deletion src/ddate.py → ddate/ddate.py
Expand Up @@ -139,7 +139,7 @@ def __str__(self):
self=self,
pfix=_day_postfix(self.day_of_season),
season=self.SEASONS[self.season],
holiday=". Celebrate {}!".format(
holiday=". Celebrate {0}!".format(
self.holiday) if self.holiday else "",
)

Expand Down
5 changes: 2 additions & 3 deletions setup.py
@@ -1,12 +1,11 @@
from distutils.core import setup
from setuptools import setup


setup(
name="ddate",
version="0.0.2",
version="0.0.3",
author="Adam Talsma",
author_email="adam@talsma.ca",
package_dir={"ddate": "src"},
packages=["ddate"],
scripts=["bin/ddate"],
url="https://github.com/a-tal/ddate",
Expand Down
11 changes: 8 additions & 3 deletions test/ddate_tests.py
@@ -1,10 +1,15 @@
"""Unit tests for ddate.py."""


import sys
import datetime
import unittest

import ddate
if sys.version_info < (2, 7):
import unittest2 as unittest

else:
import unittest

from ddate import ddate


class DDateTests(unittest.TestCase):
Expand Down

0 comments on commit f93689d

Please sign in to comment.