Anonymous avatar Anonymous committed 7cb7dac

Restructuring packages

Comments (0)

Files changed (19)

ropetest/codeanalyzetest.py

 import unittest
 
 from ropetest import testutils
-from rope.codeanalyze import (StatementRangeFinder, ArrayLinesAdapter,
+from rope.base.codeanalyze import (StatementRangeFinder, ArrayLinesAdapter,
                               SourceLinesAdapter, WordRangeFinder,
                               ScopeNameFinder, LogicalLineFinder)
-from rope.project import Project
+from rope.base.project import Project
 
 
 class StatementRangeFinderTest(unittest.TestCase):

ropetest/codeassisttest.py

 import os
 import unittest
 
-from rope.codeassist import PythonCodeAssist, RopeSyntaxError, Template, ProposalSorter
-from rope.project import Project
+from rope.ide.codeassist import PythonCodeAssist, RopeSyntaxError, Template, ProposalSorter
+from rope.base.project import Project
 from ropetest import testutils
 
 

ropetest/formattertest.py

 import unittest
 
-from rope.formatter import Formatter
+from rope.ide.formatter import Formatter
 
 
 class FormatterTest(unittest.TestCase):

ropetest/importutilstest.py

 import unittest
 
-from rope.project import Project
+from rope.base.project import Project
 from ropetest import testutils
-from rope.importutils import ImportTools
+from rope.refactor.importutils import ImportTools
 
 
 class ImportUtilsTest(unittest.TestCase):

ropetest/objectinfertest.py

 import unittest
 
-from rope.project import Project
+from rope.base.project import Project
 from ropetest import testutils
 
 class ObjectInferTest(unittest.TestCase):

ropetest/outlinetest.py

 import os
 import unittest
 
-from rope.outline import PythonOutline
-from rope.project import Project
+from rope.ide.outline import PythonOutline
+from rope.base.project import Project
 from ropetest import testutils
 
 class OutlineTest(unittest.TestCase):

ropetest/projecttest.py

 import unittest
 import os
 
-from rope.project import Project, RootFolder
-from rope.exceptions import RopeException
+from rope.base.project import Project, RootFolder
+from rope.base.exceptions import RopeException
 from ropetest import testutils
 
 

ropetest/pycoretest.py

 import os
 import unittest
 
-from rope.pycore import PyObject, ModuleNotFoundException
-from rope.project import Project
+from rope.base.pycore import PyObject, ModuleNotFoundException
+from rope.base.project import Project
 from ropetest import testutils
 
 
         self.assertEquals((init_module, 1), pkg_pyname.get_definition_location())
     
     def test_out_of_project_modules(self):
-        scope = self.pycore.get_string_scope('import rope.outline as outline\n')
-        imported_module = scope.get_name('outline').get_object()
-        self.assertTrue('Outline' in imported_module.get_attributes())
+        scope = self.pycore.get_string_scope('import rope.base.project as project\n')
+        imported_module = scope.get_name('project').get_object()
+        self.assertTrue('Project' in imported_module.get_attributes())
 
 
 class PyCoreInProjectsTest(unittest.TestCase):

ropetest/pyscopestest.py

 import unittest
 
-from rope.pycore import PyObject
-from rope.project import Project
+from rope.base.pycore import PyObject
+from rope.base.project import Project
 from ropetest import testutils
 
 

ropetest/refactor/__init__.py

 import unittest
 
-import rope.codeanalyze
+import rope.base.codeanalyze
 import rope.refactor.rename
 from rope.refactor import Undo
-from rope.exceptions import RefactoringException
-from rope.project import Project
+from rope.base.exceptions import RefactoringException
+from rope.base.project import Project
 from rope.refactor.change import *
 from ropetest import testutils
 import ropetest.refactor.renametest
                                            'create', global_factory=True)
         self.assertEquals(expected, mod.read())
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_raising_exception_for_global_factory_for_nested_classes(self):
         code = 'def create_var():\n'\
                '    class AClass(object):\n'\

ropetest/refactor/extracttest.py

 import unittest
-import rope.codeanalyze
+import rope.base.codeanalyze
 import rope.refactor.rename
