From 245d9c8989e304a637840d6bcbd87d8905a96101 Mon Sep 17 00:00:00 2001 From: Victor Leikehman Date: Fri, 25 May 2018 06:01:47 +0300 Subject: [PATCH] py3 --- smop/backend.py | 6 ++++-- smop/lexer.py | 2 +- smop/main.py | 5 ++--- smop/node.py | 5 +++-- smop/options.py | 4 +++- smop/parse.py | 12 ++++++------ smop/resolve.py | 5 ++--- smop/version.py | 2 +- 8 files changed, 22 insertions(+), 19 deletions(-) diff --git a/smop/backend.py b/smop/backend.py index 23005b15..e9c2aac8 100644 --- a/smop/backend.py +++ b/smop/backend.py @@ -12,8 +12,10 @@ import logging logger = logging.getLogger(__name__) -import node,options -from node import extend,exceptions + +from . import node +from . import options +from . node import extend,exceptions indent = " "*4 diff --git a/smop/lexer.py b/smop/lexer.py index 1b863d9d..527d3649 100644 --- a/smop/lexer.py +++ b/smop/lexer.py @@ -5,7 +5,7 @@ import re import ply.lex as lex from ply.lex import TOKEN -import options +from . import options tokens = [ diff --git a/smop/main.py b/smop/main.py index c0ba35f8..9caac87a 100644 --- a/smop/main.py +++ b/smop/main.py @@ -16,14 +16,13 @@ from . import parse from . import resolve from . import backend -from version import __version__ - +from . import version def print_header(fp): if options.no_header: return print("# Running Python %s" % sys.version, file=fp) - print("# Generated with SMOP ", __version__, file=fp) + print("# Generated with SMOP ", version.__version__, file=fp) print("from libsmop import *", file=fp) print("#", options.filename, file=fp) diff --git a/smop/node.py b/smop/node.py index 05998f14..9f27a283 100644 --- a/smop/node.py +++ b/smop/node.py @@ -3,9 +3,10 @@ from __future__ import print_function from collections import namedtuple -from recipes import recordtype import copy,sys,inspect -import options + +from . recipes import recordtype +from . import options # def preorder(u): # if isinstance(u,traversable): diff --git a/smop/options.py b/smop/options.py index f3d30ef2..35f083f0 100644 --- a/smop/options.py +++ b/smop/options.py @@ -1,7 +1,9 @@ import sys import argparse,textwrap from textwrap import dedent -from version import __version__ + +from . import version +from . version import __version__ parser = argparse.ArgumentParser( "smop", diff --git a/smop/parse.py b/smop/parse.py index a6fb7ecc..289a7487 100644 --- a/smop/parse.py +++ b/smop/parse.py @@ -1,12 +1,12 @@ # SMOP compiler -- Simple Matlab/Octave to Python compiler # Copyright 2011-2016 Victor Leikehman -import ply.yacc as yacc -import lexer -from lexer import tokens, raise_exception -import node -from node import exceptions -import options +from ply import yacc +from . import lexer +from . lexer import tokens, raise_exception +from . import node +from . node import exceptions +from . import options # ident properties (set in parse.py) # ---------------------------------- diff --git a/smop/resolve.py b/smop/resolve.py index a613e713..02cdd5f9 100644 --- a/smop/resolve.py +++ b/smop/resolve.py @@ -20,9 +20,8 @@ import copy -import node -from node import extend -import networkx as nx +from . import node +from . node import extend def graphviz(t, fp, func_name): diff --git a/smop/version.py b/smop/version.py index 0f8ab1d4..1c6d303a 100644 --- a/smop/version.py +++ b/smop/version.py @@ -1 +1 @@ -__version__='0.39.1' +__version__='0.39.1-3-gaac946d' \ No newline at end of file