Commits

squeaky  committed d7f32ed

merge jbrowser into compat

  • Participants
  • Parent commits 2a7c7fb

Comments (0)

Files changed (2)

File pystacia/compat.py

 jython = sys.platform.startswith('java')
 
 if jython:
-    from pystacia.jbrowser import open as gui_open  # @UnusedImport
+    from java.io import File  # @UnresolvedImport
+    from java.net import URL  # @UnresolvedImport
+    from javax.imageio import ImageIO  # @UnresolvedImport
+    from javax.swing import JLabel, JFrame, ImageIcon  # @UnresolvedImport
+
+    def gui_open(path):
+        label = JLabel(ImageIcon(ImageIO.read(File(URL(path).getFile()))))
+        frame = JFrame()
+        frame.getContentPane().add(label)
+        frame.pack()
+        frame.setLocation(200, 200)
+        frame.setVisible(True)
 else:
     from webbrowser import open as gui_open  # NOQA

File pystacia/jbrowser.py

-from java.io import File  # @UnresolvedImport
-from java.net import URL  # @UnresolvedImport
-from javax.imageio import ImageIO  # @UnresolvedImport
-from javax.swing import JLabel, JFrame, ImageIcon  # @UnresolvedImport
-
-
-def open(path):  # @ReservedAssignment
-    label = JLabel(ImageIcon(ImageIO.read(File(URL(path).getFile()))))
-    frame = JFrame()
-    frame.getContentPane().add(label)
-    frame.pack()
-    frame.setLocation(200, 200)
-    frame.setVisible(True)