changeset 160:8e7d7e891b00

refactor: organized imports
author Sigurd Meldgaard <stm@daimi.au.dk>
date Mon, 07 Dec 2009 15:30:38 +0100
parents 4aba2a1b340e
children 78523235f367
files pysmcl/__init__.py pysmcl/bad_calls.py pysmcl/compatibility_check.py pysmcl/editor_info.py pysmcl/flow.py pysmcl/graph.py pysmcl/ideal_functionality.py pysmcl/pretty_print.py pysmcl/proof_burden.py pysmcl/range_analysis.py pysmcl/secret_annotator.py pysmcl/secret_ifs.py pysmcl/simpl_print.py pysmcl/util.py
diffstat 14 files changed, 21 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/__init__.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/__init__.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,4 +1,1 @@
 # -*- coding: utf-8
-#
-# Author: Janus Dam Nielsen
-#
--- a/pysmcl/bad_calls.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/bad_calls.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,5 +1,5 @@
+import pysmcl.ast_wrapper as ast
 import util
-import pysmcl.ast_wrapper as ast
 from secret_annotator import expr_secret, non_compromising_functions
 
 
--- a/pysmcl/compatibility_check.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/compatibility_check.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,7 +1,6 @@
 import pysmcl.ast_wrapper as ast
+from pysmcl.util import error
 
-# Import PySMCL packages.
-from pysmcl.util import error
 
 """
 We only want to treat a small subset of Python in our
--- a/pysmcl/editor_info.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/editor_info.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,10 +1,10 @@
+import sys
+
 import pysmcl.ast_wrapper as ast
-import sys
-from pysmcl.flow import Flow
-from pysmcl.graph import Graph
+from pysmcl.pretty_print import expr_string
+from pysmcl.range_analysis import RangeAnalysis
 from pysmcl.secret_annotator import secret_analysis, expr_secret
-from pysmcl.pretty_print import  expr_string, pprint
-from pysmcl.range_analysis import RangeAnalysis
+
 
 def main():
     try:
--- a/pysmcl/flow.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/flow.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,11 +1,10 @@
-import pysmcl.ast_wrapper as ast
 import StringIO
 from copy import copy
 
-# Import PySMCL packages.
-from pysmcl.pretty_print import PrettyPrinter, pprint
+import pysmcl.ast_wrapper as ast
+from pysmcl.graph import Node
+from pysmcl.pretty_print import PrettyPrinter
 
-from pysmcl.graph import Node
 
 def analyze(function, join, combine, key, init, distribute=None):
     """
--- a/pysmcl/graph.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/graph.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,6 +1,7 @@
 import StringIO
 import sys
 
+
 class Node:
     count = 0
 
--- a/pysmcl/ideal_functionality.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/ideal_functionality.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,15 +1,13 @@
 import inspect
+
 import pysmcl.ast_wrapper as ast
-from collections import defaultdict
-
-# Import PySMCL packages.
+import pysmcl.compatibility_check
 import pysmcl.pretty_print
 import pysmcl.secret_annotator
 import pysmcl.secret_ifs
-import pysmcl.compatibility_check
-import pysmcl.proof_burden
 from pysmcl.bad_calls import bad_calls
 
+
 def ideal_functionality(args):
     def ideal_functionality_helper(f):
         print "ideal"
--- a/pysmcl/pretty_print.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/pretty_print.py	Mon Dec 07 15:30:38 2009 +0100
@@ -4,10 +4,10 @@
 The goal is to print a program with the exact same semantics as the
 program parsed into the ast.
 """
+import StringIO
+import sys
 
-import StringIO
 import pysmcl.ast_wrapper as ast
-import sys
 
 
 def arguments_string(arguments):
--- a/pysmcl/proof_burden.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/proof_burden.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,7 +1,4 @@
 import pysmcl.ast_wrapper as ast
-import inspect
-
-# Import PySMCL packages.
 import pysmcl.pretty_print
 
 
--- a/pysmcl/range_analysis.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/range_analysis.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,8 +1,3 @@
-#
-#
-#
-#
-
 """ This module implements a range analysis of expressions in the
 core PySMCL language.
 
@@ -10,12 +5,9 @@
 range in a given function. A range is represented as a tuple of two
 numbers or the bottom element.
 """
+import pysmcl.ast_wrapper as ast
+from pysmcl import flow
 
-# Import system packages.
-import pysmcl.ast_wrapper as ast
-
-# Import PySMCL packages.
-from pysmcl import flow
 
 # Switch to True for debug output printed to std. out.
 debug = False
--- a/pysmcl/secret_annotator.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/secret_annotator.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,8 +1,4 @@
-import util
 import pysmcl.ast_wrapper as ast
-import pretty_print
-
-# Import PySMCL packages.
 import pysmcl.flow
 
 non_compromising_functions = set(["len", "open", "result",
--- a/pysmcl/secret_ifs.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/secret_ifs.py	Mon Dec 07 15:30:38 2009 +0100
@@ -3,13 +3,12 @@
 secret values, and transforming them into equivalent series of
 assignments
 """
-
 import copy
 
-# Import PySMCL packages.
 import pysmcl.ast_wrapper as ast
+import pysmcl.secret_annotator
 from pysmcl.util import error
-import pysmcl.secret_annotator
+
 
 class Assignments(ast.NodeVisitor):
 
--- a/pysmcl/simpl_print.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/simpl_print.py	Mon Dec 07 15:30:38 2009 +0100
@@ -5,9 +5,9 @@
 The goal is to print a program with the exact same semantics as the
 program parsed into the ast.
 """
+import sys
 
 import pysmcl.ast_wrapper as ast
-import sys
 
 
 def arguments_string(arguments):
--- a/pysmcl/util.py	Mon Dec 07 14:20:56 2009 +0100
+++ b/pysmcl/util.py	Mon Dec 07 15:30:38 2009 +0100
@@ -1,6 +1,5 @@
 """ Utilities for the static analysis tool
 """
-
 def error(msg, loc=None):
     """Print the error message.
     *loc* is an ast-node at the given location."""