Commits

Ali Gholami Rudi  committed b6e8c27

ropeide: renamed dot_rope to dot_ropeide

  • Participants
  • Parent commits c4b0677

Comments (0)

Files changed (7)

File docs/dev/issues.txt

 candidates before the ``x.y``.
 
 
-Version 0.7
+Version 0.8
 ===========
 
-From August 6, 2007 till October 28, 2007
+From November 2, 2007
 
 
 Release Goals
 * Should `rope.base` be thread safe? which parts?
 
 
+Cross-Project Refactorings
+==========================
+
+We might want to perform a refactoring on more than one project.
+
+Approach #1
+-----------
+
+Adding `ProjectBag`::
+
+  class ProjectBag(object):
+      pass
+
+  class PyCoreBag(object):
+      pass
+
+  class HistoryBag(object):
+      pass
+
+
+Issues:
+
+* Implementing `ProjectBag` and `PyCoreBag`
+* Changing checks like ``resource.project == resource.no_project()``
+  with ``resource.project != project``
+* When saving objects SOI we should consider resource in other
+  projects like `NoProject` resources
+* Using history on different projects
+
+Approach #2
+-----------
+
+Passing all projects to refactorings:
+
+Approach #3
+-----------
+
+Actually we can do that even now.  What we should do is to add the
+dependency projects to the class path and try to apply the refactoring
+for each dependent project.  The dependencies don't change but the
+dependants do.  After that we can apply the refactoring on the
+dependencies.
+
+
 Distributing Refactorings
 =========================
 

File docs/dev/stories.txt

 * Generate ~/.rope graphically
 
 
-* Performing refactorings across multiple projects
+> Public Release 0.7.1
 
 
 * ropemacs: only activating keybinding in python files
 
 
-* ropemacs: auto-complete
-
-
 * ropemacs: previewing changes
 
 
 * ropemacs: showing refactoring progress
 
 
+* ropemacs: specifying refactoring options
+
+
 * ropemacs: adding a menu
 
 
-* ropemacs: specifying refactoring options
+* Performing refactorings across multiple projects
 
 
-> Public Release 0.7 : November 2, 2007
+* ropemacs: find file dialog
+
+
+* ropemacs: auto-complete

File docs/dev/workingon.txt

-Plans For New Packages
-======================
+Working On
+==========
 
-* Separating rope and ropeide version numbers?
+* Caching `PyCore.get_source_folders()`
+
+  - Does not take time when the root folder contains packages
+  - It doesn't get notified when a folder gets created

File docs/done.txt

 ===========
 
 
+> Public Release 0.7 : November 1, 2007
+
+
 - ropemacs: moving elements, methods and modules : October 30, 2007
 
 

File ropeide/core.py

 
 
 def write_dot_rope(dot_rope):
-    import ropeide.dot_rope
+    import ropeide.dot_ropeide
     import inspect
-    text = inspect.getsource(ropeide.dot_rope)
+    text = inspect.getsource(ropeide.dot_ropeide)
     output = open(dot_rope, 'w')
     output.write(text)
     output.close()

File ropeide/dot_rope.py

