Variable 'args' undefined in rmagics:publish_graphics

Issue #217 closed
christian roth created an issue

You have a small bug in rmagics.py:

The issue is in the publish_graphics method. It affects the svg output of images.

def publish_graphics(self, graph_dir):
    [...]
        # By default, isolate SVG images in the Notebook to avoid garbling
        if images and self.device == "svg" and args.noisolation == False:
            md = {'image/svg+xml': dict(isolated=True)}
    [...]

In this helper method args is undefined. This small fix works for me:

def publish_graphics(self, graph_dir, noisolation):
    [...]
        # By default, isolate SVG images in the Notebook to avoid garbling
        if images and self.device == "svg" and not noisolation:
            md = {'image/svg+xml': dict(isolated=True)}
    [...]

And the calling:

display_data, md = self.publish_graphics(tmpd, args.noisolation)

Comments (10)

  1. Dav Clark

    Sorry to be delayed! Thanks for catching this and describing a fix, I'll plan to get this in this week!

  2. Dav Clark

    So, the changes in this branch should be merged into master... can you tell me the right way to do that?

  3. Dav Clark

    Right - it's definitely in the main repository (and may even warrant a point-release, though we can also wait 'til I address other bugs). I was speaking in git, though. I meant to say, what is the preferred way to merge these changes into "default"!

  4. Laurent Gautier

    Frequent bugfix releases is fine. There was one bug with ggplot2 fixed before this, and I am going over issues to find what could be fixed before a point release.

  5. Laurent Gautier

    @Dav Clark :

    what is the preferred way to merge these changes into "default"!

    Do you mean propagate the fix to different branch (say, fixed in default, the development branch, and wanting to add the fix to branch version_2.4.x) ? If so, I genereally use hg graft -r <revision>. I think that I already made sure this fix is in both in default and version_2.4.x.

  6. Log in to comment