Skip to content

Commit

Permalink
clean up imports and parameter naming
Browse files Browse the repository at this point in the history
  • Loading branch information
jktr committed Nov 21, 2021
1 parent 3f86d15 commit 957b50c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# SPDX-License-Identifier: CC0-1.0

from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import (
_Backend, FigureCanvasBase, FigureManagerBase)
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib import interactive
import os
import sys

from io import BytesIO
from subprocess import run

import sys
from matplotlib import interactive, is_interactive
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import (_Backend, FigureManagerBase)
from matplotlib.backends.backend_agg import FigureCanvasAgg


# XXX heuristic for interactive repl
Expand All @@ -20,7 +20,7 @@
class FigureManagerICat(FigureManagerBase):

@classmethod
def _run(self, *cmd):
def _run(cls, *cmd):
def f(*args, output=True, **kwargs):
if output:
kwargs['capture_output'] = True
Expand Down Expand Up @@ -51,6 +51,7 @@ def show(self):
self.canvas.figure.savefig(buf, format='png', facecolor='#888888')
icat('--align', 'left', output=False, input=buf.getbuffer())


@_Backend.export
class _BackendICatAgg(_Backend):
FigureCanvas = FigureCanvasAgg
Expand All @@ -67,7 +68,8 @@ def _trigger_manager_draw(manager):
manager.show()
Gcf.destroy(manager)

def show(*args, **kwargs):
@classmethod
def show(cls, *args, **kwargs):
_Backend.show(*args, **kwargs)
Gcf.destroy_all()

Expand Down

0 comments on commit 957b50c

Please sign in to comment.