diff --git a/gvanim/__init__.py b/gvanim/__init__.py index 61ada71..3439171 100644 --- a/gvanim/__init__.py +++ b/gvanim/__init__.py @@ -15,5 +15,7 @@ # You should have received a copy of the GNU General Public License along with # "GraphvizAnim". If not, see . -from .animation import Animation -from .render import render, gif +from __future__ import absolute_import + +from gvanim.animation import Animation +from gvanim.render import render, gif diff --git a/gvanim/__main__.py b/gvanim/__main__.py index 24c9dba..57e4ef4 100644 --- a/gvanim/__main__.py +++ b/gvanim/__main__.py @@ -15,10 +15,12 @@ # You should have received a copy of the GNU General Public License along with # "GraphvizAnim". If not, see . +from __future__ import absolute_import + from argparse import ArgumentParser, FileType from sys import stdin -from . import animation, render +from gvanim import Animation, render, gif def main(): @@ -28,9 +30,9 @@ def main(): parser.add_argument( 'basename', help = 'The basename of the generated file' ) args = parser.parse_args() - ga = animation.Animation() + ga = Animation() ga.parse( args.animation ) - render.gif( render.render( ga.graphs(), args.basename, 'png' ), args.basename, args.delay ) + gif( render( ga.graphs(), args.basename, 'png' ), args.basename, args.delay ) if __name__ == '__main__': main() diff --git a/gvanim/action.py b/gvanim/action.py index 4bb6bf2..d152ec2 100644 --- a/gvanim/action.py +++ b/gvanim/action.py @@ -19,8 +19,8 @@ class NextStep( object ): def __init__( self, clean = False ): self.clean = clean def __call__( self, steps ): - from . import animation - steps.append( animation.Step( None if self.clean else steps[ -1 ] ) ) + from gvanim.animation import Step + steps.append( Step( None if self.clean else steps[ -1 ] ) ) class AddNode( object ): def __init__( self, v ): @@ -103,4 +103,3 @@ def __call__( self, steps ): del steps[ -1 ].hE[ ( self.u, self.v ) ] except KeyError: pass - diff --git a/gvanim/animation.py b/gvanim/animation.py index 836c2c7..33a0748 100644 --- a/gvanim/animation.py +++ b/gvanim/animation.py @@ -15,10 +15,12 @@ # You should have received a copy of the GNU General Public License along with # "GraphvizAnim". If not, see . +from __future__ import absolute_import + from email.utils import quote import shlex -from . import action +from gvanim import action class ParseException( Exception ): pass diff --git a/gvanim/jupyter.py b/gvanim/jupyter.py index 5645134..c8779d2 100644 --- a/gvanim/jupyter.py +++ b/gvanim/jupyter.py @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License along with # "GraphvizAnim". If not, see . +from __future__ import absolute_import + from os.path import join from tempfile import mkdtemp from shutil import rmtree @@ -22,7 +24,7 @@ from IPython.display import Image import ipywidgets as widgets -from .render import render +from gvanim import render def interactive( animation, size = 320 ): basedir = mkdtemp() diff --git a/gvanim/render.py b/gvanim/render.py index 69aabcd..f8fe1b1 100644 --- a/gvanim/render.py +++ b/gvanim/render.py @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License along with # "GraphvizAnim". If not, see . +from __future__ import absolute_import + from subprocess import Popen, PIPE, STDOUT, call from multiprocessing import Pool, cpu_count diff --git a/tests/action.pyc b/tests/action.pyc new file mode 100644 index 0000000..c7eb72f Binary files /dev/null and b/tests/action.pyc differ