[Python-modules-commits] [python-isoweek] 02/03: New upstream version 1.3.1
Hugo Lefeuvre
hle at moszumanska.debian.org
Sun Dec 18 12:17:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
hle pushed a commit to branch master
in repository python-isoweek.
commit 489acd87de2f64f91ee828d289f0cce5d88df47a
Author: Hugo Lefeuvre <hle at debian.org>
Date: Sun Dec 18 13:17:14 2016 +0100
New upstream version 1.3.1
---
.gitignore | 4 ++
.travis.yml | 12 ++++++
CHANGES.txt | 5 +++
MANIFEST.in | 3 ++
PKG-INFO | 130 ------------------------------------------------------------
README.rst | 10 ++---
isoweek.py | 12 +++---
setup.py | 2 +-
8 files changed, 36 insertions(+), 142 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cc50336
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/dist/
+/build/
+/MANIFEST
+*.pyc
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..07a1695
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,12 @@
+language: python
+
+python:
+ - "2.6"
+ - "2.7"
+ - "3.2"
+ - "3.3"
+ - 'pypy'
+
+install: python setup.py install
+
+script: python test_isoweek.py
diff --git a/CHANGES.txt b/CHANGES.txt
index 6adf914..744bb6b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,8 @@
+v1.3.1, 2016-10-10
+
+ Documentation fixes
+
+
v1.3.0, 2014-01-28
Fix: make sure week arithmetics preserve the Week class
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..96ab04a
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,3 @@
+include *.rst
+include *.txt
+include test_isoweek.py
diff --git a/PKG-INFO b/PKG-INFO
deleted file mode 100644
index ad7e781..0000000
--- a/PKG-INFO
+++ /dev/null
@@ -1,130 +0,0 @@
-Metadata-Version: 1.1
-Name: isoweek
-Version: 1.3.0
-Summary: Objects representing a week
-Home-page: http://github.com/gisle/isoweek
-Author: Gisle Aas
-Author-email: gisle at aas.no
-License: BSD
-Description: ISO Week
- ========
-
- The isoweek module provide the class *Week*. Instances represent specific weeks
- spanning Monday to Sunday. There are 52 or 53 numbered weeks in a year. Week
- 1 is defined to be the first week with 4 or more days in January.
-
- It's called isoweek because this is the week definition of ISO 8601. This
- standard also define a notation for identifying weeks; YYYYWww (where the "W"
- is a literal). An example is "2011W08" which denotes the 8th week of year
- 2011. *Week* instances stringify to this form.
-
- See also http://en.wikipedia.org/wiki/ISO_week_date
-
- The *Week* instances are light weight and immutable with an interface similar
- to the datetime.date objects. Example code::
-
- from isoweek import Week
- w = Week(2011, 20)
- print "Week %s starts on %s" % (w, w.monday())
-
- print "Current week number is", Week.thisweek().week
- print "Next week is", Week.thisweek() + 1
-
- Reference
- ----------
-
- Constructor:
-
- *class* isoweek.Week(*year*, *week*)
- All arguments are required. Arguments should be ints.
-
- If the week number isn't within the range of the given year,
- the year is adjusted to make week number within range. The
- final year must be within range 1 to 9999. If not ValueError
- is raised.
-
- Other constructors, all class methods:
-
- *classmethod* Week.thisweek()
- Return the current week (local time).
-
- *classmethod* Week.fromordinal(*ordinal*)
- Return the week corresponding to the proleptic Gregorian ordinal,
- where January 1 of year 1 starts the week with ordinal 1.
-
- *classmethod* Week.fromstring(*isostring*)
- Return a week initialized from an ISO formatted string like "2011W08"
- or "2011-W08". Note that weeks always stringify back in the former
- and more compact format.
-
- *classmethod* Week.withdate(*date*)
- Return the week that contains the given datetime.date.
-
- *classmethod* Week.weeks_of_year(*year*)
- Returns an iterator over the weeks of the given year.
-
- *classmethod* Week.last_week_of_year(*year*)
- Returns the last week of the given year.
-
- Instance attributes (read-only):
-
- Week.year
- Between 1 and 9999 inclusive.
-
- Week.week
- Between 1 and 53 inclusive (52 for most years).
-
- Supported operations:
-
- ==================== ==========================================================
- Operation Result
- ==================== ==========================================================
- week1 = week2 + int week2 is int weeks removed from week1.
- week1 = week2 - int Computes week2 such that week2 + int == week1
- int = week1 - week2 Computes int such that week2 + int == week1
- week1 < week2 week1 is considered less than week2 when week1 precedes week2 in time.
- ==================== ==========================================================
-
- Instance methods:
-
- Week.replace(*year*, *week*)
- Return a Week with the same value, except for those parameters
- given new values by whichever keyword arguments are specified.
-
- Week.toordinal()
- Return the proleptic Gregorian ordinal the week, where January 1 of year 1
- starts the first week.
-
- Week.day(*num*)
- Return the given day of week as a datetime.date object.
- Day 0 is Monday.
-
- Week.monday(), Week.tuesday(),.. Week.sunday()
- Return the given day of week as a datetime.date object.
-
- Week.days()
- Returns the 7 days of the week as a list.
-
- Week.contains(day)
- Check if the given datetime.date falls within the week.
-
- Week.isoformat()
- Return a string representing the week in ISO 8610 format, "YYYYWww".
- For example Week(2011, 8).isoformat() == '2011W08'.
-
- Week.__str__()
- For a Week w, str(w) is equivalent to w.isoformat()
-
- Week.__repr__()
- Return a string like "isoweek.Week(2011, 2)".
-
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff --git a/README.rst b/README.rst
index 7201ab3..041ba0f 100644
--- a/README.rst
+++ b/README.rst
@@ -6,7 +6,7 @@ spanning Monday to Sunday. There are 52 or 53 numbered weeks in a year. Week
1 is defined to be the first week with 4 or more days in January.
It's called isoweek because this is the week definition of ISO 8601. This
-standard also define a notation for identifying weeks; YYYYWww (where the "W"
+standard also define a notation for identifying weeks; yyyyWww (where the "W"
is a literal). An example is "2011W08" which denotes the 8th week of year
2011. *Week* instances stringify to this form.
@@ -53,10 +53,10 @@ Other constructors, all class methods:
Return the week that contains the given datetime.date.
*classmethod* Week.weeks_of_year(*year*)
- Returns an iterator over the weeks of the given year.
+ Return an iterator over the weeks of the given year.
*classmethod* Week.last_week_of_year(*year*)
- Returns the last week of the given year.
+ Return the last week of the given year.
Instance attributes (read-only):
@@ -95,13 +95,13 @@ Week.monday(), Week.tuesday(),.. Week.sunday()
Return the given day of week as a datetime.date object.
Week.days()
- Returns the 7 days of the week as a list.
+ Return the 7 days of the week as a list.
Week.contains(day)
Check if the given datetime.date falls within the week.
Week.isoformat()
- Return a string representing the week in ISO 8610 format, "YYYYWww".
+ Return a string representing the week in ISO 8601 format; "yyyyWww".
For example Week(2011, 8).isoformat() == '2011W08'.
Week.__str__()
diff --git a/isoweek.py b/isoweek.py
index 5926c07..29b0ee0 100644
--- a/isoweek.py
+++ b/isoweek.py
@@ -1,7 +1,7 @@
from datetime import date, datetime, timedelta
from collections import namedtuple
-__version__ = (1, 3, 0)
+__version__ = (1, 3, 1)
import sys
@@ -68,7 +68,7 @@ class Week(namedtuple('Week', ('year', 'week'))):
@classmethod
def weeks_of_year(cls, year):
- """Returns an iterator over the weeks of the given year.
+ """Return an iterator over the weeks of the given year.
Years have either 52 or 53 weeks."""
w = cls(year, 1)
while w.year == year:
@@ -77,7 +77,7 @@ class Week(namedtuple('Week', ('year', 'week'))):
@classmethod
def last_week_of_year(cls, year):
- """Returns the last week of the given year.
+ """Return the last week of the given year.
This week with either have week-number 52 or 53.
This will be the same as Week(year+1, 0), but will even work for
@@ -124,7 +124,7 @@ class Week(namedtuple('Week', ('year', 'week'))):
return self.day(6)
def days(self):
- """Returns the 7 days of the week as a list (of datetime.date objects)"""
+ """Return the 7 days of the week as a list (of datetime.date objects)"""
monday = self.day(0)
return [monday + timedelta(days=i) for i in range(7)]
@@ -133,11 +133,11 @@ class Week(namedtuple('Week', ('year', 'week'))):
return self.day(0) <= day < self.day(7)
def toordinal(self):
- """Returns the proleptic Gregorian ordinal the week, where January 1 of year 1 starts the first week."""
+ """Return the proleptic Gregorian ordinal the week, where January 1 of year 1 starts the first week."""
return self.monday().toordinal() // 7 + 1
def replace(self, year=None, week=None):
- """Returns a Week with either the year or week attribute value replaced"""
+ """Return a Week with either the year or week attribute value replaced"""
return self.__class__(self.year if year is None else year,
self.week if week is None else week)
diff --git a/setup.py b/setup.py
index 99b1279..e54bb48 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ if sys.version_info < (2, 6, 0):
from distutils.core import setup
setup(
name = 'isoweek',
- version = '1.3.0',
+ version = '1.3.1',
description = 'Objects representing a week',
author='Gisle Aas',
author_email='gisle at aas.no',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-isoweek.git
More information about the Python-modules-commits
mailing list