Skip to content

Commit 0d65822

Browse files
committed
Using absolute imports and fixing a bug, so closes #14
1 parent 775bc68 commit 0d65822

7 files changed

Lines changed: 19 additions & 10 deletions

File tree

gvanim/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
# You should have received a copy of the GNU General Public License along with
1616
# "GraphvizAnim". If not, see <http://www.gnu.org/licenses/>.
1717

18-
from .animation import Animation
19-
from .render import render, gif
18+
from __future__ import absolute_import
19+
20+
from gvanim.animation import Animation
21+
from gvanim.render import render, gif

gvanim/__main__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
# You should have received a copy of the GNU General Public License along with
1616
# "GraphvizAnim". If not, see <http://www.gnu.org/licenses/>.
1717

18+
from __future__ import absolute_import
19+
1820
from argparse import ArgumentParser, FileType
1921
from sys import stdin
2022

21-
from . import animation, render
23+
from gvanim import Animation, render, gif
2224

2325
def main():
2426

@@ -28,9 +30,9 @@ def main():
2830
parser.add_argument( 'basename', help = 'The basename of the generated file' )
2931
args = parser.parse_args()
3032

31-
ga = animation.Animation()
33+
ga = Animation()
3234
ga.parse( args.animation )
33-
render.gif( render.render( ga.graphs(), args.basename, 'png' ), args.basename, args.delay )
35+
gif( render( ga.graphs(), args.basename, 'png' ), args.basename, args.delay )
3436

3537
if __name__ == '__main__':
3638
main()

gvanim/action.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class NextStep( object ):
1919
def __init__( self, clean = False ):
2020
self.clean = clean
2121
def __call__( self, steps ):
22-
from . import animation
23-
steps.append( animation.Step( None if self.clean else steps[ -1 ] ) )
22+
from gvanim.animation import Step
23+
steps.append( Step( None if self.clean else steps[ -1 ] ) )
2424

2525
class AddNode( object ):
2626
def __init__( self, v ):
@@ -103,4 +103,3 @@ def __call__( self, steps ):
103103
del steps[ -1 ].hE[ ( self.u, self.v ) ]
104104
except KeyError:
105105
pass
106-

gvanim/animation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
# You should have received a copy of the GNU General Public License along with
1616
# "GraphvizAnim". If not, see <http://www.gnu.org/licenses/>.
1717

18+
from __future__ import absolute_import
19+
1820
from email.utils import quote
1921
import shlex
2022

21-
from . import action
23+
from gvanim import action
2224

2325
class ParseException( Exception ):
2426
pass

gvanim/jupyter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
# You should have received a copy of the GNU General Public License along with
1616
# "GraphvizAnim". If not, see <http://www.gnu.org/licenses/>.
1717

18+
from __future__ import absolute_import
19+
1820
from os.path import join
1921
from tempfile import mkdtemp
2022
from shutil import rmtree
2123

2224
from IPython.display import Image
2325
import ipywidgets as widgets
2426

25-
from .render import render
27+
from gvanim import render
2628

2729
def interactive( animation, size = 320 ):
2830
basedir = mkdtemp()

gvanim/render.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# You should have received a copy of the GNU General Public License along with
1616
# "GraphvizAnim". If not, see <http://www.gnu.org/licenses/>.
1717

18+
from __future__ import absolute_import
19+
1820
from subprocess import Popen, PIPE, STDOUT, call
1921
from multiprocessing import Pool, cpu_count
2022

tests/action.pyc

1.47 KB
Binary file not shown.

0 commit comments

Comments
 (0)