Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

0.4.6

  • Loading branch information...
commit 07714808107bdc2becada47449024afb89dcdef5 1 parent 667dd9a
@baverman authored
View
10 CHANGES
@@ -1,6 +1,16 @@
Snaked changelog
================
+v0.4.6
+------
+
+- snippets file highlight
+- type hint api changed (providers do not need to do own caching, module and
+ class attributes resolving calls were joined)
+- integration with unit test frameworks via py.test
+- smart selection shrinking on shift+alt+w
+
+
v0.4.5
------
View
4 doc/conf.py
@@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
-version = '0.4'
+version = '0.4.6'
# The full version, including alpha/beta/rc tags.
-release = '0.4'
+release = '0.4.6'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
View
BIN  doc/images/unittest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
27 doc/index.rst
@@ -1,22 +1,19 @@
Snaked user manual
====================
-`Snaked`_ (**snak**\ e **ed**\ itor) is light and :ref:`minimalist
-<minimalist-mean>` editor inspired by `Scribes`_, indented mostly for python
-developers, but other users may find it useful too.
+`Snaked`_ (**snak**\ e **ed**\ itor) is light and :ref:`minimalist <minimalist-mean>`
+editor inspired by `Scribes`_, indented mostly for python developers, but
+other users may find it useful too.
Features:
-* Light UI. There are no menu, tool bar, status bar or project browser at all. Only editor view
- itself.
+* Light UI. There are no menu, tool bar, status bar or project browser at all.
+ Only editor view itself.
* `gtksourceview2`_ based.
* Keyboard oriented control.
-* :ref:`Tabbed <tabbed-interface>` and :ref:`windowed <windowed-interface>`
- (separate window for each editor) interfaces.
-
* Auto projects. In most cases you do not need such boring operation like
:menuselection:`File --> New project`. Just start edit your file.
@@ -26,13 +23,17 @@ Features:
* Restoring last edit position.
-* Python auto complete and navigation via rope.
+* Python auto complete and navigation via rope with very flexible type hinting
+ framework. PyGtk, Django support.
* Basic python code lint via pyflakes.
-* Smart everything selection.
+* Snippets.
+
+* Unittests (with `py.test <http://pytest.org/>`_ as backend, so there is
+ support for usual UnitTest cases, nose cases and ``py.test`` itself).
-* Common word completer.
+* Spell check.
.. image:: /images/snaked.*
@@ -43,8 +44,8 @@ Features:
.. note::
Just a brief remark: I'm not a native English speaker so you may feel some
- confusion reading this manual. Please, :ref:`share <contacts>` your discomfiture with me. I'll
- be very grateful for that.
+ confusion reading this manual. Please, :ref:`share <contacts>` your
+ discomfiture with me. I'll be very grateful for that.
Content
View
13 doc/plugins.rst
@@ -31,6 +31,8 @@ Provides features for easy text editing.
gtksourceview2 selection moving (``<alt>Up``, ``<alt>Down``) it allows forget
about copy-paste.
+* ``<shift><alt>w`` shrinks smart selection back.
+
* ``<alt>f`` reformats selection to current right margin width.
That's all for now. Planed feature functionality:
@@ -151,14 +153,13 @@ Snippets
It is similar to vim's SnipMate plugin which are clone of TextMate's snippets,
you may refer to these projects for syntax documentation.
-User snippet files are searched in ``~/.config/snaked/snippets``. There are only
-python built-in snippets now.
+User snippet files are searched in ``~/.config/snaked/snippets``. You can
+configure it via preferences (``<ctrl>p``) item ``Snippets``.
-Missing features:
+There is ability to attach several snippet sets to one editor via multiple
+contexts (preferences ``File types`` item).
-* Multiple contexts, e.g. django template should have `html` and `django`
- contexts to allow to use two snippet sets. There is only one context defined by
- editor language now.
+Missing features:
* Variable/python commands/shell commands expansion via backticks.
View
85 doc/python.rst
@@ -135,21 +135,90 @@ Image again:
.. image:: /images/pygtk-hints.*
-Who is there? ``BuilderAwere`` is a simple wrapper which delegates missing
+Who is there? ``BuilderAware`` is a simple wrapper which delegates missing
attributes to GtkBuilder. ``Window`` is ``BuilderAware`` class constructed from
glade file. ``vbox1`` is a GtkVBox defined in glade file and PyGtk hint provider
resolves class attributes from it.
-Besides that, goto definition (``F3``) opens glade file and place cursor at ``vbox1``
-declaration.
+Besides that, goto definition (``F3``) opens glade file and place cursor at
+``vbox1`` declaration.
-And more, if there are any signal handlers in glade file they parameters also will
-be resolved.
+And more, if there are any signal handlers in glade file they parameters also
+will be resolved.
-You only need to add pygtk support and assign glade file to class via ``ropehints.py``::
+You only need to add pygtk support and assign glade file to class via
+``ropehints.py``::
def init(provider):
from snaked.plugins.python.pygtkhints import add_gtk_support
+ add_gtk_support(provider)
- pygtk = add_gtk_support(provider)
- pygtk.add_class('gui.Window', 'main.glade')
+And define glade file in class pydoc::
+
+ class Window(BuilderAware):
+ """glade-file: main.glade"""
+ ...
+
+
+Unit testing
+------------
+
+This is a holy grail of modern development. Honestly, I didn't plan to integrate
+unit testing support in snaked -- running ``py.test`` from terminal completely
+satisfied my needs, but during heavy tests reorganization I realized too much
+time was spent for snaked/terminal switching and searching fail's cause in
+``py.test`` output.
+
+Plugin completely based on `py.test <http://pytest.org>`_ capabilities and you
+need latest (2.0) its version. Unit testing features:
+
+* Test framework agnostic. Really killer feature -- one shoot and three bunnies
+ are dead: ``py.test`` itself, `unittest
+ <http://docs.python.org/library/unittest.html>`_ and `nose
+ <http://somethingaboutorange.com/mrl/projects/nose/>`_.
+
+* Test environment configuration are done by ordinary ``conftest.py`` and
+ `pytest.ini <http://pytest.org/customize.html>`_.
+
+* Common GUI for testing process which can be founded in other IDEs.
+
+* Tests output is not messed and can be seen for each test individually (thanks
+ for ``py.test``).
+
+* Quick jump to test fail cause. Also one can navigate through traceback.
+ Without any mouse, fast ant easy.
+
+.. image:: /images/unittest.*
+
+Shortcuts
+*********
+
+* ``<ctrl><shift>F10`` runs all tests in project.
+
+* ``<ctrl>F10`` runs tests defined in scope under cursor. It can be test
+ function/method, test case class or whole module.
+
+* ``<shift><alt>x`` reruns last tests.
+
+* ``<alt>1`` toggles test result window.
+
+* ``Enter`` in test list view jums to failed test line.
+
+* ``<alt>u``/``<alt>n`` mnemonics navigate through traceback.
+
+Running django tests
+********************
+
+At first you need to configure django environment. Create ``conftest.py`` module
+in the root of you project::
+
+ import os
+ os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+
+Then you should tell ``py.test`` which modules are tests proper. Create
+``pytest.ini`` file in project root::
+
+ [pytest]
+ python_files = tests.py
+
+That's all. Now you can run django tests with ``py.test`` and snaked.
View
2  setup.py
@@ -2,7 +2,7 @@
setup(
name = 'snaked',
- version = '0.4.5',
+ version = '0.4.6',
author = 'Anton Bobrov',
author_email = 'bobrov@vl.ru',
description = 'Very light and minimalist editor inspired by Scribes',
Please sign in to comment.
Something went wrong with that request. Please try again.