Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
Scripts doc skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
zrzka committed Sep 30, 2017
1 parent 57d7c9a commit c62e109
Show file tree
Hide file tree
Showing 25 changed files with 153 additions and 3 deletions.
21 changes: 21 additions & 0 deletions blackmamba/script/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Black Mamba scripts usable as Pythonista action items (wrench icon).
.. automodule:: blackmamba.script.action_quickly
.. automodule:: blackmamba.script.analyze
.. automodule:: blackmamba.script.clear_annotations
.. automodule:: blackmamba.script.close_all_tabs_except_current_one
.. automodule:: blackmamba.script.drag_and_drop
.. automodule:: blackmamba.script.find_usages
.. automodule:: blackmamba.script.jump_to_definition
.. automodule:: blackmamba.script.jump_to_line
.. automodule:: blackmamba.script.new_file
.. automodule:: blackmamba.script.new_tab
.. automodule:: blackmamba.script.open_quickly
.. automodule:: blackmamba.script.outline_quickly
.. automodule:: blackmamba.script.run_quickly
.. automodule:: blackmamba.script.run_unit_tests
.. automodule:: blackmamba.script.search_dash
.. automodule:: blackmamba.script.show_documentation
.. automodule:: blackmamba.script.toggle_comments
"""
10 changes: 10 additions & 0 deletions blackmamba/script/action_quickly.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!python3
"""
Action quickly
==============
* Script name: ``action_quickly.py``
* Keyboard shortcut: ``Cmd Shift A``
Shows dialog with user defined action items (wrench icon). You can filter them
by title, use arrow keys to change selection and run action with ``Enter`` key.
"""

import os
from ui import TableViewCell
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/analyze.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Analyze
=======
* Script name: ``analyze.py``
* Keyboard shortcut: ``Ctrl Shift B``
"""

import io
import pep8
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/clear_annotations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Clear annotations
=================
* Script name: ``clear_annotations.py``
* Keyboard shortcut: ``Cmd Shift K``
"""

import editor

Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/close_all_tabs_except_current_one.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Close all tabs except current one
=================================
* Script name: ``close_all_tabs_except_current_one.py``
* Keyboard shortcut: ``Cmd Shift W``
"""

import blackmamba.ide.tab as tab

Expand Down
8 changes: 8 additions & 0 deletions blackmamba/script/drag_and_drop.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!python3
"""
Drag & Drop
===========
* Script name: ``drag_and_drop.py``
* Keyboard shortcut: ``Cmd E``
* iOS >= 11.0 required
"""

import os
import ui
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/find_usages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Find usages
===========
* Script name: ``find_usages.py``
* Keyboard shortcut: ``Ctrl Cmd U``
"""

from blackmamba.uikit.picker import PickerView, PickerItem, PickerDataSource
import editor
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/jump_to_definition.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Jump to definition
==================
* Script name: ``jump_to_definition.py``
* Keyboard shortcut: ``Ctrl Cmd J``
"""

from blackmamba.uikit.picker import PickerView, PickerItem, PickerDataSource
import editor
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/jump_to_line.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Jump to line
============
* Script name: ``jump_to_line.py``
* Keyboard shortcut: ``Ctrl L``
"""

import blackmamba.ide.source as source
import console
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/new_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
New file
========
* Script name: ``new_file.py``
* Keyboard shortcut: ``Cmd N``
"""

import blackmamba.ide.tab as tab

Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/new_tab.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
New tab
=======
* Script name: ``new_tab.py``
* Keyboard shortcut: ``Cmd T``
"""

import blackmamba.ide.tab as tab

Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/open_quickly.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Open quickly
============
* Script name: ``open_quickly.py``
* Keyboard shortcut: ``Cmd Shift O``
"""

import os
from blackmamba.uikit.picker import PickerView, PickerItem, PickerDataSource
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/outline_quickly.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Outline quickly
===============
* Script name: ``outline_quickly.py``
* Keyboard shortcut: ``Cmd Shift L``
"""

import editor
import ast
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/run_quickly.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Run quickly
===========
* Script name: ``run_quickly.py``
* Keyboard shortcut: ``Cmd Shift R``
"""

import os
from blackmamba.uikit.picker import PickerView, PickerItem, PickerDataSource
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/run_unit_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Run unit tests
==============
* Script name: ``run_unit_tests.py``
* Keyboard shortcut: ``Cmd U``
"""

import pytest
import editor
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/search_dash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Search Dash
===========
* Script name: ``search_dash.py``
* Keyboard shortcut: ``Cmd Shift 0``
"""

import editor
import urllib.parse
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/show_documentation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Search documentation
====================
* Script name: ``show_documentation.py``
* Keyboard shortcut: ``Ctrl Cmd ?``
"""

from blackmamba.uikit.picker import PickerView, PickerItem, PickerDataSource
import editor
Expand Down
7 changes: 7 additions & 0 deletions blackmamba/script/toggle_comments.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!python3
"""
Toggle comments
===============
* Script name: ``toggle_comments.py``
* Keyboard shortcut: ``Cmd /``
"""

import re
from blackmamba.system import Pythonista
Expand Down
Empty file removed docs/mocks/console.py
Empty file.
Empty file removed docs/mocks/editor.py
Empty file.
Empty file removed docs/mocks/objc_util.py
Empty file.
Empty file removed docs/mocks/ui.py
Empty file.
8 changes: 7 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@

import os
import sys
import unittest.mock
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../mocks'))

import blackmamba # noqa: E402


sys.modules['console'] = unittest.mock.MagicMock()
sys.modules['editor'] = unittest.mock.MagicMock()
sys.modules['ui'] = unittest.mock.MagicMock()
sys.modules['objc_util'] = unittest.mock.MagicMock()


extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
Expand Down
2 changes: 1 addition & 1 deletion docs/source/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Black Mamba Reference
:Release: |version|
:Date: |today|

.. module:: blackmamba
.. automodule:: blackmamba

This reference manual details functions, modules, and objects
included in Black Mamba, describing what they are and what they do.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user/scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Scripts
#######

.. module:: blackmamba.script
.. automodule:: blackmamba.script

0 comments on commit c62e109

Please sign in to comment.