-# The default ~/.ropeide file for *ropeide*.
-#
-# You can edit this file to change some of rope's preferences.  If
-# you like you can edit this file using rope itself.
-# (``edit_dot_ropeide`` in execute command or ``Edit ~/.ropeide``
-# in ``Edit`` menu.)
-#
-# Note: Since this file is not inside a project you cannot perform
-#   refactorings on it.
-#
-
-
-def starting_rope(core):
-    """Change rope preferences.
-
-    This function is called when rope starts.
-
-    """
-
-    # Changing editor font
-    #core.set('font', ('Courier', 16))
-    #core.set('font', ('Bitstream Vera Sans Mono', 16))
-
-    # Changing font for other parts
-    core.set('menu_font', ('Courier', 12, 'bold'))
-    core.set('statusbar_font', ('Courier', 12))
-    core.set('editorlist_font', ('Courier', 12))
-
-    # Hiding menu bar
-    #core.set('show_menu_bar', False)
-
-    # Hiding buffer list
-    #core.set('show_buffer_list', False)
-
-    # Hiding status bar
-    #core.set('show_status_bar', False)
-
-
-    # If you don't like emacs keybindings, change this to False
-    i_like_emacs = True
-    if not i_like_emacs:
-        _change_to_nonemacs_keybinding(core)
-
-    # The key used for prefixing actions
-    #core.set('action_prefix', 'C-u')
-
-
-    # Add your python templates
-    core.add('templates', ('say_hello', "print 'Hello, my name is ${name}'\n"))
-    core.add('templates', ('set_field', "self.${field}${cursor} = ${field}\n"))
-
-
-    # The folder relative to project root that holds config files and
-    # information about the project.  If this folder does not exist it is
-    # created.  Specifying `None` means do not make and use a rope folder.
-    #core.set('project_rope_folder', '.ropeproject')
-
-    # You can register your own actions
-    _register_my_actions(core)
-
-
-def _register_my_actions(core):
-    # Adding your own `Action`\s:
-    # If you're interested in adding your own actions to rope you can do so
-    # like this.
-    # Plugins can use this interface for registering their actions.  For
-    # more information see `rope.ui.extension` module.
-    from ropeide.extension import SimpleAction
-
-    def say_hello(context):
-        print('Hello Action!')
-
-    hello_action = SimpleAction('hello_action', say_hello, 'C-h h')
-    core.register_action(hello_action)
-
-    # A more advanced example that uses `Tkinter`
-    def rope_info(context):
-        import gc
-        import Tkinter
-        import rope.base.pyobjects
-
-        info = 'Rope Running Info\n=================\n\n'
-        info += 'Rope version %s\n\n' % rope.VERSION
-        info += str(context.project.history) + '\n'
-        module_count = 0
-        for obj in gc.get_objects():
-            # Checking the real type; not isinstance
-            if type(obj) in (rope.base.pyobjects.PyModule,
-                             rope.base.pyobjects.PyPackage):
-                module_count += 1
-        info += 'Memory contains %s PyModules\n' % module_count
-        info += str(context.project.pycore) + '\n'
-
-        toplevel = Tkinter.Toplevel()
-        toplevel.title('Rope Running Info')
-        label = Tkinter.Label(toplevel, text=info, height=10, width=50,
-                              justify=Tkinter.LEFT, relief=Tkinter.GROOVE)
-        label.grid(row=0)
-        def ok():
-            toplevel.destroy()
-        ok_button = Tkinter.Button(toplevel, text='OK', command=ok, width=20)
-        ok_button.grid(row=1)
-        ok_button.focus_set()
-        toplevel.bind('<Escape>', lambda event: ok())
-        toplevel.bind('<Control-g>', lambda event: ok())
-        toplevel.bind('<Return>', lambda event: ok())
-
-    info_action = SimpleAction('rope_info', rope_info, 'C-h i')
-    core.register_action(info_action)
-
-    # Alternatively you can put your actions in an extension module
-    # and register the module using `Core.add_extension()`.  When
-    # rope starts it loads all extension modules.  You should register
-    # your actions when the module is loading
-    #core.add_extension('my.extension.module')
-
-
-def _change_to_nonemacs_keybinding(core):
-    # file actions
-    core.rebind_action('open_project', 'C-P')
-    core.rebind_action('close_project', None)
-    core.rebind_action('create_file', None)
-    core.rebind_action('create_folder', None)
-    core.rebind_action('create_module', None)
-    core.rebind_action('create_package', None)
-    core.rebind_action('project_tree', 'M-Q r')
-    core.rebind_action('validate_project', 'F5')
-    core.rebind_action('edit_project_config', None)
-    core.rebind_action('sync_project', None)
-    core.rebind_action('find_file', 'C-R')
-    core.rebind_action('find_type', 'C-T')
-    core.rebind_action('change_buffer', 'C-E')
-    core.rebind_action('save_buffer', 'C-s')
-    core.rebind_action('save_all_buffers', 'C-S')
-    core.rebind_action('close_buffer', 'C-w')
-    core.rebind_action('exit', 'C-W')
-
-    core.rebind_action('undo_project', 'C-Z')
-    core.rebind_action('redo_project', 'C-Y')
-    core.rebind_action('project_history', None)
-    core.rebind_action('current_file_history', None)
-
-    # edit actions
-    core.rebind_action('set_mark', None)
-    core.rebind_action('copy', 'C-c')
-    core.rebind_action('cut', 'C-x')
-    core.rebind_action('paste', 'C-v')
-    core.rebind_action('yank', None)
-    core.rebind_action('goto_line', 'C-l')
-    core.rebind_action('goto_last_edit_location', 'C-q')
-    core.rebind_action('swap_mark_and_insert', None)
-    core.rebind_action('undo', 'C-z')
-    core.rebind_action('redo', 'C-y')
-    core.rebind_action('repeat_last_action', None)
-    core.rebind_action('search_forward', 'C-f')
-    core.rebind_action('search_backward', 'C-F')
-    core.rebind_action('edit_dot_ropeide', None)
-    core.rebind_action('execute_command', None)
-
-    # source actions
-    core.rebind_action('correct_line_indentation', 'C-i')
-    core.rebind_action('show_codetags', None)
-    core.rebind_action('show_errors', None)
-    core.rebind_action('show_warnings', None)
-    core.rebind_action('show_annotations', None)
-    core.rebind_action('format_code', 'C-F')
-    core.rebind_action('comment_line', 'C-3')
-    core.rebind_action('comment_region', None)
-    core.rebind_action('generate_variable', 'M-G v')
-    core.rebind_action('generate_function', 'M-G f')
-    core.rebind_action('generate_class', 'M-G c')
-    core.rebind_action('generate_module', 'M-G m')
-    core.rebind_action('generate_package', 'M-G g')
-    core.rebind_action('memorize_location', 'M-M m')
-    core.rebind_action('remember_location', 'M-M b')
-    core.rebind_action('memorize_string', 'M-M s')
-    core.rebind_action('remember_string', 'M-M i')
-    core.rebind_action('spellcheck_word', None)
-    core.rebind_action('spellcheck_buffer', None)
-    core.rebind_action('spellcheck_region', None)
-    core.rebind_action('sort_by_alpha', None)
-    core.rebind_action('sort_by_kind', None)
-    core.rebind_action('sort_by_pydoc', None)
-    core.rebind_action('sort_by_underlined', None)
-    core.rebind_action('sort_by_special', None)
-
-    core.rebind_action('code_assist', 'C-space')
-    core.rebind_action('goto_definition', 'F3')
-    core.rebind_action('show_doc', 'F2')
-    core.rebind_action('quick_outline', 'C-o')
-    core.rebind_action('find_occurrences', 'C-G')
-    core.rebind_action('run_module', 'M-X p')
-    core.rebind_action('run_unit_tests', 'M-X t')
-    core.rebind_action('run_soi', 'M-X s')
-
-    # refactorings
-    core.rebind_action('rename', 'M-R')
-    core.rebind_action('move', 'M-V')
-    core.rebind_action('extract_method', 'M-M')
-    core.rebind_action('inline', 'M-I')
-    core.rebind_action('extract_local_variable', 'M-L')
-    core.rebind_action('rename_in_file', None)
-    core.rebind_action('change_signature', 'M-C')
-    core.rebind_action('introduce_factory', None)
-    core.rebind_action('encapsulate_field', None)
-    core.rebind_action('change_occurrences', None)
-    core.rebind_action('local_to_field', None)
-    core.rebind_action('inline_argument_default', None)
-    core.rebind_action('introduce_parameter', None)
-    core.rebind_action('method_object', None)
-    core.rebind_action('module_to_package', None)
-    core.rebind_action('rename_current_module', None)
-    core.rebind_action('move_current_module', None)
-    core.rebind_action('restructure', None)
-    # import actions
-    core.rebind_action('organize_imports', 'C-O')
-    core.rebind_action('expand_star_imports', None)
-    core.rebind_action('relatives_to_absolutes', None)
-    core.rebind_action('froms_to_imports', None)
-    core.rebind_action('handle_long_imports', None)
-
-    # help actions
-    core.rebind_action('readme', None)
-    core.rebind_action('features', None)
-    core.rebind_action('overview', None)
-    core.rebind_action('tutorial', None)
-    core.rebind_action('contributing', None)
-    core.rebind_action('library', None)
-    core.rebind_action('about', None)
-
-    # other actions
-    core.rebind_action('prev_word', 'C-Left')
-    core.rebind_action('next_word', 'C-Right')
-    core.rebind_action('lower_next_word', None)
-    core.rebind_action('upper_next_word', None)
-    core.rebind_action('capitalize_next_word', None)
-    core.rebind_action('goto_center_line', None)
-    core.rebind_action('prev_statement', None)
-    core.rebind_action('next_statement', None)
-    core.rebind_action('prev_scope', 'C-Up')
-    core.rebind_action('next_scope', 'C-Down')

