Mike Steder avatar Mike Steder committed bf1fd2d

Removing ropemacs

Comments (0)

Files changed (26)

ropemacs-0.6/CONTRIBUTORS

-=======================
- Ropemacs Contributors
-=======================
-
-* Sebastjan Trepca <trepca@gmail.com>
-* Stefan Reichoer <stefan@xsteve.at>

ropemacs-0.6/COPYING

-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.

ropemacs-0.6/MANIFEST.in

-include README.txt COPYING setup.py MANIFEST.in CONTRIBUTORS
-recursive-include ropemacs *.py
-recursive-include ropemode *.py
-recursive-include docs *.txt
-recursive-include docs *.patch

ropemacs-0.6/PKG-INFO

-Metadata-Version: 1.0
-Name: ropemacs
-Version: 0.6
-Summary: An emacs mode for using rope python refactoring library
-Home-page: http://rope.sf.net/ropemacs.html
-Author: Ali Gholami Rudi
-Author-email: aligrudi@users.sourceforge.net
-License: GNU GPL
-Description: 
-        =========================
-        ropemacs, rope in emacs
-        =========================
-        
-        Ropemacs is an emacs mode that uses rope_ library to provide features
-        like python refactorings and code-assists.  You should install rope_
-        library and pymacs_ before using ropemacs.
-        
-        .. _rope: http://rope.sf.net/
-        .. _pymacs: http://pymacs.progiciels-bpi.ca/pymacs.html
-        
-        
-        New Features
-        ============
-        
-        ``rope-find-occurrences`` sets ``next-error-function``.  That means
-        compilation mode keys like ``C-x \``` work for occurrences buffer,
-        too.
-        
-        Also there is a bug in pymacs 23 and 24-beta1 that makes python reach
-        maximum recursion after interrupting a pymacs command; a patch is
-        included in the docs folder.
-        
-        
-        
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Operating System :: OS Independent
-Classifier: Environment :: X11 Applications
-Classifier: Environment :: Win32 (MS Windows)
-Classifier: Environment :: MacOS X
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
-Classifier: Natural Language :: English
-Classifier: Programming Language :: Python
-Classifier: Topic :: Text Editors :: Emacs
-Classifier: Topic :: Software Development

ropemacs-0.6/README.txt

-=========================
- ropemacs, rope in emacs
-=========================
-
-Ropemacs is an emacs mode that uses rope_ library to provide features
-like python refactorings and code-assists.  You should install rope_
-library and pymacs_ before using ropemacs.
-
-.. _rope: http://rope.sf.net/
-.. _pymacs: http://pymacs.progiciels-bpi.ca/pymacs.html
-
-
-New Features
-============
-
-``rope-find-occurrences`` sets ``next-error-function``.  That means
-compilation mode keys like ``C-x \``` work for occurrences buffer,
-too.
-
-Also there is a bug in pymacs 23 and 24-beta1 that makes python reach
-maximum recursion after interrupting a pymacs command; a patch is
-included in the docs folder.
-
-
-Setting Up
-==========
-
-After installing pymacs, add these lines to your ``~/.emacs`` file::
-
-  (require 'pymacs)
-  (pymacs-load "ropemacs" "rope-")
-
-Note that rope and ropemacs should be in your ``PYTHONPATH`` for this
-to work.
-
-Loading Lazily
---------------
-
-If you want to load ropemacs only when you really need it, you can use
-a function like this in your ``~/.emacs``::
-
-  (defun load-ropemacs ()
-    "Load pymacs and ropemacs"
-    (interactive)
-    (require 'pymacs)
-    (pymacs-load "ropemacs" "rope-")
-    ;; Automatically save project python buffers before refactorings
-    (setq ropemacs-confirm-saving 'nil)
-  )
-  (global-set-key "\C-xpl" 'load-ropemacs)
-
-And execute ``load-ropemacs`` (or use ``C-x p l``) whenever you want
-to use ropemacs.
-
-
-Not Installing
---------------
-
-If you don't want to install rope library and ropemacs you can extract
-them somewhere and add these lines to your ``.emacs``::
-
-  ;; Add this before loading pymacs if you haven't installed rope and ropemacs
-  (setq pymacs-load-path '("/path/to/rope"
-                           "/path/to/ropemacs"))
-
-
-Multiple Python Versions
-------------------------
-
-Rope needs at least Python2.5.  If you have older versions of Python
-you can use ``PYMACS_PYTHON`` environment variable.  You can add::
-
-  (setenv "PYMACS_PYTHON" "python2.5")
-
-to force pymacs to use Python2.5.
-
-
-Ropemacs Minor Mode
--------------------
-
-Ropemacs registers its local keys when ``ropemacs-mode`` is enabled.
-By default it is enabled using ``python-mode`` hook (this hook is
-available if you are using Emacs' ``python.el`` or XEmacs'
-``python-mode.el``).  If you want to enable it in other major modes
-either execute ``ropemacs-mode`` manually or call it in some other
-hook.
-
-
-Getting Started
-===============
-
-Refactoring Dialog
-------------------
-
-Ropemacs refactorings use a special kind of dialog.  When you start a
-refactoring, you'll be asked to confirm saving modified python
-buffers; you can change it by using ``ropemacs-confirm-saving``
-variable.  Adding ``(setq ropemacs-confirm-saving 'nil)`` to your
-``.emacs`` file, will make emacs save them without asking.
-
-After that depending on the refactoring, you'll be asked about the
-essential information a refactoring needs to know (like the new name
-in rename refactoring).  You can skip it by prefixing the refactoring;
-this can be useful when using batchset command (described later).
-
-Next you'll see the base prompt of a refactoring dialog that shows
-something like "Choose what to do".  By entering the name of a
-refactoring option you can set its value.  After setting each option
-you'll be returned back to the base prompt.  Finally, you can ask rope
-to perform, preview or cancel the refactoring.
-
-See keybinding_ section and try the refactorings yourself.
-
-
-Finding Files
--------------
-
-By using ``rope-find-file`` (``C-x p f`` by default), you can search
-for files in your project.  When you complete the minibuffer you'll
-see all files in the project; files are shown as their reversed paths.
-For instance ``projectroot/docs/todo.txt`` is shown like
-``todo.txt<docs``.  This way you can find files faster in your
-project.  ``rope-find-file-other-window`` (``C-x p 4 f``) opens the
-file in the other window.  With prefix, these commands show python
-files only.
-
-
-Code-Assist
------------
-
-``rope-code-assist`` command (``M-/`` by default) will let you select
-from a list of completions.  If prefixed (``C-u M-/``), ropemacs
-inserts the common prefix, automatically.  If a numeric argument is
-given, ropemacs will insert the common prefix for that many of the
-first proposals.
-
-``rope-lucky-assist`` command (``M-?``) does not ask anything;
-instead, it inserts the first proposal.  By prefixing it, you can
-choose which proposal to insert.  ``C-u 1 M-?`` uses the second
-propsal, for instance.
-
-Here::
-
-  xxaa = None
-  xxab = None
-  xxba = None
-  xxbb = None
-
-  x^
-
-consider cursor is at ``^`` position.  This table shows what happens
-when code-assist commands are used:
-
-============  ==========  =======================
-Key           Inserts     Minibuffer Completions
-============  ==========  =======================
-M-/                       xxaa, xxab, xxba, xxbb
-C-u M-/       x           xxaa, xxab, xxba, xxbb
-C-u 2 M-/     xa          xxaa, xxab
-M-?           xaa
-C-u 1 M-/     xab
-C-u 3 M-/     xbb
-============  ==========  =======================
-
-
-Finding Occurrences
--------------------
-
-The find occurrences command (``C-c f`` by default) can be used to
-find the occurrences of a python name.  If ``unsure`` option is
-``yes``, it will also show unsure occurrences; unsure occurrences are
-indicated with a ``?`` mark in the end.
-
-
-Dialog ``batchset`` Command
----------------------------
-
-When you use ropemacs dialogs there is a command called ``batchset``.
-It can set many options at the same time.  After selecting this
-command from dialog base prompt, you are asked to enter a string.
-
-``batchset`` strings can set the value of configs in two ways.  The
-single line form is like this::
-
-  name1 value1
-  name2 value2
-
-That is the name of config is followed its value.  For multi-line
-values you can use::
-
-  name1
-   line1
-   line2
-
-  name2
-   line3
-
-Each line of the definition should start with a space or a tab.  Note
-that blank lines before the name of config definitions are ignored.
-
-``batchset`` command is useful when performing refactorings with long
-configs, like restructurings::
-
-  pattern ${pycore}.create_module(${project}.root, ${name})
-
-  goal generate.create_module(${project}, ${name})
-
-  imports
-   from rope.contrib import generate
-
-  args
-   pycore: type=rope.base.pycore.PyCore
-   project: type=rope.base.project.Project
-
-.. ignore the two-space indents
-
-This is a valid ``batchset`` string for restructurings.  When using
-batchset, you usually want to skip initial questions.  That can be
-done by prefixing refactorings.
-
-Just for the sake of completeness, the reverse of the above
-restructuring can be::
-
-  pattern ${create_module}(${project}, ${name})
-
-  goal ${project}.pycore.create_module(${project}.root, ${name})
-
-  args
-   create_module: name=rope.contrib.generate.create_module
-   project: type=rope.base.project.Project
-
-
-Enabling Autoimport
--------------------
-
-Ropemacs can propose and automatically import global names in other
-modules.  But this feature is disabled by default.  Before using it,
-you should add::
-
-  (setq ropemacs-enable-autoimport 't)
-
-to your ``~/.emacs`` file.  After enabling, rope maintains a cache of
-global names for each project.  It updates the cache only when modules
-are changed; if you want to cache all your modules at once, use
-``rope-generate-autoimport-cache``.  It will cache all of the modules
-inside the project plus those whose names are listed in
-``ropemacs-autoimport-modules`` list::
-
-  # add the name of modules you want to autoimport
-  (setq ropemacs-autoimport-modules '("os" "shutil"))
-
-Now if you are in a buffer that contains::
-
-  rmtree
-
-and you execute ``ropemacs-auto-import`` you'll end up with::
-
-  from shutil import rmtree
-  rmtree
-
-Also ``rope-code-assist`` and ``rope-lucky-assist`` propose
-auto-imported names by using ``name : module`` style.  Selecting them
-will import the module automatically.
-
-
-Filtering Resources
--------------------
-
-Some refactorings, restructuring and find occurrences take an option
-called resources.  This option can be used to limit the resources on
-which a refactoring should be applied.
-
-It uses a simple format: each line starts with either '+' or '-'.
-Each '+' means include the file (or its children if it's a folder)
-that comes after it.  '-' has the same meaning for exclusion.  So
-using::
-
-  +rope
-  +ropetest
-  -rope/contrib
-
-means include all python files inside ``rope`` and ``ropetest``
-folders and their subfolder, but those that are in ``rope/contrib``.
-Or::
-
-  -ropetest
-  -setup.py
-
-means include all python files inside the project but ``setup.py`` and
-those under ``ropetest`` folder.
-
-
-Variables
----------
-
-* ``ropemacs-confirm-saving``: If non-nil, you have to confirm saving all
-  modified python files before refactorings; otherwise they are saved
-  automatically. Defaults to ``t``.
-* ``ropemacs-codeassist-maxfixes``: The maximum number of syntax errors
-  to fix for code assists.  The default value is ``1``.
-* ``ropemacs-separate-doc-buffer``: Should ``rope-show-doc`` use a
-  separate buffer or the minibuffer.  Defaults to ``t``.
-* ``ropemacs-guess-project``: If non-nil, ropemacs tries to guess and
-  open the project that contains the file on which a rope command is
-  performed when no project is already opened.
-
-* ``ropemacs-local-prefix``: The prefix for ropemacs refactorings.
-  Defaults to ``C-c r``.
-* ``ropemacs-global-prefix``: The prefix for ropemacs project commands
-  Defaults to ``C-x p``.
-* ``ropemacs-enable-shortcuts``: Shows whether to bind ropemacs
-  shortcuts keys.  Defaults to ``t``.
-
-* ``ropemacs-enable-autoimport``: Shows whether to enable autoimport.
-  Defaults to ``nil``.
-* ``ropemacs-autoimport-modules``: The name of modules whose global
-  names should be cached.  ``rope-generate-autoimport-cache`` reads
-  this list and fills its cache.
-* ``ropemacs-autoimport-underlineds``: If set, autoimport will cache
-  names starting with underlines, too.
-
-
-Keybinding
-----------
-
-Uses almost the same keybinding as ropeide.  Note that global commands
-have a ``C-x p`` prefix and local commands have a ``C-c r`` prefix.
-You can change that (see variables_ section).
-
-================  ============================
-Key               Command
-================  ============================
-C-x p o           rope-open-project
-C-x p k           rope-close-project
-C-x p f           rope-find-file
-C-x p 4 f         rope-find-file-other_window
-C-x p u           rope-undo
-C-x p r           rope-redo
-C-x p c           rope-project-config
-C-x p n [mpfd]    rope-create-(module|package|file|directory)
-                  rope-write-project
-
-C-c r r           rope-rename
-C-c r l           rope-extract-variable
-C-c r m           rope-extract-method
-C-c r i           rope-inline
-C-c r v           rope-move
-C-c r x           rope-restructure
-C-c r u           rope-use-function
-C-c r f           rope-introduce-factory
-C-c r s           rope-change-signature
-C-c r 1 r         rope-rename-current-module
-C-c r 1 v         rope-move-current-module
-C-c r 1 p         rope-module-to-package
-
-C-c r o           rope-organize-imports
-C-c r n [vfcmp]   rope-generate-(variable|function|class|module|package)
-
-C-c r a /         rope-code-assist
-C-c r a g         rope-goto-definition
-C-c r a d         rope-show-doc
-C-c r a f         rope-find-occurrences
-C-c r a ?         rope-lucky-assist
-C-c r a j         rope-jump-to-global
-C-c r a c         rope-show-calltip
-                  rope-analyze-module
-
-                  rope-auto-import
-                  rope-generate-autoimport-cache
-===============   ============================
-
-
-Shortcuts
----------
-
-Some commands are used very frequently; specially the commands in
-code-assist group.  You can define your own shortcuts like this::
-
-  (define-key ropemacs-local-keymap "\C-cg" 'rope-goto-definition)
-
-Ropemacs itself comes with a few shortcuts.  These shortcuts will be
-used only when ropemacs-enable-shortcuts is non-nil.
-
-================  ============================
-Key               Command
-================  ============================
-M-/               rope-code-assist
-M-?               rope-lucky-assist
-C-c g             rope-goto-definition
-C-c d             rope-show-doc
-C-c f             rope-find-occurrences
-================  ============================
-
-
-Contributing
-============
-
-Send your bug reports, feature requests and patches to `rope-dev (at)
-googlegroups.com`_.
-
-.. _`rope-dev (at) googlegroups.com`: http://groups.google.com/group/rope-dev
-
-
-License
-=======
-
-This program is under the terms of GPL (GNU General Public License).
-Have a look at ``COPYING`` file for more information.

ropemacs-0.6/build/lib/ropemacs/__init__.py

-"""ropemacs, an emacs mode for using rope refactoring library"""
-import ropemode.decorators
-import ropemode.environment
-import ropemode.interface
-from Pymacs import lisp
-from rope.base import utils
-
-
-class LispUtils(ropemode.environment.Environment):
-
-    def ask(self, prompt, default=None, starting=None):
-        if default is not None:
-            prompt = prompt + ('[%s] ' % default)
-        result = lisp.read_from_minibuffer(prompt, starting, None, None,
-                                           None, default, None)
-        if result == '' and default is not None:
-            return default
-        return result
-
-    def ask_values(self, prompt, values, default=None, starting=None, exact=True):
-        if self._emacs_version() < 22:
-            values = [[value, value] for value in values]
-        if exact and default is not None:
-            prompt = prompt + ('[%s] ' % default)
-        reader = lisp['ropemacs-completing-read-function'].value()
-        result = reader(prompt, values, None, exact, starting)
-        if result == '' and exact:
-            return default
-        return result
-
-    def ask_completion(self, prompt, values, starting=None):
-        return self.ask_values(prompt, values, starting=starting, exact=None)
-
-    def ask_directory(self, prompt, default=None, starting=None):
-        location = starting or default
-        if location is not None:
-            prompt = prompt + ('[%s] ' % location)
-        if lisp.fboundp(lisp['read-directory-name']):
-            # returns default when starting is entered
-            result = lisp.read_directory_name(prompt, location, location)
-        else:
-            result = lisp.read_file_name(prompt, location, location)
-        if result == '' and location is not None:
-            return location
-        return result
-
-    def message(self, msg):
-        message(msg)
-
-    def yes_or_no(self, prompt):
-        return lisp.yes_or_no_p(prompt)
-
-    def y_or_n(self, prompt):
-        return lisp.y_or_n_p(prompt)
-
-    def get(self, name, default=None):
-        lispname = 'ropemacs-' + name.replace('_', '-')
-        if lisp.boundp(lisp[lispname]):
-            return lisp[lispname].value()
-        return default
-
-    def get_offset(self):
-        return lisp.point() - 1
-
-    def get_text(self):
-        end = lisp.buffer_size() + 1
-        old_min = lisp.point_min()
-        old_max = lisp.point_max()
-        narrowed = (old_min != 1 or old_max != end)
-        if narrowed:
-            lisp.narrow_to_region(1, lisp.buffer_size() + 1)
-        try:
-            return lisp.buffer_string()
-        finally:
-            if narrowed:
-                lisp.narrow_to_region(old_min, old_max)
-
-    def get_region(self):
-        offset1 = self.get_offset()
-        lisp.exchange_point_and_mark()
-        offset2 = self.get_offset()
-        lisp.exchange_point_and_mark()
-        return min(offset1, offset2), max(offset1, offset2)
-
-    def filename(self):
-        return lisp.buffer_file_name()
-
-    def is_modified(self):
-        return lisp.buffer_modified_p()
-
-    def goto_line(self, lineno):
-        lisp.goto_line(lineno)
-
-    def insert_line(self, line, lineno):
-        current = lisp.point()
-        lisp.goto_line(lineno)
-        lisp.insert(line + '\n')
-        lisp.goto_char(current + len(line) + 1)
-
-    def insert(self, text):
-        lisp.insert(text)
-
-    def delete(self, start, end):
-        lisp.delete_region(start, end)
-
-    def filenames(self):
-        result = []
-        for buffer in lisp.buffer_list():
-            filename = lisp.buffer_file_name(buffer)
-            if filename:
-                result.append(filename)
-        return result
-
-    def save_files(self, filenames):
-        ask = self.get('confirm_saving')
-        initial = lisp.current_buffer()
-        for filename in filenames:
-            buffer = lisp.find_buffer_visiting(filename)
-            if buffer:
-                if lisp.buffer_modified_p(buffer):
-                    if not ask or lisp.y_or_n_p('Save %s buffer?' % filename):
-                        lisp.set_buffer(buffer)
-                        lisp.save_buffer()
-        lisp.set_buffer(initial)
-
-    def reload_files(self, filenames, moves={}):
-        if self.filename() in moves:
-            initial = None
-        else:
-            initial = lisp.current_buffer()
-        for filename in filenames:
-            buffer = lisp.find_buffer_visiting(filename)
-            if buffer:
-                if filename in moves:
-                    lisp.kill_buffer(buffer)
-                    lisp.find_file(moves[filename])
-                else:
-                    lisp.set_buffer(buffer)
-                    lisp.revert_buffer(False, True)
-        if initial is not None:
-            lisp.set_buffer(initial)
-
-    def find_file(self, filename, readonly=False, other=False):
-        if other:
-            lisp.find_file_other_window(filename)
-        elif readonly:
-            lisp.find_file_read_only(filename)
-        else:
-            lisp.find_file(filename)
-
-    def _make_buffer(self, name, contents, empty_goto=True, switch=False,
-                     window='other', modes=[], fit_lines=None):
-        """Make an emacs buffer
-
-        `window` can be one of `None`, 'current' or 'other'.
-        """
-        new_buffer = lisp.get_buffer_create(name)
-        lisp.set_buffer(new_buffer)
-        lisp.toggle_read_only(-1)
-        lisp.erase_buffer()
-        if contents or empty_goto:
-            lisp.insert(contents)
-            for mode in modes:
-                lisp[mode + '-mode']()
-            lisp.buffer_disable_undo(new_buffer)
-            lisp.toggle_read_only(1)
-            if switch:
-                if window == 'current':
-                    lisp.switch_to_buffer(new_buffer)
-                else:
-                    lisp.switch_to_buffer_other_window(new_buffer)
-                lisp.goto_char(lisp.point_min())
-            elif window == 'other':
-                new_window = lisp.display_buffer(new_buffer)
-                lisp.set_window_point(new_window, lisp.point_min())
-                if fit_lines and lisp.fboundp(lisp['fit-window-to-buffer']):
-                    lisp.fit_window_to_buffer(new_window, fit_lines)
-                    lisp.bury_buffer(new_buffer)
-        return new_buffer
-
-    def _hide_buffer(self, name, delete=True):
-        buffer = lisp.get_buffer(name)
-        if buffer is not None:
-            window = lisp.get_buffer_window(buffer)
-            if window is not None:
-                lisp.bury_buffer(buffer)
-                if delete:
-                    lisp.delete_window(window)
-                else:
-                    if lisp.buffer_name(lisp.current_buffer()) == name:
-                        lisp.switch_to_buffer(None)
-
-    def _emacs_version(self):
-        return int(lisp['emacs-version'].value().split('.')[0])
-
-    def create_progress(self, name):
-        if lisp.fboundp(lisp['make-progress-reporter']):
-            progress = _LispProgress(name)
-        else:
-            progress = _OldProgress(name)
-        return progress
-
-    def current_word(self):
-        return lisp.current_word()
-
-    def push_mark(self):
-        lisp.push_mark()
-
-    def prefix_value(self, prefix):
-        return lisp.prefix_numeric_value(prefix)
-
-    def show_occurrences(self, locations):
-        text = ['List of occurrences:', '']
-        for location in locations:
-            line = '%s : %s   %s %s' % (location.filename, location.lineno,
-                                        location.note, location.offset)
-            text.append(line)
-        text = '\n'.join(text) + '\n'
-        buffer = self._make_buffer('*rope-occurrences*', text, switch=False)
-        lisp.set_buffer(buffer)
-        lisp.toggle_read_only(1)
-        lisp.set(lisp["next-error-function"], lisp.rope_occurrences_next)
-        lisp.local_set_key('\r', lisp.rope_occurrences_goto)
-        lisp.local_set_key('q', lisp.delete_window)
-
-    def show_doc(self, docs, altview=False):
-        use_minibuffer = not altview
-        if self.get('separate_doc_buffer'):
-            use_minibuffer = not use_minibuffer
-        if not use_minibuffer:
-            fit_lines = self.get('max_doc_buffer_height')
-            buffer = self._make_buffer('*rope-pydoc*', docs,
-                                       empty_goto=False,
-                                       fit_lines=fit_lines)
-            lisp.local_set_key('q', lisp.bury_buffer)
-        elif docs:
-            docs = '\n'.join(docs.split('\n')[:7])
-            self.message(docs)
-
-    def preview_changes(self, diffs):
-        self._make_buffer('*rope-preview*', diffs, switch=True,
-                          modes=['diff'], window='current')
-        try:
-            return self.yes_or_no('Do the changes? ')
-        finally:
-            self._hide_buffer('*rope-preview*', delete=False)
-
-    def local_command(self, name, callback, key=None, prefix=False):
-        globals()[name] = callback
-        self._set_interaction(callback, prefix)
-        if self.local_prefix and key:
-            key = self._key_sequence(self.local_prefix + ' ' + key)
-            self._bind_local(_lisp_name(name), key)
-
-    def _bind_local(self, name, key):
-        lisp('(define-key ropemacs-local-keymap "%s" \'%s)' %
-             (self._key_sequence(key), name))
-
-    def global_command(self, name, callback, key=None, prefix=False):
-        globals()[name] = callback
-        self._set_interaction(callback, prefix)
-        if self.global_prefix and key:
-            key = self._key_sequence(self.global_prefix + ' ' + key)
-            lisp.global_set_key(key, lisp[_lisp_name(name)])
-
-    def _key_sequence(self, sequence):
-        result = []
-        for key in sequence.split():
-            if key.startswith('C-'):
-                number = ord(key[-1].upper()) - ord('A') + 1
-                result.append(chr(number))
-            elif key.startswith('M-'):
-                number = ord(key[-1].upper()) + 0x80
-                result.append(chr(number))
-            else:
-                result.append(key)
-        return ''.join(result)
-
-    def _set_interaction(self, callback, prefix):
-        if hasattr(callback, 'im_func'):
-            callback = callback.im_func
-        if prefix:
-            callback.interaction = 'P'
-        else:
-            callback.interaction = ''
-
-    def add_hook(self, name, callback, hook):
-        mapping = {'before_save': 'before-save-hook',
-                   'after_save': 'after-save-hook',
-                   'exit': 'kill-emacs-hook'}
-        globals()[name] = callback
-        lisp.add_hook(lisp[mapping[hook]], lisp[_lisp_name(name)])
-
-    @property
-    @utils.saveit
-    def global_prefix(self):
-        return self.get('global_prefix')
-
-    @property
-    @utils.saveit
-    def local_prefix(self):
-        return self.get('local_prefix')
-
-
-def _lisp_name(name):
-    return 'rope-' + name.replace('_', '-')
-
-class _LispProgress(object):
-
-    def __init__(self, name):
-        self.progress = lisp.make_progress_reporter('%s ... ' % name, 0, 100)
-
-    def update(self, percent):
-        lisp.progress_reporter_update(self.progress, percent)
-
-    def done(self):
-        lisp.progress_reporter_done(self.progress)
-
-class _OldProgress(object):
-
-    def __init__(self, name):
-        self.name = name
-        self.update(0)
-
-    def update(self, percent):
-        if percent != 0:
-            message('%s ... %s%%%%' % (self.name, percent))
-        else:
-            message('%s ... ' % self.name)
-
-    def done(self):
-        message('%s ... done' % self.name)
-
-
-def message(message):
-    lisp.message(message.replace('%', '%%'))
-
-def occurrences_goto():
-    if lisp.line_number_at_pos() < 3:
-        lisp.forward_line(3 - lisp.line_number_at_pos())
-    lisp.end_of_line()
-    end = lisp.point()
-    lisp.beginning_of_line()
-    line = lisp.buffer_substring_no_properties(lisp.point(), end)
-    tokens = line.split()
-    if tokens:
-        filename = tokens[0]
-        offset = int(tokens[-1])
-        resource = _interface._get_resource(filename)
-        LispUtils().find_file(resource.real_path, other=True)
-        lisp.goto_char(offset + 1)
-occurrences_goto.interaction = ''
-
-def occurrences_next(arg, reset):
-    lisp.switch_to_buffer_other_window('*rope-occurrences*', True)
-    if reset:
-        lisp.goto_char(lisp.point_min())
-    lisp.forward_line(arg)
-    if lisp.eobp():
-        lisp.message("Cycling rope occurences")
-        lisp.goto_char(lisp.point_min())
-    occurrences_goto()
-occurrences_next.interaction = ''
-
-
-DEFVARS = """\
-(defgroup ropemacs nil
-  "ropemacs, an emacs plugin for rope."
-  :link '(url-link "http://rope.sourceforge.net/ropemacs.html")
-  :prefix "rope-")
-
-(defcustom ropemacs-confirm-saving t
-  "Shows whether to confirm saving modified buffers before refactorings.
-
-If non-nil, you have to confirm saving all modified
-python files before refactorings; otherwise they are
-saved automatically.")
-
-(defcustom ropemacs-codeassist-maxfixes 1
-  "The number of errors to fix before code-assist.
-
-How many errors to fix, at most, when proposing code completions.")
-
-(defcustom ropemacs-separate-doc-buffer t
-  "Should `rope-show-doc' use a separate buffer or the minibuffer.")
-(defcustom ropemacs-max-doc-buffer-height 22
-  "The maximum buffer height for `rope-show-doc'.")
-
-(defcustom ropemacs-enable-autoimport 'nil
-  "Specifies whether autoimport should be enabled.")
-(defcustom ropemacs-autoimport-modules nil
-  "The name of modules whose global names should be cached.
-
-The `rope-generate-autoimport-cache' reads this list and fills its
-cache.")
-(defcustom ropemacs-autoimport-underlineds 'nil
-  "If set, autoimport will cache names starting with underlines, too.")
-
-(defcustom ropemacs-completing-read-function (if (and (boundp 'ido-mode)
-                                                      ido-mode)
-                                                 'ido-completing-read
-                                               'completing-read)
-  "Function to call when prompting user to choose between a list of options.
-This should take the same arguments as `completing-read'.
-Possible values are `completing-read' and `ido-completing-read'.
-Note that you must set `ido-mode' if using`ido-completing-read'."
-  :type 'function)
-
-(make-obsolete-variable
-  'rope-confirm-saving 'ropemacs-confirm-saving)
-(make-obsolete-variable
-  'rope-code-assist-max-fixes 'ropemacs-codeassist-maxfixes)
-
-(defcustom ropemacs-local-prefix "C-c r"
-  "The prefix for ropemacs refactorings.
-
-Use nil to prevent binding keys.")
-
-(defcustom ropemacs-global-prefix "C-x p"
-  "The prefix for ropemacs project commands.
-
-Use nil to prevent binding keys.")
-
-(defcustom ropemacs-enable-shortcuts 't
-  "Shows whether to bind ropemacs shortcuts keys.
-
-If non-nil it binds:
-
-================  ============================
-Key               Command
-================  ============================
-M-/               rope-code-assist
-C-c g             rope-goto-definition
-C-c d             rope-show-doc
-C-c f             rope-find-occurrences
-M-?               rope-lucky-assist
-================  ============================
-")
-
-(defvar ropemacs-local-keymap (make-sparse-keymap))
-
-(easy-menu-define ropemacs-mode-menu ropemacs-local-keymap
-"`ropemacs' menu"
-                  '("Rope"
-                    ["Code assist" rope-code-assist t]
-                    ["Lucky assist" rope-lucky-assist t]
-                    ["Goto definition" rope-goto-definition t]
-                    ["Jump to global" rope-jump-to-global t]
-                    ["Show documentation" rope-show-doc t]
-                    ["Find Occurrences" rope-find-occurrences t]
-                    ["Analyze module" rope-analyze-module t]
-                    ("Refactor"
-                      ["Inline" rope-inline t]
-                      ["Extract Variable" rope-extract-variable t]
-                      ["Extract Method" rope-extract-method t]
-                      ["Organize Imports" rope-organize-imports t]
-                      ["Rename" rope-rename t]
-                      ["Move" rope-move t]
-                      ["Restructure" rope-restructure t]
-                      ["Use Function" rope-use-function t]
-                      ["Introduce Factory" rope-introduce-factory t]
-                      ("Generate"
-                        ["Class" rope-generate-class t]
-                        ["Function" rope-generate-function t]
-                        ["Module" rope-generate-module t]
-                        ["Package" rope-generate-package t]
-                        ["Variable" rope-generate-variable t]
-                      )
-                      ("Module"
-                        ["Module to Package" rope-module-to-package t]
-                        ["Rename Module" rope-rename-current-module t]
-                        ["Move Module" rope-move-current-module t]
-                      )
-                      "--"
-                      ["Undo" rope-undo t]
-                      ["Redo" rope-redo t]
-                    )
-                    ("Project"
-                      ["Open project" rope-open-project t]
-                      ["Close project" rope-close-project t]
-                      ["Find file" rope-find-file t]
-                      ["Open project config" rope-project-config t]
-                    )
-                    ("Create"
-                      ["Module" rope-create-module t]
-                      ["Package" rope-create-package t]
-                      ["File" rope-create-file t]
-                      ["Directory" rope-create-directory t]
-                    )
-                    ))
-
-(defcustom ropemacs-guess-project 'nil
-  "Try to guess the project when needed.
-
-If non-nil, ropemacs tries to guess and open the project that contains
-a file on which the rope command is performed when no project is
-already opened.")
-
-(provide 'ropemacs)
-"""
-
-MINOR_MODE = """\
-(define-minor-mode ropemacs-mode
- "ropemacs, rope in emacs!" nil " Rope" ropemacs-local-keymap
-  :global nil)
-)
-"""
-
-shortcuts = [('M-/', 'rope-code-assist'),
-             ('M-?', 'rope-lucky-assist'),
-             ('C-c g', 'rope-goto-definition'),
-             ('C-c d', 'rope-show-doc'),
-             ('C-c f', 'rope-find-occurrences')]
-
-
-ropemode.decorators.logger.message = message
-lisp(DEFVARS)
-_interface = ropemode.interface.RopeMode(env=LispUtils())
-_interface.init()
-lisp(MINOR_MODE)
-
-for key, command in shortcuts:
-    LispUtils()._bind_local(command, key)
-
-lisp.add_hook(lisp['python-mode-hook'], lisp['ropemacs-mode'])

ropemacs-0.6/build/lib/ropemode/__init__.py

-"""ropemode, a helper for using rope refactoring library in IDEs"""
-
-COPYRIGHT = """\
-Copyright (C) 2007-2008 Ali Gholami Rudi
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of GNU General Public License as published by the
-Free Software Foundation; either version 2 of the license, or (at your
-opinion) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details."""

ropemacs-0.6/build/lib/ropemode/decorators.py

-import traceback
-
-from rope.base import exceptions
-
-
-class Logger(object):
-
-    message = None
-    only_short = False
-
-    def __call__(self, message, short=None):
-        if short is None or not self.only_short:
-            self._show(message)
-        if short is not None:
-            self._show(short)
-
-    def _show(self, message):
-        if message is None:
-            print message
-        else:
-            self.message(message)
-
-logger = Logger()
-
-
-def lisphook(func):
-    def newfunc(*args, **kwds):
-        try:
-            func(*args, **kwds)
-        except Exception, e:
-            trace = str(traceback.format_exc())
-            short = 'Ignored an exception in ropemode hook: %s' % \
-                    _exception_message(e)
-            logger(trace, short)
-    newfunc.lisp = None
-    newfunc.__name__ = func.__name__
-    newfunc.__doc__ = func.__doc__
-    return newfunc
-
-
-def lispfunction(func):
-    func.lisp = None
-    return func
-
-
-input_exceptions = (exceptions.RefactoringError,
-                    exceptions.ModuleSyntaxError,
-                    exceptions.BadIdentifierError)
-
-def _exception_handler(func):
-    def newfunc(*args, **kwds):
-        try:
-            func(*args, **kwds)
-        except exceptions.RopeError, e:
-            short = None
-            if isinstance(e, input_exceptions):
-                short = _exception_message(e)
-            logger(str(traceback.format_exc()), short)
-    newfunc.__name__ = func.__name__
-    newfunc.__doc__ = func.__doc__
-    return newfunc
-
-def _exception_message(e):
-    return '%s: %s' % (e.__class__.__name__, str(e))
-
-def rope_hook(hook):
-    def decorator(func):
-        func = lisphook(func)
-        func.name = func.__name__
-        func.kind = 'hook'
-        func.hook = hook
-        return func
-    return decorator
-
-
-def local_command(key=None, prefix=False, shortcut=None, name=None):
-    def decorator(func, name=name):
-        func = _exception_handler(func)
-        func.kind = 'local'
-        func.prefix = prefix
-        func.local_key = key
-        func.shortcut_key = shortcut
-        if name is None:
-            name = func.__name__
-        func.name = name
-        return func
-    return decorator
-
-
-def global_command(key=None, prefix=False):
-    def decorator(func):
-        func = _exception_handler(func)
-        func.kind = 'global'
-        func.prefix = prefix
-        func.global_key = key
-        func.name = func.__name__
-        return func
-    return decorator

ropemacs-0.6/build/lib/ropemode/dialog.py

-class Data(object):
-
-    def __init__(self, prompt=None, default=None, values=None,
-                 kind=None, decode=None):
-        self.prompt = prompt
-        self.default = default
-        self.values = values
-        self.kind = kind
-        self._decode = decode
-
-    def decode(self, value):
-        if self._decode:
-            return self._decode(value)
-        return value
-
-
-class Boolean(Data):
-
-    def __init__(self, prompt=None, default=False):
-        Data.__init__(self, prompt, self._encode(default),
-                      [self._encode(True), self._encode(False)])
-
-    def _encode(self, value):
-        if value:
-            return 'yes'
-        return 'no'
-
-    def decode(self, value):
-        if value.lower() in ('yes', '1', 'true'):
-            return True
-        return False
-
-
-def show_dialog(askdata, actions, confs={}, optionals={}, initial_asking=True):
-    result = {}
-    if initial_asking:
-        for name, conf in confs.items():
-            result[name] = askdata(conf)
-    actions.append('batchset')
-    names = list(actions)
-    names.extend(optionals.keys())
-    names.extend(confs.keys())
-    base_question = Data('Choose what to do: ',
-                         default=actions[0], values=names)
-    batchset_question = Data('Batch sets: ')
-    while True:
-        response = askdata(base_question)
-        if response == '':
-            response = base_question.default
-        elif response == 'batchset':
-            sets = askdata(batchset_question)
-            for key, value in _parse_batchset(sets).items():
-                if key.endswith(':'):
-                    key = key[:-1]
-                if key in names:
-                    conf = confs.get(key, optionals.get(key))
-                    result[key] = value
-        elif response in actions:
-            break
-        else:
-            if response in confs:
-                conf = confs[response]
-            else:
-                conf = optionals[response]
-            oldvalue = result.get(response, None)
-            result[response] = askdata(conf, starting=oldvalue)
-    decoded = {}
-    all_confs = dict(confs)
-    all_confs.update(optionals)
-    for key in all_confs:
-        conf = all_confs.get(key)
-        if key in result:
-            decoded[key] = conf.decode(result[key])
-        else:
-            decoded[key] = conf.decode(conf.default)
-    return response, decoded
-
-
-def _parse_batchset(sets):
-    result = []
-    multiline = False
-    for line in sets.splitlines(True):
-        if line[0].isspace():
-            if multiline:
-                result[-1][1] += line[1:]
-        else:
-            if not line.strip():
-                continue
-            multiline= False
-            tokens = line.split(None, 1)
-            value = ''
-            if len(tokens) > 1:
-                result.append([tokens[0], tokens[1].rstrip('\r\n')])
-            else:
-                multiline = True
-                result.append([tokens[0], ''])
-    return dict(result)

ropemacs-0.6/build/lib/ropemode/environment.py

-class Environment(object):
-
-    def ask(self, prompt, default=None, starting=None):
-        pass
-
-    def ask_values(self, prompt, values, default=None, starting=None):
-        pass
-
-    def ask_directory(self, prompt, default=None, starting=None):
-        pass
-
-    def ask_completion(self, prompt, values, starting=None):
-        pass
-
-    def message(self, message):
-        pass
-
-    def yes_or_no(self, prompt):
-        pass
-
-    def y_or_n(self, prompt):
-        pass
-
-    def get(self, name, default=None):
-        pass
-
-    def get_offset(self):
-        pass
-
-    def get_text(self):
-        pass
-
-    def get_region(self):
-        pass
-
-    def filename(self):
-        pass
-
-    def is_modified(self):
-        pass
-
-    def goto_line(self, lineno):
-        pass
-
-    def insert_line(self, line, lineno):
-        pass
-
-    def insert(self, text):
-        pass
-
-    def delete(self, start, end):
-        pass
-
-    def filenames(self):
-        pass
-
-    def save_files(self, filenames):
-        pass
-
-    def reload_files(self, filenames, moves={}):
-        pass
-
-    def find_file(self, filename, readonly=False, other=False):
-        pass
-
-    def create_progress(self, name):
-        pass
-
-    def current_word(self):
-        pass
-
-    def push_mark(self):
-        pass
-
-    def prefix_value(self, prefix):
-        pass
-
-    def show_occurrences(self, locations):
-        pass
-
-    def show_doc(self, docs, altview=False):
-        pass
-
-    def preview_changes(self, diffs):
-        pass
-
-    def local_command(self, name, callback, key=None, prefix=False):
-        pass
-
-    def global_command(self, name, callback, key=None, prefix=False):
-        pass
-
-    def add_hook(self, name, callback, hook):
-        pass

ropemacs-0.6/build/lib/ropemode/filter.py

-from rope.base import exceptions
-
-
-def resources(project, rules):
-    """Find python files in the `project` matching `rules`
-
-    `rules` is a multi-line `str`; each line starts with either a '+'
-    or '-'.  Each '+' means include the file (or its children if it's
-    a folder) that comes after it.  '-' has the same meaning for
-    exclusion.
-
-    """
-    all = set(project.pycore.get_python_files())
-    files = None
-    for line in rules.splitlines():
-        if not line.strip():
-            continue
-        first, path = (line[0], line[1:])
-        if first not in '+-':
-            continue
-        try:
-            resource = project.get_resource(path.strip())
-        except exceptions.ResourceNotFoundError:
-            continue
-        if resource.is_folder():
-            matches = set(filter(lambda item: resource.contains(item), all))
-        else:
-            matches = set([resource])
-        if first == '+':
-            if files is None:
-                files = set()
-            files.update(matches)
-        if first == '-':
-            if files is None:
-                files = set(all)
-            files -= matches
-    if files is None:
-        return all
-    return files

ropemacs-0.6/build/lib/ropemode/interface.py

-import os
-
-import rope.base.change
-from rope.base import libutils
-from rope.contrib import codeassist, generate, autoimport, findit
-
-from ropemode import refactor, decorators, dialog
-
-
-class RopeMode(object):
-
-    def __init__(self, env):
-        self.project = None
-        self.old_content = None
-        self.env = env
-
-        self._prepare_refactorings()
-        self.autoimport = None
-        self._init_mode()
-
-    def init(self):
-        """Initialize rope mode"""
-
-    def _init_mode(self):
-        for attrname in dir(self):
-            attr = getattr(self, attrname)
-            if not callable(attr):
-                continue
-            kind = getattr(attr, 'kind', None)
-            if kind == 'local':
-                key = getattr(attr, 'local_key', None)
-                prefix = getattr(attr, 'prefix', None)
-                self.env.local_command(attrname, attr, key, prefix)
-            if kind == 'global':
-                key = getattr(attr, 'global_key', None)
-                prefix = getattr(attr, 'prefix', None)
-                self.env.global_command(attrname, attr, key, prefix)
-            if kind == 'hook':
-                hook = getattr(attr, 'hook', None)
-                self.env.add_hook(attrname, attr, hook)
-
-    def _prepare_refactorings(self):
-        for name in dir(refactor):
-            if not name.startswith('_') and name != 'Refactoring':
-                attr = getattr(refactor, name)
-                if isinstance(attr, type) and \
-                   issubclass(attr, refactor.Refactoring):
-                    refname = self._refactoring_name(attr)
-                    @decorators.local_command(attr.key, 'P', None, refname)
-                    def do_refactor(prefix, self=self, refactoring=attr):
-                        initial_asking = prefix is None
-                        refactoring(self, self.env).show(initial_asking=initial_asking)
-                    setattr(self, refname, do_refactor)
-
-    def _refactoring_name(self, refactoring):
-        return refactor.refactoring_name(refactoring)
-
-    @decorators.rope_hook('before_save')
-    def before_save_actions(self):
-        if self.project is not None:
-            if not self._is_python_file(self.env.filename()):
-                return
-            resource = self._get_resource()
-            if resource.exists():
-                self.old_content = resource.read()
-            else:
-                self.old_content = ''
-
-    @decorators.rope_hook('after_save')
-    def after_save_actions(self):
-        if self.project is not None and self.old_content is not None:
-            libutils.report_change(self.project, self.env.filename(),
-                                   self.old_content)
-            self.old_content = None
-
-    @decorators.rope_hook('exit')
-    def exiting_actions(self):
-        if self.project is not None:
-            self.close_project()
-
-    @decorators.global_command('o')
-    def open_project(self, root=None):
-        if not root:
-            root = self.env.ask_directory('Rope project root folder: ')
-        if self.project is not None:
-            self.close_project()
-        progress = self.env.create_progress('Opening [%s] project' % root)
-        self.project = rope.base.project.Project(root)
-        if self.env.get('enable_autoimport'):
-            underlined = self.env.get('autoimport_underlineds')
-            self.autoimport = autoimport.AutoImport(self.project,
-                                                    underlined=underlined)
-        progress.done()
-
-    @decorators.global_command('k')
-    def close_project(self):
-        if self.project is not None:
-            progress = self.env.create_progress('Closing [%s] project' %
-                                                self.project.address)
-            self.project.close()
-            self.project = None
-            progress.done()
-
-    @decorators.global_command()
-    def write_project(self):
-        if self.project is not None:
-            progress = self.env.create_progress(
-                'Writing [%s] project data to disk' % self.project.address)
-            self.project.sync()
-            progress.done()
-
-    @decorators.global_command('u')
-    def undo(self):
-        self._check_project()
-        change = self.project.history.tobe_undone
-        if change is None:
-            self.env.message('Nothing to undo!')
-            return
-        if self.env.y_or_n('Undo [%s]? ' % str(change)):
-            def undo(handle):
-                for changes in self.project.history.undo(task_handle=handle):
-                    self._reload_buffers(changes, undo=True)
-            refactor.runtask(self.env, undo, 'Undo refactoring',
-                             interrupts=False)
-
-    @decorators.global_command('r')
-    def redo(self):
-        self._check_project()
-        change = self.project.history.tobe_redone
-        if change is None:
-            self.env.message('Nothing to redo!')
-            return
-        if self.env.y_or_n('Redo [%s]? ' % str(change)):
-            def redo(handle):
-                for changes in self.project.history.redo(task_handle=handle):
-                    self._reload_buffers(changes)
-            refactor.runtask(self.env, redo, 'Redo refactoring',
-                             interrupts=False)
-
-    @decorators.local_command('a g', shortcut='C-c g')
-    def goto_definition(self):
-        self._check_project()
-        resource, offset = self._get_location()
-        maxfixes = self.env.get('codeassist_maxfixes')
-        definition = codeassist.get_definition_location(
-            self.project, self._get_text(), offset, resource, maxfixes)
-        if tuple(definition) != (None, None):
-            self.env.push_mark()
-            self._goto_location(definition[0], definition[1])
-        else:
-            self.env.message('Cannot find the definition!')
-
-    @decorators.local_command('a d', 'P', 'C-c d')
-    def show_doc(self, prefix):
-        self._check_project()
-        self._base_show_doc(prefix, codeassist.get_doc)
-
-    @decorators.local_command('a c', 'P')
-    def show_calltip(self, prefix):
-        self._check_project()
-        def _get_doc(project, text, offset, *args, **kwds):
-            try:
-                offset = text.rindex('(', 0, offset) - 1
-            except ValueError:
-                return None
-            return codeassist.get_calltip(project, text, offset, *args, **kwds)
-        self._base_show_doc(prefix, _get_doc)
-
-    def _base_show_doc(self, prefix, get_doc):
-        maxfixes = self.env.get('codeassist_maxfixes')
-        text = self._get_text()
-        offset = self.env.get_offset()
-        docs = get_doc(self.project, text, offset,
-                       self._get_resource(), maxfixes)
-        self.env.show_doc(docs, prefix)
-        if docs is None:
-            self.env.message('No docs avilable!')
-
-    def _get_text(self):
-        if not self.env.is_modified():
-            return self._get_resource().read()
-        return self.env.get_text()
-
-    def _base_findit(self, do_find, optionals, get_kwds):
-        self._check_project()
-        self._save_buffers()
-        resource, offset = self._get_location()
-
-        action, values = dialog.show_dialog(
-            self._askdata, ['search', 'cancel'], optionals=optionals)
-        if action == 'search':
-            kwds = get_kwds(values)
-            def calculate(handle):
-                resources = refactor._resources(self.project,
-                                                values.get('resources'))
-                return do_find(self.project, resource, offset,
-                               resources=resources, task_handle=handle, **kwds)
-            result = refactor.runtask(self.env, calculate, 'Find Occurrences')
-            locations = [Location(location) for location in result]
-            self.env.show_occurrences(locations)
-
-    @decorators.local_command('a f', shortcut='C-c f')
-    def find_occurrences(self):
-        optionals = {
-            'unsure': dialog.Data('Find uncertain occurrences: ',
-                                  default='no', values=['yes', 'no']),
-            'resources': dialog.Data('Files to search: '),
-            'in_hierarchy': dialog.Data(
-                    'Rename methods in class hierarchy: ',
-                    default='no', values=['yes', 'no'])}
-        def get_kwds(values):
-            return {'unsure': values.get('unsure') == 'yes',
-                    'in_hierarchy': values.get('in_hierarchy') == 'yes'}
-        self._base_findit(findit.find_occurrences, optionals, get_kwds)
-
-    @decorators.local_command('a i')
-    def find_implementations(self):
-        optionals = {'resources': dialog.Data('Files to search: ')}
-        def get_kwds(values):
-            return {}
-        self._base_findit(findit.find_implementations, optionals, get_kwds)
-
-    @decorators.local_command('a /', 'P', 'M-/')
-    def code_assist(self, prefix):
-        _CodeAssist(self, self.env).code_assist(prefix)
-
-    @decorators.local_command('a ?', 'P', 'M-?')
-    def lucky_assist(self, prefix):
-        _CodeAssist(self, self.env).lucky_assist(prefix)
-
-    @decorators.local_command()
-    def auto_import(self):
-        _CodeAssist(self, self.env).auto_import()
-
-    def _check_autoimport(self):
-        self._check_project()
-        if self.autoimport is None:
-            self.env.message('autoimport is disabled; '
-                             'see `enable_autoimport\' variable')
-            return False
-        return True
-
-    @decorators.global_command()
-    def generate_autoimport_cache(self):
-        if not self._check_autoimport():
-            return
-        modules = self.env.get('autoimport_modules')
-        modnames = []
-        if modules:
-            for i in range(len(modules)):
-                modname = modules[i]
-                if not isinstance(modname, basestring):
-                    modname = modname.value()
-                modnames.append(modname)
-        def generate(handle):
-            self.autoimport.generate_cache(task_handle=handle)
-            self.autoimport.generate_modules_cache(modules, task_handle=handle)
-        refactor.runtask(self.env, generate, 'Generate autoimport cache')
-
-    @decorators.global_command('f', 'P')
-    def find_file(self, prefix):
-        file = self._base_find_file(prefix)
-        if file is not None:
-            self.env.find_file(file.real_path)
-
-    @decorators.global_command('4 f', 'P')
-    def find_file_other_window(self, prefix):
-        file = self._base_find_file(prefix)
-        if file is not None:
-            self.env.find_file(file.real_path, other=True)
-
-    def _base_find_file(self, prefix):
-        self._check_project()
-        if prefix:
-            files = self.project.pycore.get_python_files()
-        else:
-            files = self.project.get_files()
-        return self._ask_file(files)
-
-    def _ask_file(self, files):
-        names = []
-        for file in files:
-            names.append('<'.join(reversed(file.path.split('/'))))
-        result = self.env.ask_values('Rope Find File: ', names)
-        if result is not None:
-            path = '/'.join(reversed(result.split('<')))
-            file = self.project.get_file(path)
-            return file
-        self.env.message('No file selected')
-
-    @decorators.local_command('a j')
-    def jump_to_global(self):
-        if not self._check_autoimport():
-            return
-        all_names = list(self.autoimport.get_all_names())
-        name = self.env.ask_values('Global name: ', all_names)
-        result = dict(self.autoimport.get_name_locations(name))
-        if len(result) == 1:
-            resource = list(result.keys())[0]
-        else:
-            resource = self._ask_file(result.keys())
-        if resource:
-            self._goto_location(resource, result[resource])
-
-    @decorators.global_command('c')
-    def project_config(self):
-        self._check_project()
-        if self.project.ropefolder is not None:
-            config = self.project.ropefolder.get_child('config.py')
-            self.env.find_file(config.real_path)
-        else:
-            self.env.message('No rope project folder found')
-
-    @decorators.global_command('n m')
-    def create_module(self):
-        def callback(sourcefolder, name):
-            return generate.create_module(self.project, name, sourcefolder)
-        self._create('module', callback)
-
-    @decorators.global_command('n p')
-    def create_package(self):
-        def callback(sourcefolder, name):
-            folder = generate.create_package(self.project, name, sourcefolder)
-            return folder.get_child('__init__.py')
-        self._create('package', callback)
-
-    @decorators.global_command('n f')
-    def create_file(self):
-        def callback(parent, name):
-            return parent.create_file(name)
-        self._create('file', callback, 'parent')
-
-    @decorators.global_command('n d')
-    def create_directory(self):
-        def callback(parent, name):
-            parent.create_folder(name)
-        self._create('directory', callback, 'parent')
-
-    @decorators.local_command()
-    def analyze_module(self):
-        """Perform static object analysis on this module"""
-        self._check_project()
-        resource = self._get_resource()
-        self.project.pycore.analyze_module(resource)
-
-    @decorators.global_command()
-    def analyze_modules(self):
-        """Perform static object analysis on all project modules"""
-        self._check_project()
-        def _analyze_modules(handle):
-            libutils.analyze_modules(self.project, task_handle=handle)
-        refactor.runtask(self.env, _analyze_modules, 'Analyze project modules')
-
-    @decorators.local_command()
-    def run_module(self):
-        """Run and perform dynamic object analysis on this module"""
-        self._check_project()
-        resource = self._get_resource()
-        process = self.project.pycore.run_module(resource)
-        try:
-            process.wait_process()
-        finally:
-            process.kill_process()
-
-    def _create(self, name, callback, parentname='source'):
-        self._check_project()
-        confs = {'name': dialog.Data(name.title() + ' name: ')}
-        parentname = parentname + 'folder'
-        optionals = {parentname: dialog.Data(
-                parentname.title() + ' Folder: ',
-                default=self.project.address, kind='directory')}
-        action, values = dialog.show_dialog(
-            self._askdata, ['perform', 'cancel'], confs, optionals)
-        if action == 'perform':
-            parent = libutils.path_to_resource(
-                self.project, values.get(parentname, self.project.address))
-            resource = callback(parent, values['name'])
-            if resource:
-                self.env.find_file(resource.real_path)
-
-    def _goto_location(self, resource, lineno):
-        if resource:
-            self.env.find_file(str(resource.real_path),
-                               resource.project != self.project)
-        if lineno:
-            self.env.goto_line(lineno)
-
-    def _get_location(self):
-        resource = self._get_resource()
-        offset = self.env.get_offset()
-        return resource, offset
-
-    def _get_resource(self, filename=None):
-        if filename is None:
-            filename = self.env.filename()
-        if filename is None:
-            return
-        resource = libutils.path_to_resource(self.project, filename, 'file')
-        return resource
-
-    def _check_project(self):
-        if self.project is None:
-            if self.env.get('guess_project'):
-                self.open_project(self._guess_project())
-            else:
-                self.open_project()
-        else:
-            self.project.validate(self.project.root)
-
-    def _guess_project(self):
-        cwd = self.env.filename()
-        if cwd is not None:
-            while True:
-                ropefolder = os.path.join(cwd, '.ropeproject')
-                if os.path.exists(ropefolder) and os.path.isdir(ropefolder):
-                    return cwd