diff --git a/dist/Rackman-1.5.1.tar.gz b/dist/Rackman-1.5.1.tar.gz
deleted file mode 100644
index bafed78..0000000
Binary files a/dist/Rackman-1.5.1.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.5.2.tar.gz b/dist/Rackman-1.5.2.tar.gz
deleted file mode 100644
index 4d4311a..0000000
Binary files a/dist/Rackman-1.5.2.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.0.tar.gz b/dist/Rackman-1.6.0.tar.gz
deleted file mode 100644
index 0fac70d..0000000
Binary files a/dist/Rackman-1.6.0.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.1.tar.gz b/dist/Rackman-1.6.1.tar.gz
deleted file mode 100644
index 6c89c8b..0000000
Binary files a/dist/Rackman-1.6.1.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.2.tar.gz b/dist/Rackman-1.6.2.tar.gz
deleted file mode 100644
index 687f42e..0000000
Binary files a/dist/Rackman-1.6.2.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.3.tar.gz b/dist/Rackman-1.6.3.tar.gz
deleted file mode 100644
index 17216ab..0000000
Binary files a/dist/Rackman-1.6.3.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.4.tar.gz b/dist/Rackman-1.6.4.tar.gz
deleted file mode 100644
index c2f7942..0000000
Binary files a/dist/Rackman-1.6.4.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.5.tar.gz b/dist/Rackman-1.6.5.tar.gz
deleted file mode 100644
index a2a1765..0000000
Binary files a/dist/Rackman-1.6.5.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.6.7.tar.gz b/dist/Rackman-1.6.7.tar.gz
deleted file mode 100644
index a0ae120..0000000
Binary files a/dist/Rackman-1.6.7.tar.gz and /dev/null differ
diff --git a/dist/Rackman-1.7.0.tar.gz b/dist/Rackman-1.7.0.tar.gz
deleted file mode 100644
index f50474f..0000000
Binary files a/dist/Rackman-1.7.0.tar.gz and /dev/null differ
diff --git a/doc/html/ru/index.html b/doc/html/ru/index.html
index 8c43eb8..11528aa 100644
--- a/doc/html/ru/index.html
+++ b/doc/html/ru/index.html
@@ -50,12 +50,14 @@
Центры
Управление дочерним окном измерения (Slave)
Установка и запуск
diff --git a/doc/man/ru/rackman b/doc/man/ru/rackman
index da52133..2976d56 100644
--- a/doc/man/ru/rackman
+++ b/doc/man/ru/rackman
@@ -1,4 +1,4 @@
-.TH RACKMAN 1 2016-04-17 1.11.0 ""
+.TH RACKMAN 1 2016-04-21 1.11.2 ""
.SH Rackman
.PP
Утилита, позволяющая измерять растояния в пикселях, миллиметрах, дюймах
@@ -36,6 +36,8 @@ Rackman позволяет визуально отслеживать центр
.IP \[bu] 2
←, ↑, →, ↓
.IP \[bu] 2
+Alt + ←, ↑, →, ↓
+.IP \[bu] 2
Попиксельное перемещение окна
.IP \[bu] 2
Ctrl + ←, ↑, →, ↓
@@ -46,6 +48,8 @@ Shift + ←, ↑, →, ↓
.IP \[bu] 2
Shift + Ctrl + ←, ↑, →, ↓
.IP \[bu] 2
+Shift + Alt + ←, ↑, →, ↓
+.IP \[bu] 2
используйте нативные методы вашего DE.
.SS Установка и запуск
.SS Stand\-alone версия
@@ -101,7 +105,7 @@ Master\-окна (окно должно быть в фокусе)
.PP
MIT License
.SS Authors
-.IP "(c)" 4
+.IP "(C)" 4
2015\-2016 Николай Волков
.PP
diff --git a/doc/man/ru/rackman.1.gz b/doc/man/ru/rackman.1.gz
index 37182a6..0015ff0 100644
Binary files a/doc/man/ru/rackman.1.gz and b/doc/man/ru/rackman.1.gz differ
diff --git a/locale/en/LC_MESSAGES/rackman.mo b/locale/en/LC_MESSAGES/rackman.mo
index 613d4bf..748623f 100644
Binary files a/locale/en/LC_MESSAGES/rackman.mo and b/locale/en/LC_MESSAGES/rackman.mo differ
diff --git a/locale/ru/LC_MESSAGES/rackman.mo b/locale/ru/LC_MESSAGES/rackman.mo
index b12b26a..c97ad37 100644
Binary files a/locale/ru/LC_MESSAGES/rackman.mo and b/locale/ru/LC_MESSAGES/rackman.mo differ
diff --git a/make.py b/make.py
new file mode 100755
index 0000000..008fdf0
--- /dev/null
+++ b/make.py
@@ -0,0 +1,195 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+import click
+import os, sys
+import subprocess
+import rackman
+
+
+VERSION = rackman.__version__
+RELEASE = 'trusty'
+
+basedir = os.path.realpath('.')
+
+
+@click.group(chain=True)
+def cli():
+ """Building script for Rackman"""
+ pass
+
+
+@cli.command()
+def build_deb():
+ """Building DEB package"""
+
+ try:
+ # https://docs.python.org/2/distutils/introduction.html#distutils-simple-example
+ os.chdir( basedir )
+ subprocess.call("python setup.py sdist", shell=True)
+ except OSError, e:
+ click.echo("ERR: setup.py sdist; {}".format(e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ try:
+ # https://pypi.python.org/pypi/stdeb/#debianize-distutils-command
+ os.chdir( "{}/dist".format(basedir) )
+ subprocess.call("py2dsc --suite='{}' Rackman-{}.tar.gz".format(RELEASE, VERSION), shell=True)
+ except OSError, e:
+ click.echo("ERR: py2dsc --suite='{}' Rackman-{}.tar.gz; {}".format(RELEASE, VERSION, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ try:
+ os.chdir( "{}/dist/deb_dist/rackman-{}".format(basedir, VERSION) )
+ subprocess.call("sed -i -- '/^Depends:/ s/$/, python-gtk2 (>=2.24.0), python-cairo (>=1.8.8)/g' ./debian/control", shell=True)
+ subprocess.call("sed -i -- '/^Build-Depends:/ s/$/, python-gtk2 (>=2.24.0), python-cairo (>=1.8.8)/g' ./debian/control", shell=True)
+ subprocess.call("sed -i -- 's/python-rackman/rackman/g' ./debian/control ./debian/rules", shell=True)
+ subprocess.call("dpkg-buildpackage -rfakeroot -uc -us", shell=True)
+ except OSError, e:
+ click.echo("ERR: dpkg-buildpackage -rfakeroot -uc -us; {}".format(e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ try:
+ # https://help.ubuntu.com/community/GnuPrivacyGuardHowto
+ # https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage
+ os.chdir( "{}/dist/deb_dist/rackman-{}".format(basedir, VERSION) )
+ subprocess.call("debuild -S -sa -k$GPGKEY", shell=True)
+ except OSError, e:
+ click.echo("ERR: debuild -S -sa -k$GPGKEY; {}".format(e), err=True)
+ sys.exit(os.EX_OSERR)
+
+
+@cli.command()
+def push():
+ """Pushing DEB in Launchpad"""
+ # https://help.launchpad.net/Packaging/PPA/Uploading#Next_steps
+ comm = "dput ppa:freezemandix/rackman rackman_{}-1_source.changes".format(VERSION)
+ try:
+ os.chdir( "{}/dist/deb_dist/".format(basedir) )
+ subprocess.call(comm, shell=True)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+
+@cli.command()
+def clean():
+ """Cleaning ./dist and ./build directories"""
+ import shutil
+
+ path = os.path.join(basedir, 'dist')
+ try:
+ shutil.rmtree(path)
+ except OSError, e:
+ click.echo("ERR: remove {}; {}".format(path, e), err=True)
+
+ path = os.path.join(basedir, 'build')
+ try:
+ shutil.rmtree(path)
+ except OSError, e:
+ click.echo("ERR: remove {}; {}".format(path, e), err=True)
+
+
+@cli.command()
+@click.option('--html', '-h', is_flag=True, help='generating html documentation')
+@click.option('--man', '-m', is_flag=True, help='generating man documentation')
+def build_doc(html, man):
+ """Building documentation from README.md"""
+ # Building html page
+ if html:
+ comm = "pandoc --standalone --self-contained --smart --normalize -V lang:russian -f markdown -t html -o ./doc/html/ru/index.html README.md"
+ try:
+ os.chdir( basedir )
+ subprocess.call(comm, shell=True)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ # Building man page
+ if man:
+ from datetime import datetime
+ import gzip, shutil
+ comm = "pandoc --standalone --self-contained --smart --normalize -V lang:russian -f markdown -t man -o ./doc/man/ru/rackman README.md"
+ date = datetime.today().strftime('%Y-%m-%d')
+ try:
+ os.chdir( basedir )
+ subprocess.call(comm, shell=True)
+
+ # add metadata in man page
+ subprocess.call('''sed -i -- 's/.TH "" "" "" "" ""/.TH RACKMAN 1 {} {} ""/g' ./doc/man/ru/rackman'''.format(date, VERSION), shell=True)
+
+ # compressing man page (rackman -> rackman.1.gz)
+ with open(os.path.join(basedir, 'doc/man/ru/rackman'), 'rb') as f_in, gzip.open(os.path.join(basedir, 'doc/man/ru/rackman.1.gz'), 'wb') as f_out:
+ shutil.copyfileobj(f_in, f_out)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+
+@cli.command()
+@click.option('--update', '-u', is_flag=False, help='update messages.pot from rackman.py')
+@click.option('--merge', '-m', is_flag=False, help='merge po files with messages.pot')
+@click.option('--add', '-a', is_flag=False, help='add translation for new language')
+@click.option('--build', '-b', is_flag=False, help='build mo files from po files')
+@click.option('--lang', '-l', default='en', help='language (default=en)')
+def build_lang(update, merge, add, build, lang):
+ """Building i18n files"""
+ # https://help.launchpad.net/Translations/POTemplates
+
+ if update:
+ comm = 'xgettext -k_ -kN_ --package-version={} --package-name=rackman --copyright-holder="by Nik Volkov" --msgid-bugs-address=freezemandix@ya.ru -o messages.pot rackman.py'.format(VERSION)
+ try:
+ os.chdir( basedir )
+ subprocess.call(comm, shell=True)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ if add:
+ comm = 'msginit --locale={}'.format(lang)
+ try:
+ os.chdir( basedir )
+ subprocess.call(comm, shell=True)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ if merge:
+ comm = 'msgmerge -UN {}.po messages.pot'.format(lang)
+ try:
+ os.chdir( basedir )
+ subprocess.call(comm, shell=True)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+ if build:
+ comm = 'msgfmt {lang}.po -o locale/{lang}/LC_MESSAGES/rackman.mo'.format(lang=lang)
+ try:
+ os.chdir( basedir )
+ path = 'locale/{}/LC_MESSAGES/'.format(lang)
+ if os.path.isdir(path) is False:
+ os.makedirs(path)
+ subprocess.call(comm, shell=True)
+ except OSError, e:
+ click.echo("ERR: {}; {}".format(comm, e), err=True)
+ sys.exit(os.EX_OSERR)
+
+
+@cli.command()
+@click.pass_context
+def build_all(ctx):
+ """Building all in DEB (full cycle)"""
+ for lang in ('en', 'ru'):
+ ctx.invoke(build_lang, lang=lang, update=True, merge=True)
+ while True:
+ if click.confirm('Whether translations are true to the {} po files?'.format(lang)):
+ ctx.invoke(build_lang, lang=lang, build=True)
+ break
+
+ ctx.invoke(build_doc, html=True, man=True)
+ ctx.invoke(build_deb)
+
+
+if __name__ == '__main__':
+ cli()
diff --git a/rackman.py b/rackman.py
index d320644..a3a5486 100644
--- a/rackman.py
+++ b/rackman.py
@@ -17,7 +17,7 @@
-__version__ = '1.11.1'
+__version__ = '1.11.2'