Skip to content

Commit 8db7417

Browse files
committed
Merge branch '0.6' into devel
2 parents 4dc811c + 32d6693 commit 8db7417

16 files changed

+217
-18
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.pyc
2+
.coverage
3+
*~
4+
*egg-info
5+
.tox
6+
build/
7+
dist/

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.6 6 February 2018
2+
Added a plugin for Vim
3+
Support Python 3
4+
15
0.5 6 March 2011
26
Added GTK, wxWidget sample editors
37
Added Lexer and Parser classes

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ include pyroom-0.4.1-arithmetic.patch
77
include calc.py
88
include manual.rst
99
include manual.html
10+
include vim-plugin/wrapper.py
11+
include vim-plugin/tutorial.txt
12+
include vim-plugin/arithmetic.vim
13+
include vim-plugin/arithmetic.txt
14+
include vim-plugin/install.sh

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Publish to web page src directory
33
#
44

5-
VERSION = 0.5
5+
VERSION = 0.6
66
PW_PATH=~/pw/src/python/arithmetic
77
RST2HTML = rst2html
88

README

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ http://pp.com.mx/python/arithmetic
2929
Installing
3030
----------
3131

32-
To use the module or Libreta from any directory in your
32+
To use the module from any directory in your
3333
PC, cd to the source directory and type as root:
3434

3535
python setup.py install
3636

37+
To install the Vim plugin:
38+
39+
vim-plugin/install.sh
3740

3841
Contributing
3942
------------

arithmetic.py

100644100755
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def parseLine( self, i, lines, variables={}, functions={} ):
371371
variables=variables, functions=functions ) )
372372
self.writeResult( i, lines, mEqualSignAct.end(), RightActEnd, resultado )
373373
except:
374-
print 'eval error:', tipoLeft, valorLeft, tipoRight, valorRight
374+
print('eval error:', tipoLeft, valorLeft, tipoRight, valorRight)
375375
elif tipoLeft == 'n' and tipoRight in 'ifav':
376376
if valorLeft not in functions: # variable on the left
377377
if tipoRight != 'v': # assign to variable
@@ -380,7 +380,7 @@ def parseLine( self, i, lines, variables={}, functions={} ):
380380
variables=variables, functions=functions ) )
381381

382382
except:
383-
print 'exec error:', tipoLeft, valorLeft, tipoRight, valorRight
383+
print('exec error:', tipoLeft, valorLeft, tipoRight, valorRight)
384384
raise
385385
else: # evaluate a variable
386386
if valorLeft in variables:
@@ -395,7 +395,7 @@ def parseLine( self, i, lines, variables={}, functions={} ):
395395
variables=variables, functions=functions ) )
396396
self.writeResult( i, lines, mEqualSignAct.end(), RightActEnd, resultado )
397397
except:
398-
print 'eval error:', tipoLeft, valorLeft, tipoRight, valorRight
398+
print('eval error:', tipoLeft, valorLeft, tipoRight, valorRight)
399399
else: # recurrence relation
400400
if valorLeft not in variables: # initial value
401401
if valorRight != '':
@@ -548,21 +548,21 @@ def AddCommas( s ):
548548
import sys
549549
if len( sys.argv ) >= 2:
550550
if sys.argv[1] in [ '-h', '--help' ]:
551-
print __doc__
551+
print(__doc__)
552552
elif sys.argv[1] == '-f':
553553
filename = sys.argv[2]
554554
text = open( filename ).read()
555-
print feed( text )
555+
print(feed( text ))
556556
else:
557557
text = ' '.join( sys.argv[ 1: ] )
558558
if '=' in text:
559-
print feed( text )
559+
print(feed( text ))
560560
else:
561-
print evaluate( text )
561+
print(evaluate( text ))
562562
else:
563563
text = sys.stdin.read()
564564
lines = text.splitlines()
565565
if '=' in text or len(lines) > 1:
566-
print feed( text )
566+
print(feed( text ))
567567
else:
568-
print evaluate( lines[0] )
568+
print(evaluate( lines[0] ))

index.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,35 @@ arithmetic
44
*arithmetic* is a Python module that allows mixing arithmetic
55
operations and text.
66
Tk, GTK and wxWidgets based sample editors that use the module
7-
are provided as a starting point. A plugin for Zim and a patch for PyRoom
8-
editors.
7+
are provided as a starting point. A plugin for Vim, a plugin for Zim
8+
and a patch for PyRoom editors.
99
Tutorial documents are included, they will quickly show
1010
all the features of arithmetic.
1111
It is licensed under the Gnu GPL license version 2 or later.
1212

1313

14+
- Download
15+
16+
You may install the current version using pip like this::
17+
18+
pip install arithmetic
19+
20+
You can also get a tarball for manual installation from the `arithmetic
21+
page`__ in the Python Package Index.
22+
23+
.. __: https://pypi.python.org/pypi/arithmetic
24+
25+
You may install the development version by cloning the `arithmetic repository`__
26+
in GitHub with git like this::
27+
28+
git clone https://github.com/ppaez/arithmetic.git
29+
cd arithmetic
30+
python setup.py install
31+
32+
.. __: https://github.com/ppaez/arithmetic
33+
34+
Old versions are kept here just for reference:
35+
1436

1537
- Download
1638

manual.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ is not required)::
123123

124124
# python setup.py install --home=~
125125

126+
To install the Vim plugin::
127+
128+
# vim-plugin/install.sh
129+
130+
126131
Use in existing graphical applications
127132
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
128133

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import sys,os,string,time
99

10-
version = '0.5'
10+
version = '0.6'
1111

1212
kwargs = dict()
1313
if has_setuptools:
@@ -37,11 +37,14 @@
3737
operations and text. It resembles the calculator program bc.
3838
3939
Tk, GTK and wxWidgets based sample editors that use the module
40-
are provided as a starting point. A plugin for Zim and a patch for PyRoom
41-
editors.
40+
are provided as a starting point. A plugin for Vim, a plugin ford Zim,
41+
and a patch for the PyRoom editors are included.
4242
4343
Tutorial documents are included, they will quickly show
4444
all the features of arithmetic.''',
4545
classifiers=[ "Development Status :: 3 - Alpha",
46-
"Topic :: Text Processing" ],
46+
"Topic :: Text Processing",
47+
"Programming Language :: Python :: 2",
48+
"Programming Language :: Python :: 3"
49+
],
4750
)

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[tox]
2+
envlist = py27,py34,py35,py36
3+
[testenv]
4+
deps=mock
5+
coverage
6+
commands=coverage run -m unittest tests
7+
coverage report -m arithmetic.py

0 commit comments

Comments
 (0)