[Python-modules-commits] [python-neovim-gui] 02/08: Import python-neovim-gui_0.1.3.orig.tar.gz

Víctor Cuadrado Juan viccuad-guest at moszumanska.debian.org
Wed Jun 29 13:07:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

viccuad-guest pushed a commit to branch master
in repository python-neovim-gui.

commit af6dd7e3157e9d34fcc966a4cebb7ff63e67ebc0
Author: Víctor Cuadrado Juan <me at viccuad.me>
Date:   Wed Jun 29 14:56:29 2016 +0200

    Import python-neovim-gui_0.1.3.orig.tar.gz
---
 PKG-INFO                     |  4 ++--
 neovim_gui.egg-info/PKG-INFO |  4 ++--
 neovim_gui/cli.py            |  5 +++--
 neovim_gui/gtk_ui.py         | 15 ++++++++++-----
 setup.py                     |  4 ++--
 5 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index 9dbbb3e..d5f1c60 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,11 +1,11 @@
 Metadata-Version: 1.1
 Name: neovim_gui
-Version: 0.1.2
+Version: 0.1.3
 Summary: Gtk gui for neovim
 Home-page: http://github.com/neovim/python-gui
 Author: Thiago de Arruda
 Author-email: tpadilha84 at gmail.com
 License: Apache
-Download-URL: https://github.com/neovim/python-gui/archive/0.1.2.tar.gz
+Download-URL: https://github.com/neovim/python-gui/archive/0.1.3.tar.gz
 Description: UNKNOWN
 Platform: UNKNOWN
diff --git a/neovim_gui.egg-info/PKG-INFO b/neovim_gui.egg-info/PKG-INFO
index 52f6a15..558c100 100644
--- a/neovim_gui.egg-info/PKG-INFO
+++ b/neovim_gui.egg-info/PKG-INFO
@@ -1,11 +1,11 @@
 Metadata-Version: 1.1
 Name: neovim-gui
-Version: 0.1.2
+Version: 0.1.3
 Summary: Gtk gui for neovim
 Home-page: http://github.com/neovim/python-gui
 Author: Thiago de Arruda
 Author-email: tpadilha84 at gmail.com
 License: Apache
-Download-URL: https://github.com/neovim/python-gui/archive/0.1.2.tar.gz
+Download-URL: https://github.com/neovim/python-gui/archive/0.1.3.tar.gz
 Description: UNKNOWN
 Platform: UNKNOWN
diff --git a/neovim_gui/cli.py b/neovim_gui/cli.py
index cb42439..8bd2e7a 100644
--- a/neovim_gui/cli.py
+++ b/neovim_gui/cli.py
@@ -13,12 +13,13 @@ from neovim.compat import IS_PYTHON3
 @click.option('--notify', '-n', default=False, is_flag=True)
 @click.option('--listen', '-l')
 @click.option('--connect', '-c')
+ at click.option('--font', '-f', default=('Monospace', 13), nargs=2)
 @click.option('--profile',
               default='disable',
               type=click.Choice(['ncalls', 'tottime', 'percall', 'cumtime',
                                  'name', 'disable']))
 @click.pass_context
-def main(ctx, prog, notify, listen, connect, profile):
+def main(ctx, prog, notify, listen, connect, font, profile):
     """Entry point."""
     address = connect or listen
 
@@ -60,7 +61,7 @@ def main(ctx, prog, notify, listen, connect, profile):
         nvim = attach('child', argv=nvim_argv)
 
     from .gtk_ui import GtkUI
-    ui = GtkUI()
+    ui = GtkUI(font)
     bridge = UIBridge()
     bridge.connect(nvim, ui, profile if profile != 'disable' else None, notify)
 
diff --git a/neovim_gui/gtk_ui.py b/neovim_gui/gtk_ui.py
index f20bd26..8f1f1d8 100644
--- a/neovim_gui/gtk_ui.py
+++ b/neovim_gui/gtk_ui.py
@@ -1,8 +1,13 @@
 """Neovim Gtk+ UI."""
+from __future__ import print_function, division
 import math
 
 import cairo
 
+import gi
+gi.require_version('Gtk', '3.0')
+gi.require_version('Gdk', '3.0')
+gi.require_version('PangoCairo', '1.0')
 from gi.repository import GLib, GObject, Gdk, Gtk, Pango, PangoCairo
 
 from .screen import Screen
@@ -68,13 +73,13 @@ class GtkUI(object):
 
     """Gtk+ UI class."""
 
-    def __init__(self):
+    def __init__(self, font):
         """Initialize the UI instance."""
         self._redraw_arg = None
         self._foreground = -1
         self._background = -1
-        self._font_size = 13
-        self._font_name = 'Monospace'
+        self._font_name = font[0]
+        self._font_size = font[1]
         self._screen = None
         self._attrs = None
         self._busy = False
@@ -316,8 +321,8 @@ class GtkUI(object):
         def resize(*args):
             self._resize_timer_id = None
             width, height = self._window.get_size()
-            columns = width / self._cell_pixel_width
-            rows = height / self._cell_pixel_height
+            columns = width // self._cell_pixel_width
+            rows = height // self._cell_pixel_height
             if self._screen.columns == columns and self._screen.rows == rows:
                 return
             self._bridge.resize(columns, rows)
diff --git a/setup.py b/setup.py
index 71b88f3..854715d 100644
--- a/setup.py
+++ b/setup.py
@@ -22,10 +22,10 @@ except ImportError:
 entry_points = {'console_scripts':  ['pynvim=neovim_gui.cli:main'] }
 
 setup(name='neovim_gui',
-      version='0.1.2',
+      version='0.1.3',
       description='Gtk gui for neovim',
       url='http://github.com/neovim/python-gui',
-      download_url='https://github.com/neovim/python-gui/archive/0.1.2.tar.gz',
+      download_url='https://github.com/neovim/python-gui/archive/0.1.3.tar.gz',
       author='Thiago de Arruda',
       author_email='tpadilha84 at gmail.com',
       license='Apache',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-neovim-gui.git



More information about the Python-modules-commits mailing list