books: Remove unused workdir() function.
This commit is contained in:
parent
0581525c98
commit
04c804a506
1 changed files with 0 additions and 11 deletions
|
@ -14,9 +14,7 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import contextlib
|
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -38,15 +36,6 @@ from .beancount_types import (
|
||||||
PathLike = Union[str, Path]
|
PathLike = Union[str, Path]
|
||||||
Year = Union[int, datetime.date]
|
Year = Union[int, datetime.date]
|
||||||
|
|
||||||
@contextlib.contextmanager
|
|
||||||
def workdir(path: PathLike) -> Iterator[Path]:
|
|
||||||
old_dir = os.getcwd()
|
|
||||||
os.chdir(path)
|
|
||||||
try:
|
|
||||||
yield Path(old_dir)
|
|
||||||
finally:
|
|
||||||
os.chdir(old_dir)
|
|
||||||
|
|
||||||
class FiscalYear(NamedTuple):
|
class FiscalYear(NamedTuple):
|
||||||
month: int = 3
|
month: int = 3
|
||||||
day: int = 1
|
day: int = 1
|
||||||
|
|
Loading…
Reference in a new issue