Make a main class OfflineImap that is being called

Rather than calling a function in a module, invoke offlineimap by
calling an OfflineImap object.

This removes code lying outside of objects; I prefer to keep code
within an object and provides us with a nicer Object encapsulation.

It will also ease the testing of Object functionality in unittests
when they are introduced.

Previously we would import and start Offlineimap like this:

from offlineimap import init
init.startup('6.2.0')

now we do:
from offlineimap import OfflineImap

offlineimap = OfflineImap()
offlineimap.startup('6.2.0')

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2010-12-06 13:36:54 +01:00
committed by Nicolas Sebrecht
parent 35dd236155
commit 325dd833ba
4 changed files with 203 additions and 194 deletions

View File

@ -17,5 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from offlineimap import init
init.startup('6.2.0')
from offlineimap import OfflineImap
offlineimap = OfflineImap()
offlineimap.startup('6.2.0')