Skip to content

Commit

Permalink
Dropping python2 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
iogf committed Apr 3, 2020
1 parent 0cfb597 commit b3f8027
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ when compared to latex.
Install
=======

pip2 install lax
Works on python3+ only

pip install lax

That is all.

Expand Down
14 changes: 7 additions & 7 deletions escs.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
##############################################################################
# clone lax repository.
# Clone lax repository.

cd ~/projects
git clone git@github.com:iogf/lax.git lax-code

# push lax.
# Push lax.
cd ~/projects/lax-code
git status
git add *
git commit -a
git push

# it installs lax.
##############################################################################
# Install lax.
cd ~/projects/lax-code
sudo bash -i
python2 setup.py install
python setup.py install
rm -fr build
exit
##############################################################################
# create, development, branch, lax.
# Create, development, branch, lax.
cd /home/tau/projects/lax-code/
git branch -a
git checkout -b development
git push --set-upstream origin development
##############################################################################
# merge development into master.
# Merge development into master.
cd /home/tau/projects/lax-code/
git checkout master
git merge development
Expand Down
2 changes: 1 addition & 1 deletion lax
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if __name__ == '__main__':
parser.add_option("-c", "--code", action='store', dest="code", help="Example: lax - c 'x ** 2 - 1'")
(opt, args) = parser.parse_args()

print run(opt.code)
print(run(opt.code))



Expand Down
10 changes: 5 additions & 5 deletions liblax/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FMT0 = lambda data: data
FMT1 = lambda data: '\\left(%s\\right)' % data

class Function(object):
class Function:
def __call__(self, exp):
return Block(self, exp)

Expand All @@ -14,7 +14,7 @@ def __init__(self, name, exp):
def __str__(self, op=None):
return '%s\\left(%s\\right)' % (self.name, self.exp.__str__(self))

class Chk(object):
class Chk:
def __call__(self, exp):
return Function(self, exp)

Expand Down Expand Up @@ -42,10 +42,10 @@ def __mul__(self, other):
def __rmul__(self, other):
return Mul(other, self)

def __div__(self, other):
def __truediv__(self, other):
return Div(self, other)

def __rdiv__(self, other):
def __rtruediv__(self, other):
return Div(other, self)

def __pow__(self, other):
Expand All @@ -64,7 +64,7 @@ class Num(Chk):
def __init__(self, val):
Chk.__init__(self, val)

class Block(object):
class Block:
def __call__(self, exp):
return Block(self, exp)

Expand Down
2 changes: 1 addition & 1 deletion liblax/parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from tokenize import generate_tokens as split
from tokenize import NUMBER, NAME, STRING, OP, untokenize
from StringIO import StringIO
from io import StringIO
from liblax.core import *

def build(data):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from distutils.core import setup

setup(name="lax",
version="0.3",
version="1.0.0",
packages=["liblax"],
scripts=['lax'],
author="Iury O. G. Figueiredo",
Expand Down

0 comments on commit b3f8027

Please sign in to comment.