1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-30 08:43:31 +02:00

Cleaned up __init__.py for main module

This commit is contained in:
2021-01-05 19:48:45 +01:00
parent 8a757f60a6
commit b2f161670a
15 changed files with 55 additions and 85 deletions

View File

@@ -1,26 +0,0 @@
import os
import re
from functools import partial
from ebook_converter import constants_old
from ebook_converter.utils import entities
class CurrentDir(object):
def __init__(self, path):
self.path = path
self.cwd = None
def __enter__(self, *args):
self.cwd = os.getcwd()
os.chdir(self.path)
return self.cwd
def __exit__(self, *args):
try:
os.chdir(self.cwd)
except EnvironmentError:
# The previous CWD no longer exists
pass