Move the command line option handling from the more manual "getopts"
module to the full fledged "OptionParser". It has the advantage of
e.g. automatically creating the Help text that is shown with the
"-h/--help" option rather than having to hardcode the text and
format the line breaking manually.
Also, do away with the version check when invoking OfflineImap so we
do not have to change the version number in three places when bumping
it.
Rename startup() to run() which sounds more in line what other modules
call their run functions (e.g. Thread.run()).
Signed-Off-By: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
On 12/13/2010 12:25 PM, Nicolas Sebrecht wrote:
> The release number information is hard coded. Here is a quick fix to update it
> to the last release.
>
> We may introduce more elaborated stuff to define the release dynamically.
FYI: not sure if you all saw it or changed it, but there were three
places I always changed for each new release:
offlineimap.py
bin/offlineimap
offlineimap/version.py
in particular, the value in version.py must match the value in the
offlineimap(.py) file that someone uses to start the thing up.
Reported-by: John Goerzen <jgoerzen@complete.org>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
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>