Skip to content

Commit

Permalink
Moved from "utilities" to "utils" for ease of use.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarusso committed Mar 14, 2024
1 parent f8fdd1b commit 0b7b616
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Modules
:toctree:

time
utilities
utils
logger
exceptions

Expand Down
43 changes: 0 additions & 43 deletions docs/propertime.utilities.rst

This file was deleted.

7 changes: 4 additions & 3 deletions docs/propertime.utils.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
propertimeutilitiess
================
propertime.utilities
====================

.. automodule:: propertimeutilitiess
.. automodule:: propertime.utilities



Expand All @@ -18,6 +18,7 @@
dt
dt_from_s
dt_from_str
get_offset_from_dt
get_tz_offset
is_dt_ambiguous_without_offset
is_dt_inconsistent
Expand Down
2 changes: 1 addition & 1 deletion docs/source/propertime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ propertime.time module
:undoc-members:
:show-inheritance:

.. automodule:: propertime.utilities
.. automodule:: propertime.utils
:members:
:inherited-members:
:undoc-members:
Expand Down
2 changes: 1 addition & 1 deletion propertime/tests/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
import pytz
from datetime import datetime
from ..utilities import dt, correct_dt_dst, str_from_dt, dt_from_str, s_from_dt, dt_from_s, as_tz, timezonize, now_s
from ..utils import dt, correct_dt_dst, str_from_dt, dt_from_str, s_from_dt, dt_from_s, as_tz, timezonize, now_s
from ..time import Time, TimeSpan
from dateutil.tz.tz import tzoffset
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest
import datetime
import pytz
from ..utilities import dt, correct_dt_dst, str_from_dt, dt_from_str, s_from_dt, dt_from_s, as_tz, timezonize, is_dt_ambiguous_without_offset
from ..utils import dt, correct_dt_dst, str_from_dt, dt_from_str, s_from_dt, dt_from_s, as_tz, timezonize, is_dt_ambiguous_without_offset
from ..time import Time
from dateutil.tz.tz import tzoffset
try:
Expand Down
4 changes: 2 additions & 2 deletions propertime/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import copy
from datetime import datetime, timedelta
from dateutil.tz.tz import tzoffset
from .utilities import dt, timezonize, dt_from_s, s_from_dt, dt_from_str, now_s, str_from_dt, \
from .utils import dt, timezonize, dt_from_s, s_from_dt, dt_from_str, now_s, str_from_dt, \
get_tz_offset, is_numerical, is_dt_inconsistent, is_dt_ambiguous_without_offset, \
correct_dt_dst, get_offset_from_dt
from .exceptions import ConsistencyError
Expand Down Expand Up @@ -413,7 +413,7 @@ def from_dt(cls, dt, tz='auto', offset='auto', guessing=False):
if not guessing:
raise ValueError('Sorry, datetime {} is ambiguous on time zone {} without an offset'.format(dt_naive, dt.tzinfo))
else:
# TODO: move to a _get_utc_offset() support function. Used also in Time __str__ and dt() in utilities
# TODO: move to a _get_utc_offset() support function. Used also in Time __str__ and dt() in utils
iso_time_part = str_from_dt(dt).split('T')[1]
if '+' in iso_time_part:
offset_assumed = '+'+iso_time_part.split('+')[1]
Expand Down
File renamed without changes.

0 comments on commit 0b7b616

Please sign in to comment.