Skip to content

Commit

Permalink
Move functions before classes
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 8, 2011
1 parent 611f1fa commit d90133a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/DateTime/DateTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,21 @@ def _tzoffset2iso8601zone(seconds):
return "%+03d:%02d" % divmod((seconds / 60), 60)


class strftimeFormatter:

def __init__(self, dt, format):
self._dt=dt
self._f=format

def __call__(self):
return self._dt.strftime(self._f)


def Timezones():
"""Return the list of recognized timezone names"""
return sorted(list(PytzCache._zmap.values()))


class DateTime(object):
"""DateTime objects represent instants in time and provide
interfaces for controlling its representation without
Expand Down Expand Up @@ -1847,19 +1862,3 @@ def encode(self, out):
out.write('<value><dateTime.iso8601>')
out.write(self.ISO8601())
out.write('</dateTime.iso8601></value>\n')


class strftimeFormatter:

def __init__(self, dt, format):
self._dt=dt
self._f=format

def __call__(self):
return self._dt.strftime(self._f)


# Module methods
def Timezones():
"""Return the list of recognized timezone names"""
return sorted(list(PytzCache._zmap.values()))

0 comments on commit d90133a

Please sign in to comment.