-import rope.exceptions
-import rope.project
+import rope.base.exceptions
+import rope.base.project
 
 import ropetest.testutils as testutils
 
         super(ExtractMethodTest, self).setUp()
         self.project_root = 'sample_project'
         testutils.remove_recursively(self.project_root)
-        self.project = rope.project.Project(self.project_root)
+        self.project = rope.base.project.Project(self.project_root)
         self.pycore = self.project.get_pycore()
         self.refactoring = self.project.get_pycore().get_refactoring()
 
         return testmod.read()
 
     def _convert_line_range_to_offset(self, code, start, end):
-        lines = rope.codeanalyze.SourceLinesAdapter(code)
+        lines = rope.base.codeanalyze.SourceLinesAdapter(code)
         return lines.get_line_start(start), lines.get_line_end(end)
     
     def test_simple_extract_function(self):
                    "    return inner_func\n"
         self.assertEquals(expected, refactored)
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_extract_method_bad_range(self):
         code = "def a_func():\n    pass\na_var = 10\n"
         start, end = self._convert_line_range_to_offset(code, 2, 3)
         self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_extract_method_bad_range2(self):
         code = "class AClass(object):\n    pass\n"
         start, end = self._convert_line_range_to_offset(code, 1, 1)
         self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_extract_method_containing_return(self):
         code = "def a_func(arg):\n    return arg * 2\n"
         start, end = self._convert_line_range_to_offset(code, 2, 2)
         self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_extract_method_containing_yield(self):
         code = "def a_func(arg):\n    yield arg * 2\n"
         start, end = self._convert_line_range_to_offset(code, 2, 2)
         self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_extract_method_containing_uncomplete_lines(self):
         code = 'a_var = 20\nanother_var = 30\n'
         start = code.index('20')
         end = code.index('30') + 2
         self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_extract_method_containing_uncomplete_lines2(self):
         code = 'a_var = 20\nanother_var = 30\n'
         start = code.index('20')
         expected = 'if True:\n    b = 1 + 2\n    a = (3 + \nb)\n'
         self.assertEquals(expected, refactored)
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_raising_exception_when_on_incomplete_variables(self):
         code = 'a_var = 10 + 20\n'
         start = code.index('10') + 1
         end = code.index('20') + 2
         refactored = self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_raising_exception_when_on_incomplete_variables_on_end(self):
         code = 'a_var = 10 + 20\n'
         start = code.index('10')
         end = code.index('20') + 1
         refactored = self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_raising_exception_on_bad_parens(self):
         code = 'a_var = (10 + 20) + 30\n'
         start = code.index('20')
         end = code.index('30') + 2
         refactored = self.do_extract_method(code, start, end, 'new_func')
 
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_raising_exception_on_bad_operators(self):
         code = 'a_var = 10 + 20 + 30\n'
         start = code.index('10')
         refactored = self.do_extract_method(code, start, end, 'new_func')
 
     # FIXME: Extract method should be more intelligent about bad ranges
-    @testutils.assert_raises(rope.exceptions.RefactoringException)
+    @testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def xxx_test_raising_exception_on_function_parens(self):
         code = 'a = range(10)'
         start = code.index('(')

ropetest/refactor/inlinetest.py

 import unittest
-import rope.exceptions
-import rope.project
+import rope.base.exceptions
+import rope.base.project
 import ropetest
 
 
         super(InlineLocalVariableTest, self).setUp()
         self.project_root = 'sample_project'
         ropetest.testutils.remove_recursively(self.project_root)
-        self.project = rope.project.Project(self.project_root)
+        self.project = rope.base.project.Project(self.project_root)
         self.pycore = self.project.get_pycore()
         self.refactoring = self.project.get_pycore().get_refactoring()
         self.mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
         refactored = self._inline_local_variable(code, code.index('a') + 1)
         self.assertEquals('b = 1', refactored)
 
-    @ropetest.testutils.assert_raises(rope.exceptions.RefactoringException)
+    @ropetest.testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_on_classes(self):
         code = 'def AClass(object):\n    pass\n'
         refactored = self._inline_local_variable(code, code.index('AClass') + 1)
 
-    @ropetest.testutils.assert_raises(rope.exceptions.RefactoringException)
+    @ropetest.testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_multiple_assignments(self):
         code = 'a_var = 10\na_var = 20\n'
         refactored = self._inline_local_variable(code, code.index('a_var') + 1)
 
