Commits

Ali Gholami Rudi  committed 5416e09

Handling long imports

  • Participants
  • Parent commits 95ba65d

Comments (0)

Files changed (45)

 
 Features added in this release:
 
-*
+* Builtin functions: super, sorted, reversed, range, open
+* Sorting imports according to :PEP:`8` in organize imports
+* Support for builtin file type
+* Enhanced dynamic object inference
+* Handling long imports
+
+Organize imports now sorts imports two.  It will sort imports according
+to :PEP:`8`::
+
+  [standard imports]
+
+  [third-party imports]
+
+  [project imports]
+
+
+  [the rest of module]
+
+Dynamic object inference has been enhanced to two infer the returned
+objects of functions based on their parameters.
+
+"Handle long imports" command trys to make long imports look better
+by transforming ``import pkg1.pkg2.pkg3.pkg4.mod1`` to
+``from pkg1.pkg2.pkg3.pkg4 import mod1``.  Long imports can be
+identified either by having lots of dots or being very long.  The
+default configuration considers imports with more than 2 dots or
+with length more than 27 characters to be long.
 
 
 Getting Started

File docs/dev/contributing.txt

 * Use four spaces for indentation.
 * Include good unit-tests if possible.
 * Rope test suite should pass after patching (``python runtests.py``).
-

File docs/dev/done.txt

 ===========
 
 
-- Builtin functions: super, sorted, reversed, range : January 7, 2007
+- Handling long imports : January 11, 2007
+
+
+- Builtin functions : super, sorted, reversed, range : January 7, 2007
 
 
 - Support for file/open builtin type : January 7, 2007

File docs/dev/issues.txt

 * Enhancing refactorings and testing
 * Handling built-in types
 
-Exploring and analyzing possible solutions for:
-
-* Implicit interfaces
-
 
 Status
 ------
 * `Rope's preference system`_
 * `Having virtual PyModules`_
 * Indexing source files for faster occurrence finding
+* Faster module running
 * Saving hard to compute information like class hierarchies to files
 * Using a modification of `compiler` AST for simplifying refactorings
 * Undo unification
 
 
+Handling builtin `property`
+===========================
+
+Problems:
+
+* Class scopes does not reference class methods
+* Properties are overwritten in assignments
+
+We can add a new `Property` builtin type and when exploring attributes
+of a class we prevent `PyNames` with `Property` objects from being
+overwritten.  But the problem here is that we don't want the
+`PyObject`\s of `PyName`\s to be calculated for all attributes of a
+class.
+
+
 Local History
 =============
 
 
 * Unanticipated changes
 * Having version control systems in parallel
+* Saving removed files and folders
+* Memory inefficiency
+
+Each project change consists of a few basic changes.
+
+* change file contents
+* move resource
+* create file
+* create folder
+* remove resource
 
 
 Removing `PythonRefactoring` Facade
 * Documenting the refactorings `rope.refactor` submodules provide
 * Updating references to `PythonRefactoring` and
   `PyCore.get_refactoring` to use the new objects.
+* Managing `importutils` actions
 
 
 Rope's Preference System
 * Version control; C-x v ...
 * Refactorings; C-c r ...
 
-  * C-x r r: rename
-  * C-x r m: extract method
-  * C-x r i: inline
-  * C-x r l: extract local
-  * C-x r c: change signature
+  * C-c r r: rename
+  * C-c r m: extract method
+  * C-c r i: inline
+  * C-c r l: extract local
+  * C-c r c: change signature
 
 * Import actions; C-c i ...
+
+  * C-c i o: organize
+  * C-c i x: expand stars
+  * C-c i a: relatives to absolutes
+  * C-c i f: froms to imports
+  * C-c i s: sort
+
 * Help; C-h ...

File docs/dev/stories.txt

 * Saving preferences
 
 
-> Public Release 0.4m5 : January 14, 2007
-
-
 * Commanding buffer
 
 
-* Transforming to ``from w.x.y import z`` for long imports
+> Public Release 0.4m5 : January 14, 2007

File docs/dev/workingon.txt

-Supporting More Builtins
-========================
+Handling Long Imports
+=====================
 
-- `open`, `file`
-- `range` builtin function
-- `reversed` and `sorted` builtin function
-- `super` builtin function
+- Transforming to ``from w.x.y import z`` for long imports
+- Shortening based on the number of dots or its length
+- Adding to UI
+- Not making any changes when there are actually no changes
 
 
-Local History
+Small Stories
 =============
 
-* Adding `rope.base.history` module
+- `Project.get_root_folder()` -> `Project.root`
+- `Project.get_root_address()` -> `Project.address`
+- Reorganize projecttest
+- Adding sorting imports to organize imports
 
 
 Remaining Stories
 =================
 
-* Adding sorting imports to organize imports?
+* Showing properties in quick outline
+* Default maxlength and maxdots for handling long imports
 * Comments should be indented
 * Caching calculated parameters and returned object in `PyFunction`\s
 * Handling the return type of generator functions
 * Better `ropetest` package structure
 * Decide when to use `difflib` in `Editor.set_text`
 * Handling `AssList` for inline variable and encapsulate field
-
 * Considering logical lines in `rope.codeanalyze`
 * Reporting unhandled exceptions as error dialogs in the GUI
 * Better move dialog; complete modules names; use `editor._CompletionListHandle`
 * Extract method and return statements
 * Import addition when adding a relative with an absolute import
 * Caching `PyCore.classes`
-* Handling `Scope.lookup` for ::
+* Handling `ClassScope.lookup` for ::
 
-    class A(object):
+    class C(object):
         a_var = 10
         another_var = a_var
 

File docs/index.txt

     * Change relative imports to absolute
     * Change from imports to normal imports
     * Expand ``from ... import *`` imports
-    * Remove unused, duplicate and self imports (organize imports)
+    * Remove unused and duplicate imports and sort them (organize imports)
 
 * Object Inference
 

File rope/base/oi/dynamicoi.py

                 return i + 1
 
     def _get_pymodule(self, path):