File ropeide/dot_ropeide.py

+# The default ~/.ropeide file for *ropeide*.
+#
+# You can edit this file to change some of rope's preferences.  If
+# you like you can edit this file using rope itself.
+# (``edit_dot_ropeide`` in execute command or ``Edit ~/.ropeide``
+# in ``Edit`` menu.)
+#
+# Note: Since this file is not inside a project you cannot perform
+#   refactorings on it.
+#
+
+
+def starting_rope(core):
+    """Change rope preferences.
+
+    This function is called when rope starts.
+
+    """
+
+    # Changing editor font
+    #core.set('font', ('Courier', 16))
+    #core.set('font', ('Bitstream Vera Sans Mono', 16))
+
+    # Changing font for other parts
+    core.set('menu_font', ('Courier', 12, 'bold'))
+    core.set('statusbar_font', ('Courier', 12))
+    core.set('editorlist_font', ('Courier', 12))
+
+    # Hiding menu bar
+    #core.set('show_menu_bar', False)
+
+    # Hiding buffer list
+    #core.set('show_buffer_list', False)
+
+    # Hiding status bar
+    #core.set('show_status_bar', False)
+
+
+    # If you don't like emacs keybindings, change this to False
+    i_like_emacs = True
+    if not i_like_emacs:
+        _change_to_nonemacs_keybinding(core)
+
+    # The key used for prefixing actions
+    #core.set('action_prefix', 'C-u')
+
+
+    # Add your python templates
+    core.add('templates', ('say_hello', "print 'Hello, my name is ${name}'\n"))
+    core.add('templates', ('set_field', "self.${field}${cursor} = ${field}\n"))
+
+
+    # The folder relative to project root that holds config files and
+    # information about the project.  If this folder does not exist it is
+    # created.  Specifying `None` means do not make and use a rope folder.
+    #core.set('project_rope_folder', '.ropeproject')
+
+    # You can register your own actions
+    _register_my_actions(core)
+
+
+def _register_my_actions(core):
+    # Adding your own `Action`\s:
+    # If you're interested in adding your own actions to rope you can do so
+    # like this.
+    # Plugins can use this interface for registering their actions.  For
+    # more information see `rope.ui.extension` module.
+    from ropeide.extension import SimpleAction
+
+    def say_hello(context):
+        print('Hello Action!')
+
+    hello_action = SimpleAction('hello_action', say_hello, 'C-h h')
+    core.register_action(hello_action)
+
+    # A more advanced example that uses `Tkinter`
+    def rope_info(context):
+        import gc
+        import Tkinter
+        import rope.base.pyobjects
+
+        info = 'Rope Running Info\n=================\n\n'
+        info += 'Rope version %s\n\n' % rope.VERSION
+        info += str(context.project.history) + '\n'
+        module_count = 0
+        for obj in gc.get_objects():
+            # Checking the real type; not isinstance
+            if type(obj) in (rope.base.pyobjects.PyModule,
+                             rope.base.pyobjects.PyPackage):
+                module_count += 1
+        info += 'Memory contains %s PyModules\n' % module_count
+        info += str(context.project.pycore) + '\n'
+
+        toplevel = Tkinter.Toplevel()
+        toplevel.title('Rope Running Info')
+        label = Tkinter.Label(toplevel, text=info, height=10, width=50,
+                              justify=Tkinter.LEFT, relief=Tkinter.GROOVE)
+        label.grid(row=0)
+        def ok():
+            toplevel.destroy()
+        ok_button = Tkinter.Button(toplevel, text='OK', command=ok, width=20)
+        ok_button.grid(row=1)
+        ok_button.focus_set()
+        toplevel.bind('<Escape>', lambda event: ok())
+        toplevel.bind('<Control-g>', lambda event: ok())
+        toplevel.bind('<Return>', lambda event: ok())
+
+    info_action = SimpleAction('rope_info', rope_info, 'C-h i')
+    core.register_action(info_action)
+
+    # Alternatively you can put your actions in an extension module
+    # and register the module using `Core.add_extension()`.  When
+    # rope starts it loads all extension modules.  You should register
+    # your actions when the module is loading
+    #core.add_extension('my.extension.module')
+
+
+def _change_to_nonemacs_keybinding(core):
+    # file actions
+    core.rebind_action('open_project', 'C-P')
+    core.rebind_action('close_project', None)
+    core.rebind_action('create_file', None)
+    core.rebind_action('create_folder', None)
+    core.rebind_action('create_module', None)
+    core.rebind_action('create_package', None)
+    core.rebind_action('project_tree', 'M-Q r')
+    core.rebind_action('validate_project', 'F5')
+    core.rebind_action('edit_project_config', None)
+    core.rebind_action('sync_project', None)
+    core.rebind_action('find_file', 'C-R')
+    core.rebind_action('find_type', 'C-T')
+    core.rebind_action('change_buffer', 'C-E')
+    core.rebind_action('save_buffer', 'C-s')
+    core.rebind_action('save_all_buffers', 'C-S')
+    core.rebind_action('close_buffer', 'C-w')
+    core.rebind_action('exit', 'C-W')
+
+    core.rebind_action('undo_project', 'C-Z')
+    core.rebind_action('redo_project', 'C-Y')
+    core.rebind_action('project_history', None)
+    core.rebind_action('current_file_history', None)
+
+    # edit actions
+    core.rebind_action('set_mark', None)
+    core.rebind_action('copy', 'C-c')
+    core.rebind_action('cut', 'C-x')
+    core.rebind_action('paste', 'C-v')
+    core.rebind_action('yank', None)
+    core.rebind_action('goto_line', 'C-l')
+    core.rebind_action('goto_last_edit_location', 'C-q')
+    core.rebind_action('swap_mark_and_insert', None)
+    core.rebind_action('undo', 'C-z')
+    core.rebind_action('redo', 'C-y')
+    core.rebind_action('repeat_last_action', None)
+    core.rebind_action('search_forward', 'C-f')
+    core.rebind_action('search_backward', 'C-F')
+    core.rebind_action('edit_dot_ropeide', None)
+    core.rebind_action('execute_command', None)
+
+    # source actions
+    core.rebind_action('correct_line_indentation', 'C-i')
+    core.rebind_action('show_codetags', None)
+    core.rebind_action('show_errors', None)
+    core.rebind_action('show_warnings', None)
+    core.rebind_action('show_annotations', None)
+    core.rebind_action('format_code', 'C-F')
+    core.rebind_action('comment_line', 'C-3')
+    core.rebind_action('comment_region', None)
+    core.rebind_action('generate_variable', 'M-G v')
+    core.rebind_action('generate_function', 'M-G f')
+    core.rebind_action('generate_class', 'M-G c')
+    core.rebind_action('generate_module', 'M-G m')
+    core.rebind_action('generate_package', 'M-G g')
+    core.rebind_action('memorize_location', 'M-M m')
+    core.rebind_action('remember_location', 'M-M b')
+    core.rebind_action('memorize_string', 'M-M s')
+    core.rebind_action('remember_string', 'M-M i')
+    core.rebind_action('spellcheck_word', None)
+    core.rebind_action('spellcheck_buffer', None)
+    core.rebind_action('spellcheck_region', None)
+    core.rebind_action('sort_by_alpha', None)
+    core.rebind_action('sort_by_kind', None)
+    core.rebind_action('sort_by_pydoc', None)
+    core.rebind_action('sort_by_underlined', None)
+    core.rebind_action('sort_by_special', None)
+
+    core.rebind_action('code_assist', 'C-space')
+    core.rebind_action('goto_definition', 'F3')
+    core.rebind_action('show_doc', 'F2')
+    core.rebind_action('quick_outline', 'C-o')
+    core.rebind_action('find_occurrences', 'C-G')
+    core.rebind_action('run_module', 'M-X p')
+    core.rebind_action('run_unit_tests', 'M-X t')
+    core.rebind_action('run_soi', 'M-X s')
+
+    # refactorings
+    core.rebind_action('rename', 'M-R')
+    core.rebind_action('move', 'M-V')
+    core.rebind_action('extract_method', 'M-M')
+    core.rebind_action('inline', 'M-I')
+    core.rebind_action('extract_local_variable', 'M-L')
+    core.rebind_action('rename_in_file', None)
+    core.rebind_action('change_signature', 'M-C')
+    core.rebind_action('introduce_factory', None)
+    core.rebind_action('encapsulate_field', None)
+    core.rebind_action('change_occurrences', None)
+    core.rebind_action('local_to_field', None)
+    core.rebind_action('inline_argument_default', None)
+    core.rebind_action('introduce_parameter', None)
+    core.rebind_action('method_object', None)
+    core.rebind_action('module_to_package', None)
+    core.rebind_action('rename_current_module', None)
+    core.rebind_action('move_current_module', None)
+    core.rebind_action('restructure', None)
+    # import actions
+    core.rebind_action('organize_imports', 'C-O')
+    core.rebind_action('expand_star_imports', None)
+    core.rebind_action('relatives_to_absolutes', None)
+    core.rebind_action('froms_to_imports', None)
+    core.rebind_action('handle_long_imports', None)
+
+    # help actions
+    core.rebind_action('readme', None)
+    core.rebind_action('features', None)
+    core.rebind_action('overview', None)
+    core.rebind_action('tutorial', None)
+    core.rebind_action('contributing', None)
+    core.rebind_action('library', None)
+    core.rebind_action('about', None)
+
+    # other actions
+    core.rebind_action('prev_word', 'C-Left')
+    core.rebind_action('next_word', 'C-Right')
+    core.rebind_action('lower_next_word', None)
+    core.rebind_action('upper_next_word', None)
+    core.rebind_action('capitalize_next_word', None)
+    core.rebind_action('goto_center_line', None)
+    core.rebind_action('prev_statement', None)
+    core.rebind_action('next_statement', None)
+    core.rebind_action('prev_scope', 'C-Up')
+    core.rebind_action('next_scope', 'C-Down')