-    @ropetest.testutils.assert_raises(rope.exceptions.RefactoringException)
+    @ropetest.testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_on_parameters(self):
         code = 'def a_func(a_param):\n    pass\n'
         refactored = self._inline_local_variable(code, code.index('a_param') + 1)
 
-    @ropetest.testutils.assert_raises(rope.exceptions.RefactoringException)
+    @ropetest.testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_tuple_assignments(self):
         code = 'a_var, another_var = (20, 30)\n'
         refactored = self._inline_local_variable(code, code.index('a_var') + 1)

ropetest/refactor/movetest.py

 import unittest
-import rope.exceptions
-import rope.project
+import rope.base.exceptions
+import rope.base.project
 import ropetest
 
 
         super(MoveRefactoringTest, self).setUp()
         self.project_root = 'sampleproject'
         ropetest.testutils.remove_recursively(self.project_root)
-        self.project = rope.project.Project(self.project_root)
+        self.project = rope.base.project.Project(self.project_root)
         self.pycore = self.project.get_pycore()
         self.refactoring = self.project.get_pycore().get_refactoring()
         self.mod1 = self.pycore.create_module(self.project.get_root_folder(), 'mod1')
         self.assertEquals('class AClass(object):\n    pass\na_var = AClass()\n',
                           self.mod2.read())
 
-    @ropetest.testutils.assert_raises(rope.exceptions.RefactoringException)
+    @ropetest.testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_folder_destination(self):
         folder = self.project.get_root_folder().create_folder('folder')
         self.mod1.write('class AClass(object):\n    pass\n')
         self.refactoring.move(self.mod1, self.mod1.read().index('AClass') + 1, folder)
     
-    @ropetest.testutils.assert_raises(rope.exceptions.RefactoringException)
+    @ropetest.testutils.assert_raises(rope.base.exceptions.RefactoringException)
     def test_raising_exception_for_moving_non_global_elements(self):
         self.mod1.write('def a_func():\n    class AClass(object):\n        pass\n')
         self.refactoring.move(self.mod1, self.mod1.read().index('AClass') + 1,

ropetest/refactor/renametest.py

 import unittest
-import rope.codeanalyze
+import rope.base.codeanalyze
 import rope.refactor.rename
-import rope.project
+import rope.base.project
 import ropetest
 
 
         super(RenameRefactoringTest, self).setUp()
         self.project_root = 'sample_project'
         ropetest.testutils.remove_recursively(self.project_root)
-        self.project = rope.project.Project(self.project_root)
+        self.project = rope.base.project.Project(self.project_root)
         self.pycore = self.project.get_pycore()
         self.refactoring = self.project.get_pycore().get_refactoring()
 

ropetest/runmodtest.py

 import os
 import unittest
 
-from rope.project import Project
+from rope.base.project import Project
 from ropetest import testutils
 
 class PythonFileRunnerTest(unittest.TestCase):

ropetest/ui/editortest.py

 from ropetest.ui.mockeditortest import GraphicalEditorFactory, MockEditorFactory
 from rope.ui.indenter import PythonCodeIndenter
 from rope.ui.editor import _TextChangeInspector
-from rope.codeassist import CodeAssist
+from rope.ide.codeassist import CodeAssist
 
 
 class GraphicalEditorTest(unittest.TestCase):

ropetest/ui/fileactionstest.py

 import unittest
 
-from rope.pycore import PyObject
-from rope.project import Project
+from rope.base.pycore import PyObject
+from rope.base.project import Project
 from ropetest import testutils
 from rope.ui.fileactions import FileFinder
 

ropetest/ui/fileeditortest.py

 import unittest
 import Tkinter
 
-from rope.project import Project
+from rope.base.project import Project
 from rope.ui.editor import *
 from rope.ui.fileeditor import *
 from ropetest.projecttest import SampleProjectMaker
       author='Ali Gholami Rudi',
       author_email='aligrudi@users.sourceforge.net',
       url='http://rope.sf.net/',
-      packages=['rope', 'rope.ui', 'rope.refactor'],
+      packages=['rope', 'rope.base', 'rope.refactor', 'rope.ide', 'rope.ui'],
       scripts=['scripts/rope'])
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.