-        root = os.path.abspath(self.project.get_root_address())
+        root = os.path.abspath(self.project.address)
         if path.startswith(root):
             relative_path = path[len(root):]
             if relative_path.startswith('/') or relative_path.startswith(os.sep):
         if os.path.isabs(resource_path):
             return resource_path
         return os.path.abspath(
-            os.path.normpath(os.path.join(self.project.get_root_address(),
+            os.path.normpath(os.path.join(self.project.address,
                                           resource_path)))
 
 
         if self.receiver:
             send_info = self.receiver.get_send_info()
         args = [sys.executable, runmod_path, send_info,
-                os.path.abspath(self.pycore.project.get_root_address()),
+                os.path.abspath(self.pycore.project.address),
                 os.path.abspath(self.file._get_real_path())]
         if self.args is not None:
             args.extend(self.args)

File rope/base/oi/objectinfer.py

-from rope.base.pyobjects import *
-import rope.base.codeanalyze
-import rope.base.oi.staticoi
+from rope.base.oi import dynamicoi, staticoi
 
 
 class ObjectInfer(object):
 
     def __init__(self, pycore):
-        self.ois = [rope.base.oi.staticoi.StaticObjectInference(),
-                    rope.base.oi.dynamicoi.DynamicObjectInference(pycore)]
+        self.ois = [staticoi.StaticObjectInference(),
+                    dynamicoi.DynamicObjectInference(pycore)]
 
     def infer_assigned_object(self, pyname):
         """Infer the `PyObject` this `PyName` references"""

File rope/base/project.py

 import os
 import re
 
+import rope.base.fscommands
 import rope.base.pycore
-import rope.base.fscommands
 from rope.base.exceptions import RopeException
 
 
               have a look at `rope.base.fscommands`
 
         """
-        self.root = os.path.expanduser(project_root)
-        if not os.path.exists(self.root):
-            os.mkdir(self.root)
-        elif not os.path.isdir(self.root):
+        self._address = os.path.expanduser(project_root)
+        if not os.path.exists(self._address):
+            os.mkdir(self._address)
+        elif not os.path.isdir(self._address):
             raise RopeException('Project root exists and is not a directory')
         if fscommands is None:
-            fscommands = rope.base.fscommands.create_fscommands(self.root)
+            fscommands = rope.base.fscommands.create_fscommands(self._address)
         super(Project, self).__init__(fscommands)
         self.pycore = rope.base.pycore.PyCore(self)
         self.no_project = NoProject()
 
-    def get_root_folder(self):
-        return self.get_resource('')
+    root = property(lambda self: self.get_resource(''))
 
-    def get_root_address(self):
-        return self.root
+    address = property(lambda self: self._address)
 
     def get_files(self):
-        return self._get_files_recursively(self.get_root_folder())
+        return self._get_files_recursively(self.root)
 
     def _get_resource_path(self, name):
-        return os.path.join(self.root, *name.split('/'))
+        return os.path.join(self._address, *name.split('/'))
 
     def _get_files_recursively(self, folder):
         result = []
         for file in folder.get_files():
-            if not file.get_name().endswith('.pyc'):
-                result.append(file)
+            result.append(file)
         for folder in folder.get_folders():
             if not folder.get_name().startswith('.'):
                 result.extend(self._get_files_recursively(folder))

File rope/base/pycore.py

 import re
 import sys
 
+import rope.base.oi.dynamicoi
+import rope.base.oi.objectinfer
 import rope.base.project
-import rope.base.oi.objectinfer
 import rope.refactor
-import rope.base.oi.dynamicoi
 from rope.base.exceptions import ModuleNotFoundException
 from rope.base.pyobjects import *
 
 
     def get_source_folders(self):
         """Returns project source folders"""
-        return self._find_source_folders(self.project.get_root_folder())
+        return self._find_source_folders(self.project.root)
 
     def resource_to_pyobject(self, resource):
         if resource in self.module_map:

File rope/base/pynames.py

 import rope.base.pyobjects
-from rope.base.exceptions import (ModuleNotFoundException, AttributeNotFoundException)
+from rope.base.exceptions import (ModuleNotFoundException,
+                                  AttributeNotFoundException)
 
 
 class PyName(object):

File rope/base/pyobjects.py

 import compiler
 
+import rope.base.evaluate
 import rope.base.pyscopes
-from rope.base.exceptions import (RopeException, AttributeNotFoundException)
+from rope.base import pynames
+from rope.base.exceptions import RopeException, AttributeNotFoundException
 from rope.base.pynames import *
-from rope.base import pynames
-import rope.base.evaluate
 
 
 class PyObject(object):

File rope/base/pyscopes.py

 import compiler
 
-import rope.base.exceptions
 import rope.base.pynames
 import rope.base.pyobjects
+from rope.base import exceptions
 
 
 class Scope(object):
     def get_name(self, name):
         """Return name `PyName` defined in this scope"""
         if name not in self.get_names():
-            raise rope.base.exceptions.NameNotFoundException('name %s not found' % name)
+            raise exceptions.NameNotFoundException('name %s not found' % name)
         return self.get_names()[name]
 
     def get_scopes(self):
     def get_name(self, name):
         try:
             return self.pyobject.get_attribute(name)
-        except rope.base.exceptions.AttributeNotFoundException:
+        except exceptions.AttributeNotFoundException:
             if name in self.builtin_names:
                 return self.builtin_names[name]
-            raise rope.base.exceptions.NameNotFoundException('name %s not found' % name)
+            raise exceptions.NameNotFoundException('name %s not found' % name)
 
     def get_names(self):
         if self.names.get() is None:
     def _get_builtin_names(self):
         return rope.base.builtins.builtins
 
-    _builtin_names = None
     builtin_names = property(_get_builtin_names)
 
 
     def _visit_function(self):
         if self.names == None:
             new_visitor = rope.base.pyobjects._FunctionVisitor(self.pycore,
-                                                          self.pyobject)
+                                                               self.pyobject)
             for n in self.pyobject._get_ast().getChildNodes():
                 compiler.walk(n, new_visitor)
             self.names = self.pyobject.get_parameters()
         return self._get_names()
 
     def _create_scopes(self):
-        block_objects = [pyname.get_object() for pyname in self._get_names().values()
+        block_objects = [pyname.get_object()
+                         for pyname in self._get_names().values()
                          if isinstance(pyname, rope.base.pynames.DefinedName)]
         def block_compare(x, y):
             return cmp(x._get_ast().lineno, y._get_ast().lineno)
               (current_scope.get_kind() == 'Module' or
                self._get_scope_indents(current_scope) <= line_indents):
             scopes.append(current_scope)
-            if current_scope.get_start() == lineno and current_scope.get_kind() != 'Module':
+            if current_scope.get_start() == lineno and \
+               current_scope.get_kind() != 'Module':
                 return current_scope
             new_scope = None
             for scope in current_scope.get_scopes():

File rope/refactor/__init__.py

 refactorings.
 
 """
-import rope.refactor.importutils.module_imports
+import rope.refactor.importutils
 from rope.refactor.change import (ChangeSet, ChangeContents,
                                   MoveResource, CreateFolder)
-from rope.refactor.rename import RenameRefactoring
+from rope.refactor.encapsulate_field import EncapsulateFieldRefactoring
 from rope.refactor.extract import (ExtractMethodRefactoring,
                                    ExtractVariableRefactoring)
+from rope.refactor.importutils import module_imports
+from rope.refactor.inline import InlineRefactoring
 from rope.refactor.introduce_factory import IntroduceFactoryRefactoring
+from rope.refactor.localtofield import ConvertLocalToFieldRefactoring
 from rope.refactor.move import MoveRefactoring
-from rope.refactor.inline import InlineRefactoring
-from rope.refactor.encapsulate_field import EncapsulateFieldRefactoring
-from rope.refactor.localtofield import ConvertLocalToFieldRefactoring
+from rope.refactor.rename import RenameRefactoring
 
 
 class PythonRefactoring(object):
         result = module_with_imports.get_changed_source()
         return result
 
-    def organize_imports(self, resource):
-        source = resource.read()
-        pymodule = self.pycore.get_string_module(source, resource)
-        module_with_imports = self.import_tools.get_module_with_imports(pymodule)
-        module_with_imports.remove_unused_imports()
-        module_with_imports.remove_duplicates()
-        source = module_with_imports.get_changed_source()
-        if source is not None:
-            changes = ChangeSet()
-            changes.add_change(ChangeContents(resource, source))
-            self.refactoring.add_and_commit_changes(changes)
-
-    def organize_imports(self, resource):
+    def _perform_command_on_import_tools(self, method, resource):
         pymodule = self.pycore.resource_to_pyobject(resource)
-        result = self.import_tools.organize_imports(pymodule)
-        if result is not None:
+        before_performing = pymodule.source_code
+        result = method(pymodule)
+        if result is not None and result != before_performing:
             changes = ChangeSet()
             changes.add_change(ChangeContents(resource, result))
             self.refactoring.add_and_commit_changes(changes)
 
+    def organize_imports(self, resource):
+        return self._perform_command_on_import_tools(
+            self.import_tools.organize_imports, resource)
+
     def expand_star_imports(self, resource):
         source = self._perform_command_on_module_with_imports(
-            resource, rope.refactor.importutils.module_imports.ModuleImports.expand_stars)
+            resource, module_imports.ModuleImports.expand_stars)
         if source is not None:
             changes = ChangeSet()
             changes.add_change(ChangeContents(resource, source))
             self.refactoring.add_and_commit_changes(changes)
 
     def transform_froms_to_imports(self, resource):
-        pymodule = self.pycore.resource_to_pyobject(resource)
-        result = self.import_tools.transform_froms_to_normal_imports(pymodule)
-        if result is not None:
-            changes = ChangeSet()
-            changes.add_change(ChangeContents(resource, result))
-            self.refactoring.add_and_commit_changes(changes)
+        return self._perform_command_on_import_tools(
+            self.import_tools.transform_froms_to_normal_imports, resource)
 
     def transform_relatives_to_absolute(self, resource):
-        pymodule = self.pycore.resource_to_pyobject(resource)
-        result = self.import_tools.transform_relative_imports_to_absolute(pymodule)
-        if result is not None:
-            changes = ChangeSet()
-            changes.add_change(ChangeContents(resource, result))
-            self.refactoring.add_and_commit_changes(changes)
+        return self._perform_command_on_import_tools(
+            self.import_tools.transform_relative_imports_to_absolute, resource)
 
-    def sort_imports(self, resource):
-        pymodule = self.pycore.resource_to_pyobject(resource)
-        result = self.import_tools.sort_imports(pymodule)
-        if result is not None:
-            changes = ChangeSet()
-            changes.add_change(ChangeContents(resource, result))
-            self.refactoring.add_and_commit_changes(changes)
+    def handle_long_imports(self, resource):
+        return self._perform_command_on_import_tools(
+            self.import_tools.handle_long_imports, resource)
 
 
 class Undo(object):

File rope/refactor/change.py

 import difflib
 
+
 class Change(object):
 
     def do(self):

File rope/refactor/importutils/__init__.py

 """
 
 
-import rope.base.pynames
-from rope.refactor import rename
-from rope.refactor import occurrences
+import rope.base.evaluate
+from rope.refactor import occurrences, rename
+from rope.refactor.importutils import module_imports
 from rope.refactor.importutils.importinfo import \
      (NormalImport, FromImport, get_module_name)
-from rope.refactor.importutils import module_imports
-import rope.base.evaluate
 
 
 class ImportTools(object):
     def transform_froms_to_normal_imports(self, pymodule):
         resource = pymodule.get_resource()
         pymodule = self._clean_up_imports(pymodule)
-        module_with_imports = self.get_module_with_imports(pymodule)
-        for import_stmt in module_with_imports.get_import_statements():
+        module_imports = self.get_module_with_imports(pymodule)
+        for import_stmt in module_imports.get_import_statements():
             if not self._can_import_be_transformed_to_normal_import(import_stmt.import_info):
                 continue
             pymodule = self._from_to_normal(pymodule, import_stmt)
 
         # Adding normal imports in place of froms
-        module_with_imports = self.get_module_with_imports(pymodule)
-        for import_stmt in module_with_imports.get_import_statements():
+        module_imports = self.get_module_with_imports(pymodule)
+        for import_stmt in module_imports.get_import_statements():
             if self._can_import_be_transformed_to_normal_import(import_stmt.import_info):
                 import_stmt.import_info = \
                     NormalImport(((import_stmt.import_info.module_name, None),))
-        module_with_imports.remove_duplicates()
-        return module_with_imports.get_changed_source()
+        module_imports.remove_duplicates()
+        return module_imports.get_changed_source()
 
     def _from_to_normal(self, pymodule, import_stmt):
         resource = pymodule.get_resource()
                 return before_removing_self_import
         for name, new_name in to_be_renamed:
             pymodule = self._rename_in_module(pymodule, name, new_name)
-        return pymodule.source_code
+        return self.sort_imports(pymodule)
 
     def _rename_in_module(self, pymodule, name, new_name, till_dot=False):
         old_name = name.split('.')[-1]
         module_imports = self.get_module_with_imports(pymodule)
         module_imports.sort_imports()
         return module_imports.get_changed_source()
+
+    def handle_long_imports(self, pymodule, maxdots=2, maxlength=27):
+        # adding new from imports
+        module_imports = self.get_module_with_imports(pymodule)
+        to_be_fixed = module_imports.handle_long_imports(maxdots, maxlength)
+        # performing the renaming
+        pymodule = self.pycore.get_string_module(
+            module_imports.get_changed_source(),
+            resource=pymodule.get_resource())
+        for name in to_be_fixed:
+            pymodule = self._rename_in_module(pymodule, name, name.split('.')[-1])
+        # organizing imports
+        return self.organize_imports(pymodule)

File rope/refactor/importutils/actions.py

 import os
 import sys
 
-from rope.base import pyobjects
-from rope.base import exceptions
+from rope.base import pyobjects, exceptions
 from rope.refactor.importutils import importinfo
 
 
                         result.add(name[:-3])
             cls._standard_modules = result
         return cls._standard_modules
+
+
+class LongImportVisitor(ImportInfoVisitor):
+
+    def __init__(self, current_folder, pycore, maxdots, maxlength):
+        self.maxdots = maxdots
+        self.maxlength = maxlength
+        self.to_be_renamed = set()
+        self.current_folder = current_folder
+        self.pycore = pycore
+        self.new_imports = []
+
+    def visitNormalImport(self, import_stmt, import_info):
+        new_pairs = []
+        for name, alias in import_info.names_and_aliases:
+            if alias is None and self._is_long(name):
+                self.to_be_renamed.add(name)
+                last_dot = name.rindex('.')
+                from_ = name[:last_dot]
+                imported = name[last_dot + 1:]
+                self.new_imports.append(
+                    importinfo.FromImport(from_, 0, ((imported, None), ),
+                                          self.current_folder, self.pycore))
+
+    def _is_long(self, name):
+        return name.count('.') > self.maxdots or \
+               ('.' in name and len(name) > self.maxlength)

File rope/refactor/importutils/module_imports.py

             index += 1
         return index
 
+    def handle_long_imports(self, maxdots, maxlength):
+        visitor = actions.LongImportVisitor(
+            self._current_folder(), self.pycore, maxdots, maxlength)
+        for import_statement in self.get_import_statements():
+            import_statement.accept(visitor)
+        for import_info in visitor.new_imports:
+            self.add_import(import_info)
+        return visitor.to_be_renamed
+
 
 class _OneTimeSelector(object):
 

File rope/refactor/inline.py

 import rope.base.pyobjects
 import rope.refactor.functionutils
 from rope.base import codeanalyze
+from rope.refactor import occurrences
+from rope.refactor import rename
 from rope.refactor import sourceutils
-from rope.refactor import rename
-from rope.refactor import occurrences
 from rope.refactor.change import ChangeSet, ChangeContents
 
 

File rope/refactor/localtofield.py

+import rope.base.codeanalyze
 from rope.refactor.rename import RenameRefactoring
-import rope.base.codeanalyze
-from rope.refactor.change import (ChangeSet, ChangeContents,
-                                  MoveResource, CreateFolder)
 
 
 class ConvertLocalToFieldRefactoring(object):

File rope/refactor/move.py

 import rope.base.codeanalyze
+import rope.base.exceptions
 import rope.base.pyobjects
-import rope.base.exceptions
 from rope.refactor import importutils
 from rope.refactor import rename
 from rope.refactor import occurrences

File rope/refactor/rename.py

 import rope.base.codeanalyze
+import rope.base.exceptions
 import rope.base.pynames
 import rope.base.pyobjects
-import rope.base.exceptions
 from rope.refactor import occurrences
 from rope.refactor import sourceutils
 from rope.refactor.change import ChangeSet, ChangeContents, MoveResource

File rope/ui/core.py

             parent = project.get_resource(file_name[: last_slash])
             file_name = file_name[last_slash + 1:]
         except ValueError:
-            parent = self.project.get_root_folder()
+            parent = self.project.root
         parent.create_file(file_name)
         return self.open_file(file_name)
 
             parent = project.get_resource(folder_name[:last_slash])
             folder_name = folder_name[last_slash + 1:]
         except ValueError:
-            parent = self.project.get_root_folder()
+            parent = self.project.root
         parent.create_folder(folder_name)
 
     def exit(self):

File rope/ui/fileactions.py

         toplevel.title('Select ' + parent_name)
         tree_handle = _FolderViewHandle(core, toplevel, do_select)
         tree_view = TreeView(toplevel, tree_handle, title='Resources')
-        tree_view.add_entry(core.project.get_root_folder())
+        tree_view.add_entry(core.project.root)
         tree_view.list.focus_set()
         toplevel.grab_set()
 
     toplevel.title('Resources')
     tree_handle = _ResourceViewHandle(core, toplevel)
     tree_view = TreeView(toplevel, tree_handle, title='Resources')
-    for child in tree_handle.get_children(core.project.get_root_folder()):
+    for child in tree_handle.get_children(core.project.root):
         tree_view.add_entry(child)
     tree_view.list.focus_set()
     toplevel.grab_set()
     _show_resource_view(context.get_core())
 
 def refresh_project(context):
-    context.project.validate(context.project.get_root_folder())
+    context.project.validate(context.project.root)
 
 def change_editor(context):
     context.get_core()._change_editor_dialog()

File rope/ui/highlighter.py

         return {'keyword': HighlightingStyle(color='blue', bold=True),
                 'defkeyword': HighlightingStyle(color='blue', bold=True),
                 'string': HighlightingStyle(color='#004080'),
-                'comment': HighlightingStyle(color='#008000', italic=True),
+                'comment': HighlightingStyle(color='#108010'),
                 'builtin': HighlightingStyle(color='#908080'),
                 'definition': HighlightingStyle(color='purple', bold=True)}
 
                 'overline': HighlightingStyle(color='blue', bold=True),
                 'listsign': HighlightingStyle(color='blue', bold=True),
                 'directive': HighlightingStyle(color='#00AAAA'),
-                'emphasis': HighlightingStyle(color='#000033', italic=True),
+                'emphasis': HighlightingStyle(color='#000033'),
                 'strongemphasis': HighlightingStyle(color='#330022', bold=True),
                 'literal': HighlightingStyle(color='#605050'),
                 'interpreted': HighlightingStyle(color='#208820'),

File rope/ui/refactor.py

     if import_organizer:
         import_organizer.transform_relatives_to_absolute(file_editor.get_file())
 
-def sort_imports(context):
+def handle_long_imports(context):
     if not context.get_active_editor():
         return
     file_editor = context.get_active_editor()
     import_organizer = _get_refactoring(context).get_import_organizer()
     if import_organizer:
-        import_organizer.sort_imports(file_editor.get_file())
+        import_organizer.handle_long_imports(file_editor.get_file())
 
 def inline(context):
     if context.get_active_editor():
                             ConfirmAllEditorsAreSaved(transform_froms_to_imports), None,
                             MenuAddress(['Refactor', 'Transform Froms to Imports'], 'r', 2),
                             ['python']))
-actions.append(SimpleAction('Sort Imports',
-                            ConfirmAllEditorsAreSaved(sort_imports), None,
-                            MenuAddress(['Refactor', 'Sort Imports'], None, 2),
+actions.append(SimpleAction('Handle Long Imports',
+                            ConfirmAllEditorsAreSaved(handle_long_imports), None,
+                            MenuAddress(['Refactor', 'Handle Long Imports'], None, 2),
                             ['python']))
 actions.append(SimpleAction('Undo Refactoring',
                             ConfirmAllEditorsAreSaved(undo_refactoring), None,

File ropetest/builtintest.py

         ropetest.testutils.remove_recursively(self.project_root)
         self.project = rope.base.project.Project(self.project_root)
         self.pycore = self.project.get_pycore()
-        self.mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        self.mod = self.pycore.create_module(self.project.root, 'mod')
 
     project_root = 'sample_project'
 

File ropetest/codeanalyzetest.py

         self.assertEquals(a_func_pyname, name_finder.get_pyname_at(code.index('a_func') + 3))
 
     def test_modules_after_from_statements(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         mod = self.pycore.create_module(root_folder, 'mod')
         mod.write('def a_func():\n    pass\n')
         code = 'from mod import a_func\n'
 
     @testutils.run_only_for_25
     def test_relative_modules_after_from_statements(self):
-        pkg1 = self.pycore.create_package(self.project.get_root_folder(), 'pkg1')
+        pkg1 = self.pycore.create_package(self.project.root, 'pkg1')
         pkg2 = self.pycore.create_package(pkg1, 'pkg2')
         mod1 = self.pycore.create_module(pkg1, 'mod1')
         mod2 = self.pycore.create_module(pkg2, 'mod2')
         self.assertEquals(mod1_pyobject, found_pyname.get_object())
 
     def test_relative_modules_after_from_statements2(self):
-        mod1 = self.pycore.create_module(self.project.get_root_folder(), 'mod1')
-        pkg1 = self.pycore.create_package(self.project.get_root_folder(), 'pkg1')
+        mod1 = self.pycore.create_module(self.project.root, 'mod1')
+        pkg1 = self.pycore.create_package(self.project.root, 'pkg1')
         pkg2 = self.pycore.create_package(pkg1, 'pkg2')
         mod2 = self.pycore.create_module(pkg2, 'mod2')
         mod1.write('import pkg1.pkg2.mod2')

File ropetest/codeassisttest.py

         self.assertEquals((None, 3), result)
 
     def test_get_definition_location_dotted_module_names(self):
-        module_resource = self.project.get_pycore().create_module(self.project.get_root_folder(),
-                                                                  'mod')
+        module_resource = self.project.get_pycore().\
+                          create_module(self.project.root, 'mod')
         module_resource.write('def a_func():\n    pass\n')
         code = 'import mod\nmod.a_func()'
         result = self.assist.get_definition_location(code, len(code) - 3)
 
     def test_get_definition_location_for_nested_packages(self):
         pycore = self.project.get_pycore()
-        mod1 = pycore.create_module(self.project.get_root_folder(), 'mod1')
-        pkg1 = pycore.create_package(self.project.get_root_folder(), 'pkg1')
+        mod1 = pycore.create_module(self.project.root, 'mod1')
+        pkg1 = pycore.create_package(self.project.root, 'pkg1')
         pkg2 = pycore.create_package(pkg1, 'pkg2')
         mod2 = pycore.create_module(pkg2, 'mod2')
         mod1.write('import pkg1.pkg2.mod2')
 
     def test_get_pydoc_for_modules(self):
         pycore = self.project.get_pycore()
-        mod = pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = pycore.create_module(self.project.root, 'mod')
         mod.write('"""a module"""\n')
         src = 'import mod\nmod'
         self.assertEquals('a module', self.assist.get_doc(src, len(src) - 1))
         self.project = Project(self.project_root)
         self.assist = PythonCodeAssist(self.project)
         self.pycore = self.project.get_pycore()
-        samplemod = self.pycore.create_module(self.project.get_root_folder(), 'samplemod')
+        samplemod = self.pycore.create_module(self.project.root, 'samplemod')
         samplemod.write("class SampleClass(object):\n    def sample_method():\n        pass" + \
                         "\n\ndef sample_func():\n    pass\nsample_var = 10\n" + \
                         "\ndef _underlined_func():\n    pass\n\n")
-        package = self.pycore.create_package(self.project.get_root_folder(), 'package')
+        package = self.pycore.create_package(self.project.root, 'package')
         nestedmod = self.pycore.create_module(package, 'nestedmod')
 
     def assert_completion_in_result(self, name, kind, result):
         self.assert_completion_not_in_result('Sample', 'global', result)
 
     def test_assist_on_relative_imports(self):
-        pkg = self.pycore.create_package(self.project.get_root_folder(), 'pkg')
+        pkg = self.pycore.create_package(self.project.root, 'pkg')
         mod1 = self.pycore.create_module(pkg, 'mod1')
         mod2 = self.pycore.create_module(pkg, 'mod2')
         mod1.write('def a_func():\n    pass\n')
         self.assert_completion_in_result('a_func', 'attribute', result)
 
     def test_get_location_on_relative_imports(self):
-        pkg = self.pycore.create_package(self.project.get_root_folder(), 'pkg')
+        pkg = self.pycore.create_package(self.project.root, 'pkg')
         mod1 = self.pycore.create_module(pkg, 'mod1')
         mod2 = self.pycore.create_module(pkg, 'mod2')
         mod1.write('def a_func():\n    pass\n')
         self.assertEquals((mod1, 1), result)
 
     def test_get_doc_on_relative_imports(self):
-        pkg = self.pycore.create_package(self.project.get_root_folder(), 'pkg')
+        pkg = self.pycore.create_package(self.project.root, 'pkg')
         mod1 = self.pycore.create_module(pkg, 'mod1')
         mod2 = self.pycore.create_module(pkg, 'mod2')
         mod1.write('def a_func():\n    """hey"""\n    pass\n')
         self.assertTrue(result.endswith('hey'))
 
     def test_finding_occurrences(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('a_var = 1\n')
         result = self.assist.find_occurrences(mod, 1)
         self.assertEquals([(mod, 0)], result)
 
     def test_finding_occurrences_in_more_than_one_module(self):
-        mod1 = self.pycore.create_module(self.project.get_root_folder(), 'mod1')
-        mod2 = self.pycore.create_module(self.project.get_root_folder(), 'mod2')
+        mod1 = self.pycore.create_module(self.project.root, 'mod1')
+        mod2 = self.pycore.create_module(self.project.root, 'mod2')
         mod1.write('a_var = 1\n')
         mod2.write('import mod1\nmy_var = mod1.a_var')
         result = self.assist.find_occurrences(mod1, 1)

File ropetest/objectinfertest.py

         super(DynamicOITest, self).tearDown()
 
     def test_simple_dti(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func(arg):\n    return arg\n' \
                'a_var = a_func(a_func)\n'
         mod.write(code)
                           pymod.get_attribute('a_var').get_object())
 
     def test_module_dti(self):
-        mod1 = self.pycore.create_module(self.project.get_root_folder(), 'mod1')
-        mod2 = self.pycore.create_module(self.project.get_root_folder(), 'mod2')
+        mod1 = self.pycore.create_module(self.project.root, 'mod1')
+        mod2 = self.pycore.create_module(self.project.root, 'mod2')
         code = 'import mod1\ndef a_func(arg):\n    return arg\n' \
                'a_var = a_func(mod1)\n'
         mod2.write(code)
                           pymod2.get_attribute('a_var').get_object())
 
     def test_class_from_another_module_dti(self):
-        mod1 = self.pycore.create_module(self.project.get_root_folder(), 'mod1')
-        mod2 = self.pycore.create_module(self.project.get_root_folder(), 'mod2')
+        mod1 = self.pycore.create_module(self.project.root, 'mod1')
+        mod2 = self.pycore.create_module(self.project.root, 'mod2')
         code1 = 'class AClass(object):\n    pass\n'
         code2 = 'from mod1 import AClass\n' \
                '\ndef a_func(arg):\n    return arg\n' \
 
 
     def test_class_dti(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class AClass(object):\n    pass\n' \
                '\ndef a_func(arg):\n    return arg\n' \
                'a_var = a_func(AClass)\n'
                           pymod.get_attribute('a_var').get_object())
 
     def test_instance_dti(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class AClass(object):\n    pass\n' \
                '\ndef a_func(arg):\n    return arg()\n' \
                'a_var = a_func(AClass)\n'
                           pymod.get_attribute('a_var').get_object().get_type())
 
     def test_method_dti(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class AClass(object):\n    def a_method(self, arg):\n        return arg()\n' \
                'an_instance = AClass()\n' \
                'a_var = an_instance.a_method(AClass)\n'
                           pymod.get_attribute('a_var').get_object().get_type())
 
     def test_function_argument_dti(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func(arg):\n    pass\n' \
                'a_func(a_func)\n'
         mod.write(code)
                           pyscope.get_scopes()[0].get_name('arg').get_object())
 
     def test_classes_with_the_same_name(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func(arg):\n    class AClass(object):\n        pass\n    return arg\n' \
                'class AClass(object):\n    pass\n' \
                'a_var = a_func(AClass)\n'
                           pymod.get_attribute('a_var').get_object())
 
     def test_nested_classes(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func():\n    class AClass(object):\n        pass\n    return AClass\n' \
                'def another_func(arg):\n    return arg\n' \
                'a_var = another_func(a_func())\n'
                           pyscope.get_name('a_var').get_object())
 
     def test_function_argument_dti2(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func(arg, a_builtin_type):\n    pass\n' \
                'a_func(a_func, [])\n'
         mod.write(code)
                           pyscope.get_scopes()[0].get_name('arg').get_object())
 
     def test_dti_and_concluded_data_invalidation(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func(arg):\n    return arg\n' \
                'a_var = a_func(a_func)\n'
         mod.write(code)
                           pymod.get_attribute('a_var').get_object())
 
     def test_list_objects_and_dynamicoi(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C(object):\n    pass\ndef a_func(arg):\n    return arg\n' \
                'a_var = a_func([C()])[0]\n'
         mod.write(code)
         self.assertEquals(c_class, a_var.get_type())
 
     def test_for_loops_and_dynamicoi(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C(object):\n    pass\ndef a_func(arg):\n    return arg\n' \
                'for c in a_func([C()]):\n    a_var = c\n'
         mod.write(code)
         self.assertEquals(c_class, a_var.get_type())
 
     def test_dict_objects_and_dynamicoi(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C(object):\n    pass\n' \
                'def a_func(arg):\n    return arg\n' \
                'a_var = a_func({1: C()})[1]\n'
         self.assertEquals(c_class, a_var.get_type())
 
     def test_dict_keys_and_dynamicoi(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C(object):\n    pass\n' \
                'def a_func(arg):\n    return arg\n' \
                'a_var = a_func({C(): 1}).keys()[0]\n'
         self.assertEquals(c_class, a_var.get_type())
 
     def test_dict_keys_and_dynamicoi(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C1(object):\n    pass\nclass C2(object):\n    pass\n' \
                'def a_func(arg):\n    return arg\n' \
                'a, b = a_func((C1(), C2()))\n'
         self.assertEquals(c2_class, b_var.get_type())
 
     def test_strs_and_dynamicoi(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'def a_func(arg):\n    return arg\n' \
                'a_var = a_func("hey")\n'
         mod.write(code)
         self.assertTrue(isinstance(a_var.get_type(), rope.base.builtins.Str))
 
     def test_textual_transformations(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C(object):\n    pass\ndef f():\n    pass\na_var = C()\n' \
                'a_list = [C()]\na_str = "hey"\n'
         mod.write(code)
         self.assertEquals(to_textual.transform(pymod), complex_to_textual(pymod))
 
     def test_arguments_with_keywords(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C1(object):\n    pass\nclass C2(object):\n    pass\n' \
                'def a_func(arg):\n    return arg\n' \
                'a = a_func(arg=C1())\nb = a_func(arg=C2())\n'
         self.assertEquals(c2_class, b_var.get_type())
 
     def test_a_function_with_different_returns(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C1(object):\n    pass\nclass C2(object):\n    pass\n' \
                'def a_func(arg):\n    return arg\n' \
                'a = a_func(C1())\nb = a_func(C2())\n'
         self.assertEquals(c2_class, b_var.get_type())
 
     def test_a_function_with_different_returns2(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C1(object):\n    pass\nclass C2(object):\n    pass\n' \
                'def a_func(p):\n    if p == C1:\n        return C1()\n' \
                '    else:\n        return C2()\n' \
         self.assertEquals(c2_class, b_var.get_type())
 
     def test_ignoring_star_args(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C1(object):\n    pass\nclass C2(object):\n    pass\n' \
                'def a_func(p, *args):\n    if p == C1:\n        return C1()\n' \
                '    else:\n        return C2()\n' \
         self.assertEquals(c2_class, b_var.get_type())
 
     def test_ignoring_double_star_args(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         code = 'class C1(object):\n    pass\nclass C2(object):\n    pass\n' \
                'def a_func(p, *kwds, **args):\n    if p == C1:\n        return C1()\n' \
                '    else:\n        return C2()\n' \

File ropetest/projecttest.py

 from ropetest import testutils
 
 
-class SampleProjectMaker(object):
-
-    def __init__(self):
-        self.projectRoot = 'SampleProject'
-        self.sampleFile = 'sample.txt'
-        self.sampleFolder = 'ASampleFolder'
-        self.sample_content = 'sample text\n'
-
-    def make_project(self):
-        self.remove_all()
-        self.sampleFilePath = os.path.join(self.projectRoot, self.sampleFile)
-        os.mkdir(self.projectRoot)
-        os.mkdir(os.path.join(self.projectRoot, self.sampleFolder))
-        sample = open(self.sampleFilePath, 'w')
-        sample.write(self.sample_content)
-        sample.close()
-
-    def get_root(self):
-        return self.projectRoot
-
-    def get_sample_file_name(self):
-        return self.sampleFile
-
-    def get_sample_folder_name(self):
-        return self.sampleFolder
-
-    def get_sample_file_contents(self):
-        return 'sample text\n'
-
-    def remove_all(self):
-        testutils.remove_recursively(self.projectRoot)
-
-
 class ProjectTest(unittest.TestCase):
 
     def setUp(self):
         unittest.TestCase.setUp(self)
-        self.projectMaker = SampleProjectMaker()
-        self.projectMaker.make_project()
-        self.project = Project(self.projectMaker.get_root())
+        self.project_root = 'sample_project'
+        testutils.remove_recursively(self.project_root)
+        self._make_sample_project()
+        self.project = Project(self.project_root)
+
+    def _make_sample_project(self):
+        self.sample_file = 'sample_file.txt'
+        self.sample_path = os.path.join(self.project_root, 'sample_file.txt')
+        os.mkdir(self.project_root)
+        self.sample_folder = 'sample_folder'
+        os.mkdir(os.path.join(self.project_root, self.sample_folder))
+        sample = open(self.sample_path, 'w')
+        sample.write('sample text\n')
+        sample.close()
 
     def tearDown(self):
-        self.projectMaker.remove_all()
+        testutils.remove_recursively(self.project_root)
         unittest.TestCase.tearDown(self)
 
     def test_project_creation(self):
-        self.assertEquals(self.projectMaker.get_root(), self.project.get_root_address())
+        self.assertEquals(self.project_root, self.project.address)
 
     def test_getting_project_file(self):
-        projectFile = self.project.get_resource(self.projectMaker.get_sample_file_name())
-        self.assertTrue(projectFile is not None)
+        project_file = self.project.get_resource(self.sample_file)
+        self.assertTrue(project_file is not None)
 
     def test_project_file_reading(self):
-        projectFile = self.project.get_resource(self.projectMaker.get_sample_file_name())
-        self.assertEquals(self.projectMaker.get_sample_file_contents(), projectFile.read())
+        projectFile = self.project.get_resource(self.sample_file)
+        self.assertEquals('sample text\n', projectFile.read())
 
     @testutils.assert_raises(RopeException)
     def test_getting_not_existing_project_file(self):
         self.fail('Should have failed')
 
     def test_writing_in_project_files(self):
-        projectFile = self.project.get_resource(self.projectMaker.get_sample_file_name())
-        projectFile.write('another text\n')
-        self.assertEquals('another text\n', projectFile.read())
+        project_file = self.project.get_resource(self.sample_file)
+        project_file.write('another text\n')
+        self.assertEquals('another text\n', project_file.read())
 
     def test_creating_files(self):
-        projectFile = 'newfile.txt'
-        self.project.get_root_folder().create_file(projectFile)
-        newFile = self.project.get_resource(projectFile)
+        project_file = 'newfile.txt'
+        self.project.root.create_file(project_file)
+        newFile = self.project.get_resource(project_file)
         self.assertTrue(newFile is not None)
 
     @testutils.assert_raises(RopeException)
     def test_creating_files_that_already_exist(self):
-        self.project.get_root_folder().create_file(self.projectMaker.get_sample_file_name())
+        self.project.root.create_file(self.sample_file)
         self.fail('Should have failed')
 
     def test_making_root_folder_if_it_does_not_exist(self):
 
     def test_creating_folders(self):
         folderName = 'SampleFolder'
-        self.project.get_root_folder().create_folder(folderName)
-        folderPath = os.path.join(self.project.get_root_address(), folderName)
+        self.project.root.create_folder(folderName)
+        folderPath = os.path.join(self.project.address, folderName)
         self.assertTrue(os.path.exists(folderPath) and os.path.isdir(folderPath))
 
     @testutils.assert_raises(RopeException)
     def test_making_folder_that_already_exists(self):
         folderName = 'SampleFolder'
-        self.project.get_root_folder().create_folder(folderName)
-        self.project.get_root_folder().create_folder(folderName)
+        self.project.root.create_folder(folderName)
+        self.project.root.create_folder(folderName)
 
     @testutils.assert_raises(RopeException)
     def test_failing_if_creating_folder_while_file_already_exists(self):
         folderName = 'SampleFolder'
-        self.project.get_root_folder().create_file(folderName)
-        self.project.get_root_folder().create_folder(folderName)
+        self.project.root.create_file(folderName)
+        self.project.root.create_folder(folderName)
 
     def test_creating_file_inside_folder(self):
         folder_name = 'sampleFolder'
         file_name = 'sample2.txt'
         file_path = folder_name + '/' + file_name
-        parent_folder = self.project.get_root_folder().create_folder(folder_name)
+        parent_folder = self.project.root.create_folder(folder_name)
         parent_folder.create_file(file_name)
         file = self.project.get_resource(file_path)
         file.write('sample notes')
         self.assertEquals(file_path, file.get_path())
-        self.assertEquals('sample notes', open(os.path.join(self.project.get_root_address(),
+        self.assertEquals('sample notes', open(os.path.join(self.project.address,
                                                             file_path)).read())
 
     @testutils.assert_raises(RopeException)
     def test_failing_when_creating_file_inside_non_existant_folder(self):
-        self.project.get_root_folder().create_file('NonexistantFolder/SomeFile.txt')
+        self.project.root.create_file('NonexistantFolder/SomeFile.txt')
 
     def test_nested_directories(self):
         folder_name = 'SampleFolder'
-        parent = self.project.get_root_folder().create_folder(folder_name)
+        parent = self.project.root.create_folder(folder_name)
         parent.create_folder(folder_name)
-        folder_path = os.path.join(self.project.get_root_address(), folder_name, folder_name)
+        folder_path = os.path.join(self.project.address, folder_name, folder_name)
         self.assertTrue(os.path.exists(folder_path) and os.path.isdir(folder_path))
 
     def test_removing_files(self):
-        self.assertTrue(os.path.exists(os.path.join(self.project.get_root_address(),
-                                                    self.projectMaker.get_sample_file_name())))
-        self.project.get_resource(self.projectMaker.get_sample_file_name()).remove()
-        self.assertFalse(os.path.exists(os.path.join(self.project.get_root_address(),
-                                                     self.projectMaker.get_sample_file_name())))
+        self.assertTrue(os.path.exists(self.sample_path))
+        self.project.get_resource(self.sample_file).remove()
+        self.assertFalse(os.path.exists(self.sample_path))
 
     def test_removing_files_invalidating_in_project_resource_pool(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         my_file = root_folder.create_file('my_file.txt')
         my_file.remove()
         self.assertFalse(root_folder.has_child('my_file.txt'))
 
     def test_removing_directories(self):
-        self.assertTrue(os.path.exists(os.path.join(self.project.get_root_address(),
-                                                    self.projectMaker.get_sample_folder_name())))
-        self.project.get_resource(self.projectMaker.get_sample_folder_name()).remove()
-        self.assertFalse(os.path.exists(os.path.join(self.project.get_root_address(),
-                                                     self.projectMaker.get_sample_folder_name())))
+        self.assertTrue(os.path.exists(os.path.join(self.project.address,
+                                                    self.sample_folder)))
+        self.project.get_resource(self.sample_folder).remove()
+        self.assertFalse(os.path.exists(os.path.join(self.project.address,
+                                                     self.sample_folder)))
 
     @testutils.assert_raises(RopeException)
     def test_removing_non_existant_files(self):
         self.project.get_resource('NonExistantFile.txt').remove()
 
     def test_removing_nested_files(self):
-        fileName = self.projectMaker.get_sample_folder_name() + '/SampleFile.txt'
-        self.project.get_root_folder().create_file(fileName)
-        self.project.get_resource(fileName).remove()
-        self.assertTrue(os.path.exists(os.path.join(self.project.get_root_address(),
-                                                    self.projectMaker.get_sample_folder_name())))
-        self.assertTrue(not os.path.exists(os.path.join(self.project.get_root_address(),
-                                  fileName)))
+        file_name = self.sample_folder + '/sample_file.txt'
+        self.project.root.create_file(file_name)
+        self.project.get_resource(file_name).remove()
+        self.assertTrue(os.path.exists(os.path.join(self.project.address,
+                                                    self.sample_folder)))
+        self.assertTrue(not os.path.exists(os.path.join(self.project.address,
+                                  file_name)))
 
     def test_file_get_name(self):
-        file = self.project.get_resource(self.projectMaker.get_sample_file_name())
-        self.assertEquals(self.projectMaker.get_sample_file_name(), file.get_name())
+        file = self.project.get_resource(self.sample_file)
+        self.assertEquals(self.sample_file, file.get_name())
         file_name = 'nestedFile.txt'
-        parent = self.project.get_resource(self.projectMaker.get_sample_folder_name())
-        filePath = self.projectMaker.get_sample_folder_name() + '/' + file_name
+        parent = self.project.get_resource(self.sample_folder)
+        filePath = self.sample_folder + '/' + file_name
         parent.create_file(file_name)
         nestedFile = self.project.get_resource(filePath)
         self.assertEquals(file_name, nestedFile.get_name())
 
     def test_folder_get_name(self):
-        folder = self.project.get_resource(self.projectMaker.get_sample_folder_name())
-        self.assertEquals(self.projectMaker.get_sample_folder_name(), folder.get_name())
+        folder = self.project.get_resource(self.sample_folder)
+        self.assertEquals(self.sample_folder, folder.get_name())
 
     def test_file_get_path(self):
-        file = self.project.get_resource(self.projectMaker.get_sample_file_name())
-        self.assertEquals(self.projectMaker.get_sample_file_name(), file.get_path())
+        file = self.project.get_resource(self.sample_file)
+        self.assertEquals(self.sample_file, file.get_path())
         fileName = 'nestedFile.txt'
-        parent = self.project.get_resource(self.projectMaker.get_sample_folder_name())
-        filePath = self.projectMaker.get_sample_folder_name() + '/' + fileName
+        parent = self.project.get_resource(self.sample_folder)
+        filePath = self.sample_folder + '/' + fileName
         parent.create_file(fileName)
         nestedFile = self.project.get_resource(filePath)
         self.assertEquals(filePath, nestedFile.get_path())
 
     def test_folder_get_path(self):
-        folder = self.project.get_resource(self.projectMaker.get_sample_folder_name())
-        self.assertEquals(self.projectMaker.get_sample_folder_name(), folder.get_path())
+        folder = self.project.get_resource(self.sample_folder)
+        self.assertEquals(self.sample_folder, folder.get_path())
 
     def test_is_folder(self):
-        self.assertTrue(self.project.get_resource(self.projectMaker.get_sample_folder_name()).is_folder())
-        self.assertTrue(not self.project.get_resource(self.projectMaker.get_sample_file_name()).is_folder())
+        self.assertTrue(self.project.get_resource(self.sample_folder).is_folder())
+        self.assertTrue(not self.project.get_resource(self.sample_file).is_folder())
 
     def testget_children(self):
-        children = self.project.get_resource(self.projectMaker.get_sample_folder_name()).get_children()
+        children = self.project.get_resource(self.sample_folder).get_children()
         self.assertEquals([], children)
 
     def test_nonempty_get_children(self):
         file_name = 'nestedfile.txt'
-        filePath = self.projectMaker.get_sample_folder_name() + '/' + file_name
-        parent = self.project.get_resource(self.projectMaker.get_sample_folder_name())
+        filePath = self.sample_folder + '/' + file_name
+        parent = self.project.get_resource(self.sample_folder)
         parent.create_file(file_name)
         children = parent.get_children()
         self.assertEquals(1, len(children))
     def test_nonempty_get_children2(self):
         file_name = 'nestedfile.txt'
         folder_name = 'nestedfolder.txt'
-        filePath = self.projectMaker.get_sample_folder_name() + '/' + file_name
-        folderPath = self.projectMaker.get_sample_folder_name() + '/' + folder_name
-        parent = self.project.get_resource(self.projectMaker.get_sample_folder_name())
+        filePath = self.sample_folder + '/' + file_name
+        folderPath = self.sample_folder + '/' + folder_name
+        parent = self.project.get_resource(self.sample_folder)
         parent.create_file(file_name)
         parent.create_folder(folder_name)
         children = parent.get_children()
         self.assertTrue(folderPath == children[0].get_path() or folderPath == children[1].get_path())
 
     def test_getting_files(self):
-        files = self.project.get_root_folder().get_files()
+        files = self.project.root.get_files()
         self.assertEquals(1, len(files))
-        self.assertTrue(self.project.get_resource(self.projectMaker.get_sample_file_name()) in files)
+        self.assertTrue(self.project.get_resource(self.sample_file) in files)
 
     def test_getting_folders(self):
-        folders = self.project.get_root_folder().get_folders()
+        folders = self.project.root.get_folders()
         self.assertEquals(1, len(folders))
-        self.assertTrue(self.project.get_resource(self.projectMaker.get_sample_folder_name()) in folders)
+        self.assertTrue(self.project.get_resource(self.sample_folder) in folders)
 
     def test_nested_folder_get_files(self):
-        parent = self.project.get_root_folder().create_folder('top')
+        parent = self.project.root.create_folder('top')
         parent.create_file('file1.txt')
         parent.create_file('file2.txt')
         files = parent.get_files()
         self.assertEquals(0, len(parent.get_folders()))
 
     def test_nested_folder_get_folders(self):
-        parent = self.project.get_root_folder().create_folder('top')
+        parent = self.project.root.create_folder('top')
         parent.create_folder('dir1')
         parent.create_folder('dir2')
         folders = parent.get_folders()
         self.assertTrue(self.project.get_resource('top/dir1') in folders)
         self.assertEquals(0, len(parent.get_files()))
 
-    def testRootFolder(self):
-        rootFolder = self.project.get_root_folder()
-        self.assertEquals(2, len(rootFolder.get_children()))
-        self.assertEquals('', rootFolder.get_path())
-        self.assertEquals('', rootFolder.get_name())
+    def test_root_folder(self):
+        root_folder = self.project.root
+        self.assertEquals(2, len(root_folder.get_children()))
+        self.assertEquals('', root_folder.get_path())
+        self.assertEquals('', root_folder.get_name())
 
     def testGetAllFiles(self):
         files = self.project.get_files()
         self.assertEquals(1, len(files))
-        self.assertEquals(self.projectMaker.get_sample_file_name(), files[0].get_name())
+        self.assertEquals(self.sample_file, files[0].get_name())
 
     def testMultifileGetAllFiles(self):
         fileName = 'nestedFile.txt'
-        parent = self.project.get_resource(self.projectMaker.get_sample_folder_name())
+        parent = self.project.get_resource(self.sample_folder)
         parent.create_file(fileName)
         files = self.project.get_files()
         self.assertEquals(2, len(files))
         self.assertTrue(fileName == files[0].get_name() or fileName == files[1].get_name())
 
     def test_ignoring_dot_star_folders_in_get_files(self):
-        root = self.project.get_root_address()
+        root = self.project.address
         dot_test = os.path.join(root, '.test')
         os.mkdir(dot_test)
         test_py = os.path.join(dot_test, 'test.py')
             self.assertNotEquals('.test/test.py', x.get_path())
 
     def test_ignoring_dot_pyc_files_in_get_files(self):
-        root = self.project.get_root_address()
+        root = self.project.address
         src_folder = os.path.join(root, 'src')
         os.mkdir(src_folder)
         test_pyc = os.path.join(src_folder, 'test.pyc')
 
     def test_folder_creating_files(self):
         projectFile = 'NewFile.txt'
-        self.project.get_root_folder().create_file(projectFile)
+        self.project.root.create_file(projectFile)
         new_file = self.project.get_resource(projectFile)
         self.assertTrue(new_file is not None and not new_file.is_folder())
 
     def test_folder_creating_nested_files(self):
         project_file = 'NewFile.txt'
-        parent_folder = self.project.get_resource(self.projectMaker.get_sample_folder_name())
+        parent_folder = self.project.get_resource(self.sample_folder)
         parent_folder.create_file(project_file)
-        newFile = self.project.get_resource(self.projectMaker.get_sample_folder_name()
+        newFile = self.project.get_resource(self.sample_folder
                                             + '/' + project_file)
         self.assertTrue(new_file is not None and not new_file.is_folder())
 
     def test_folder_creating_files(self):
         projectFile = 'newfolder'
-        self.project.get_root_folder().create_folder(projectFile)
+        self.project.root.create_folder(projectFile)
         new_folder = self.project.get_resource(projectFile)
         self.assertTrue(new_folder is not None and new_folder.is_folder())
 
     def test_folder_creating_nested_files(self):
         project_file = 'newfolder'
-        parent_folder = self.project.get_resource(self.projectMaker.get_sample_folder_name())
+        parent_folder = self.project.get_resource(self.sample_folder)
         parent_folder.create_folder(project_file)
-        new_folder = self.project.get_resource(self.projectMaker.get_sample_folder_name()
+        new_folder = self.project.get_resource(self.sample_folder
                                                + '/' + project_file)
         self.assertTrue(new_folder is not None and new_folder.is_folder())
 
     def test_folder_get_child(self):
-        folder = self.project.get_root_folder()
+        folder = self.project.root
         folder.create_file('myfile.txt')
         folder.create_folder('myfolder')
         self.assertEquals(self.project.get_resource('myfile.txt'),
                           folder.get_child('myfolder'))
 
     def test_folder_get_child_nested(self):
-        root = self.project.get_root_folder()
+        root = self.project.root
         folder = root.create_folder('myfolder')
         folder.create_file('myfile.txt')
         folder.create_folder('myfolder')
                           folder.get_child('myfolder'))
 
     def test_project_root_is_root_folder(self):
-        self.assertEquals('', self.project.get_root_folder().get_path())
+        self.assertEquals('', self.project.root.get_path())
 
     def test_moving_files(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         my_file = root_folder.create_file('my_file.txt')
         my_file.move('my_other_file.txt')
         self.assertFalse(my_file.exists())
         root_folder.get_child('my_other_file.txt')
 
     def test_moving_folders(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         my_folder = root_folder.create_folder('my_folder')
         my_file = my_folder.create_file('my_file.txt')
         my_folder.move('new_folder')
         self.assertTrue(root_folder.get_child('new_folder') is not None)
 
     def test_moving_destination_folders(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         my_folder = root_folder.create_folder('my_folder')
         my_file = root_folder.create_file('my_file.txt')
         my_file.move('my_folder')
         my_folder.get_child('my_file.txt')
 
     def test_moving_files_and_resource_objects(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         my_file = root_folder.create_file('my_file.txt')
         old_hash = hash(my_file)
         my_file.move('my_other_file.txt')
         self.assertEquals(old_hash, hash(my_file))
 
     def test_file_encoding_reading(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         contents = u'# -*- coding: utf-8 -*-\n#\N{LATIN SMALL LETTER I WITH DIAERESIS}\n'
         file = open(sample_file._get_real_path(), 'w')
         file.write(contents.encode('utf-8'))
         self.assertEquals(contents, sample_file.read())
 
     def test_file_encoding_writing(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         contents = u'# -*- coding: utf-8 -*-\n\N{LATIN SMALL LETTER I WITH DIAERESIS}\n'
         sample_file.write(contents)
         self.assertEquals(contents, sample_file.read())
 
     def test_using_utf8_when_writing_in_case_of_errors(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         contents = u'\n\N{LATIN SMALL LETTER I WITH DIAERESIS}\n'
         sample_file.write(contents)
         self.assertEquals(contents, sample_file.read())
 
     # XXX: supporting utf_8_sig
     def xxx_test_file_encoding_reading_for_notepad_styles(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         contents = u'#\N{LATIN SMALL LETTER I WITH DIAERESIS}\n'
         file = open(sample_file._get_real_path(), 'w')
         # file.write('\xef\xbb\xbf')
         super(ResourceObserverTest, self).tearDown()
 
     def test_resource_change_observer(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         sample_file.write('a sample file version 1')
         sample_observer = _SampleObserver()
         self.project.add_observer(sample_observer)
         self.assertEquals(sample_file, sample_observer.last_changed)
 
     def test_resource_change_observer_after_removal(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         sample_file.write('text')
         sample_observer = _SampleObserver()
         self.project.add_observer(FilteredResourceObserver(sample_observer,
         self.assertEquals((sample_file, None), sample_observer.last_moved)
 
     def test_resource_change_observer2(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         self.project.add_observer(sample_observer)
         self.project.remove_observer(sample_observer)
         self.assertEquals(0, sample_observer.change_count)
 
     def test_resource_change_observer_for_folders(self):
-        root_folder = self.project.get_root_folder()
+        root_folder = self.project.root
         my_folder = root_folder.create_folder('my_folder')
         my_folder_observer = _SampleObserver()
         root_folder_observer = _SampleObserver()
         self.assertEquals(2, root_folder_observer.change_count)
 
     def test_resource_change_observer_after_moving(self):
-        sample_file = self.project.get_root_folder().create_file('my_file.txt')
+        sample_file = self.project.root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         self.project.add_observer(sample_observer)
         sample_file.move('new_file.txt')
                            sample_observer.last_moved)
 
     def test_revalidating_files(self):
-        root = self.project.get_root_folder()
+        root = self.project.root
         my_file = root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         self.project.add_observer(FilteredResourceObserver(sample_observer,
         self.assertEquals(1, sample_observer.change_count)
 
     def test_revalidating_files_and_no_changes2(self):
-        root = self.project.get_root_folder()
+        root = self.project.root
         my_file = root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         self.project.add_observer(FilteredResourceObserver(sample_observer,
         self.assertEquals(0, sample_observer.change_count)
 
     def test_revalidating_folders(self):
-        root = self.project.get_root_folder()
+        root = self.project.root
         my_folder = root.create_folder('myfolder')
         my_file = my_folder.create_file('myfile.txt')
         sample_observer = _SampleObserver()
         self.assertEquals(1, sample_observer.change_count)
 
     def test_removing_and_adding_resources_to_filtered_observer(self):
-        my_file = self.project.get_root_folder().create_file('my_file.txt')
+        my_file = self.project.root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         filtered_observer = FilteredResourceObserver(sample_observer)
         self.project.add_observer(filtered_observer)
         self.assertEquals(1, sample_observer.change_count)
 
     def test_validation_and_changing_files(self):
-        my_file = self.project.get_root_folder().create_file('my_file.txt')
+        my_file = self.project.root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         timekeeper = _MockTimeKeepter()
         filtered_observer = FilteredResourceObserver(sample_observer, [my_file],
         self.project.add_observer(filtered_observer)
         self._write_file(my_file._get_real_path())
         timekeeper.setmtime(my_file, 1)
-        self.project.validate(self.project.get_root_folder())
+        self.project.validate(self.project.root)
         self.assertEquals(1, sample_observer.change_count)
 
     def test_validation_and_changing_files2(self):
-        my_file = self.project.get_root_folder().create_file('my_file.txt')
+        my_file = self.project.root.create_file('my_file.txt')
         sample_observer = _SampleObserver()
         timekeeper = _MockTimeKeepter()
         self.project.add_observer(FilteredResourceObserver(
         timekeeper.setmtime(my_file, 1)
         my_file.write('hey')
         self.assertEquals(1, sample_observer.change_count)
-        self.project.validate(self.project.get_root_folder())
+        self.project.validate(self.project.root)
         self.assertEquals(1, sample_observer.change_count)
 
     def test_not_reporting_multiple_changes_to_folders(self):
-        root = self.project.get_root_folder()
+        root = self.project.root
         file1 = root.create_file('file1.txt')
         file2 = root.create_file('file2.txt')
         sample_observer = _SampleObserver()
         os.remove(file1._get_real_path())
         os.remove(file2._get_real_path())
         self.assertEquals(0, sample_observer.change_count)
-        self.project.validate(self.project.get_root_folder())
+        self.project.validate(self.project.root)
         self.assertEquals(3, sample_observer.change_count)
 
     def _write_file(self, path):

File ropetest/pycoretest.py

         super(PyCoreTest, self).tearDown()
 
     def test_simple_module(self):
-        self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        self.pycore.create_module(self.project.root, 'mod')
         result = self.pycore.get_module('mod')
         self.assertEquals(PyObject.get_base_type('Module'), result.type)
         self.assertEquals(0, len(result.get_attributes()))
 
     def test_nested_modules(self):
-        pkg = self.pycore.create_package(self.project.get_root_folder(), 'pkg')
+        pkg = self.pycore.create_package(self.project.root, 'pkg')
         mod = self.pycore.create_module(pkg, 'mod')
         package = self.pycore.get_module('pkg')
         self.assertEquals(PyObject.get_base_type('Module'), package.get_type())
         self.assertEquals(PyObject.get_base_type('Module'), module.get_type())
 
     def test_package(self):
-        pkg = self.pycore.create_package(self.project.get_root_folder(), 'pkg')
+        pkg = self.pycore.create_package(self.project.root, 'pkg')
         mod = self.pycore.create_module(pkg, 'mod')
         result = self.pycore.get_module('pkg')
         self.assertEquals(PyObject.get_base_type('Module'), result.type)
 
     def test_simple_class(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('class SampleClass(object):\n    pass\n')
         mod_element = self.pycore.get_module('mod')
         result = mod_element.get_attribute('SampleClass').get_object()
         self.assertEquals(PyObject.get_base_type('Type'), result.get_type())
 
     def test_simple_function(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('def sample_function():\n    pass\n')
         mod_element = self.pycore.get_module('mod')
         result = mod_element.get_attribute('sample_function').get_object()
         self.assertEquals(PyObject.get_base_type('Function'), result.get_type())
 
     def test_class_methods(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('class SampleClass(object):\n    def sample_method(self):\n        pass\n')
         mod_element = self.pycore.get_module('mod')
         sample_class = mod_element.get_attribute('SampleClass').get_object()
         self.assertEquals(PyObject.get_base_type('Function'), method.get_type())
 
     def test_global_variables(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('var = 10')
         mod_element = self.pycore.get_module('mod')
         result = mod_element.get_attribute('var')
 
     def test_class_variables(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('class SampleClass(object):\n    var = 10\n')
         mod_element = self.pycore.get_module('mod')
         sample_class = mod_element.get_attribute('SampleClass').get_object()
         var = sample_class.get_attribute('var')
 
     def test_class_attributes_set_in_init(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('class SampleClass(object):\n    def __init__(self):\n        self.var = 20\n')
         mod_element = self.pycore.get_module('mod')
         sample_class = mod_element.get_attribute('SampleClass').get_object()
         var = sample_class.get_attribute('var')
 
     def test_classes_inside_other_classes(self):
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod')
+        mod = self.pycore.create_module(self.project.root, 'mod')
         mod.write('class SampleClass(object):\n    class InnerClass(object):\n        pass\n\n')
         mod_element = self.pycore.get_module('mod')
         sample_class = mod_element.get_attribute('SampleClass').get_object()
         self.pycore.get_module('doesnotexistmodule')
 
     def test_imported_names(self):
-        self.pycore.create_module(self.project.get_root_folder(), 'mod1')
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod2')
+        self.pycore.create_module(self.project.root, 'mod1')
+        mod = self.pycore.create_module(self.project.root, 'mod2')
         mod.write('import mod1\n')
         module = self.pycore.get_module('mod2')
         imported_sys = module.get_attribute('mod1').get_object()
         self.assertEquals(PyObject.get_base_type('Module'), imported_sys.get_type())
 
     def test_imported_as_names(self):
-        self.pycore.create_module(self.project.get_root_folder(), 'mod1')
-        mod = self.pycore.create_module(self.project.get_root_folder(), 'mod2')
+        self.pycore.create_module(self.project.root, 'mod1')
+        mod = self.pycore.create_module(self.project.root, 'mod2')
         mod.write('import mod1 as my_import\n')
         module = self.pycore.get_module('mod2')
         imported_mod = module.get_attribute('my_import').get_object()
         self.assertTrue('f' in derived.get_attributes())
 
     def test_module_creation(self):
-        new_module = self.pycore.create_module(self.project.get_root_folder(), 'module')
+        new_module = self.pycore.create_module(self.project.root, 'module')
         self.assertFalse(new_module.is_folder())
         self.assertEquals(self.project.get_resource('module.py'), new_module)
 
     def test_packaged_module_creation(self):
-        package = self.project.get_root_folder().create_folder('package')
-        new_module = self.pycore.create_module(self.project.get_root_folder(), 'package.module')
+        package = self.project.root.create_folder('package')
+        new_module = self.pycore.create_module(self.project.root, 'package.module')
         self.assertEquals(self.project.get_resource('package/module.py'), new_module)
 
     def test_packaged_module_creation_with_nested_src(self):
-        src = self.project.get_root_folder().create_folder('src')
+        src = self.project.root.create_folder('src')
         package = src.create_folder('pkg')
         new_module = self.pycore.create_module(src, 'pkg.mod')
         self.assertEquals(self.project.get_resource('src/pkg/mod.py'), new_module)
 
     def test_package_creation(self):
-        new_package = self.pycore.create_package(self.project.get_root_folder(), 'pkg')
+        new_package = self.pycore.create_package(self.project.root, 'pkg')
         self.assertTrue(new_package.is_folder())
         self.assertEquals(self.project.get_resource('pkg'), new_package)
         self.assertEquals(self.project.get_resource('pkg/__init__.py'),
                           new_package.get_child('__init__.py'));
 
     def test_nested_package_creation(self):
-        package = self.pycore.create_package(self.project.get_root_folder(), 'pkg1')
-        nested_package = self.pycore.create_package(self.project.get_root_folder(), 'pkg1.pkg2')
+        package = self.pycore.create_package(self.project.root, 'pkg1')
+        nested_package = self.pycore.create_package(self.project.root, 'pkg1.pkg2')
         self.assertEquals(self.project.get_resource('pkg1/pkg2'), nested_package)
 
     def test_packaged_package_creation_with_nested_src(self):
-        src = self.project.get_root_folder().create_folder('src')
+        src = self.project.root.create_folder('src')
         package = self.pycore.create_package(src, 'pkg1')
         nested_package = self.pycore.create_package(src, 'pkg1.pkg2')
         self.assertEquals(self.project.get_resource('src/pkg1/pkg2'), nested_package)
 
     def test_find_module(self):
-        src = self.project.get_root_folder().create_folder('src')
+        src = self.project.root.create_folder('src')