Questions tagged [rope]

Rope is a python refactoring library that is useful for renaming or restructuring python classes / methods / variables / constants. Not to be confused with the [tag:ropes] data structure.

Rope is a python refactoring library that is useful for renaming or restructuring python classes / methods / variables / constants. Not to be confused with the data structure.

61 questions
4
votes
1 answer

Rope / Ropemacs - Auto Import feature

I'm using Rope and Ropemacs to transform my emacs as a IDE for Python. I have a problem with the rope-auto-import feature. I read in the doc that I must add modules that I want to autoimport like this: (setq ropemacs-autoimport-modules '("os"…
Sandro Munda
  • 39,921
  • 24
  • 98
  • 123
3
votes
1 answer

Why I can't use auto-complete for python modules in emacs

I have been trying to use emacs as a python IDE, I have tried many step-by-step examples to do it. But I have some trouble for function completion. Now I have auto complete (with tab completion) for local variables and snippets from yasnippets, but…
Muhammet Can
  • 1,304
  • 2
  • 16
  • 30
3
votes
0 answers

Preventing the creating of .ropeproject when using "Rename Symbol" in VSCode

I'm using VSCode, with the Python extension. When renaming symbols (using rope), a folder called .ropeproject is created; I don't want this. I know that to prevent this from happening, I need to pass None to rope. However, I don't know how to pass…
3
votes
2 answers

convert python print statements to logging

I'm working on a large codebase that uses print statements for logging rather than python logging. I'm wondering if there is a recommended for converting all these print statements to calls to logging.info? Many of these prints are spread over…
Brock Haywood
  • 516
  • 2
  • 10
3
votes
1 answer

Using ropemacs for autocompletion with python.el in Emacs

How do I set up auto-complete to use ropemacs with python.el in Emacs 24? I have the following in my .emacs file ; Auto-complete: ; -------------------------- (add-to-list 'load-path "~/.emacs.d/auto-complete/auto-complete-1.3.1") (require…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
3
votes
1 answer

How do I do cross-project refactorings with ropemacs?

I have a file structure that looks something like this: project1_root/ tests/ ... src/ .ropeproject/ project1/ ... (project1 source code) project2_root/ tests/ ... src/ …
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
2
votes
0 answers

Code autocompletion using ropemacs on opencv python bindings

I'm wondering if there's a get rope-code-assist working on the cv namespace of openCV import cv2.cv as cv cv.LoadImage So far I get [no match]. Is there something else I need to do? The cv2.pyd is in the PYTHONPATH and has been built from the…
octi
  • 1,470
  • 1
  • 17
  • 28
2
votes
1 answer

How to load ropevim only when editing Python files

I'm using ropevim for some operations on Python files, and vimclojure for Clojure files and REPL. VimClojure only loaded when editing Clojure files, but ropevim loaded for every file, and this addons have some same keybindigs, so for example, when…
sinan
  • 6,809
  • 6
  • 38
  • 67
2
votes
1 answer

How to rename packages using python-rope

I've found documentation and experimented with python-rope to rename a module in Python. However, when it comes to renaming the whole package, there doesn't seem to be documentation available. Do we grab the package's __init__ file as the…
Jinghui Niu
  • 990
  • 11
  • 28
2
votes
1 answer

Why does ropevim throw a TypeError?

Whenever I use any function in RopeVim, Vim shows me the following error at the end of the stack trace: Type error: Got inexpected keyword argument 'verbose' And I really have got no clue whatsoever on what is causing it.
actionAxolot
  • 485
  • 5
  • 16
2
votes
0 answers

How do I match multiple arguments in rope?

Note: rope is a tool for building Python refactoring into editors like Emacs and vim. It can also be used directly to execute refactors outside of an editor. I'm trying to apply a restructuring to a function taking a variable number of arguments,…
qff
  • 5,524
  • 3
  • 37
  • 62
2
votes
0 answers

How to make rope aware that an instance attribute is of a certain type

I am using Python 2.7 and want to do some refactoring using rope (via python-mode in vim). I have a class containing the method I want to refactor and another class which has an instance attribute containing an instance of the first class. Assume I…
Tim
  • 1,430
  • 15
  • 36
2
votes
1 answer

Ropevim not working: AttributeError: 'NoneType' object has no attribute 'pycore'

On an Ubuntu 12.04, with Vim 7.4, rope 0.10.2, ropemode 0.2 and ropevim 0.5.0 When I try to create a new Rope project (using the :RopeRename command), I always get the error AttributeError: 'NoneType' object has no attribute 'pycore' I have tried…
NicolasWebDev
  • 305
  • 1
  • 14
2
votes
0 answers

Make rope project aware of core libraries

I'm working on a large code base and I'd like to set up rope projects so that rope is fast and does what I want. For what it's worth, I'm using rope with emacs, but if I understand correctly, rope's behavior should be independent of the editor. The…
dinosaur
  • 3,164
  • 4
  • 28
  • 40
2
votes
1 answer

RopeGenerateAutoimportCache on vim startup

I seem to have to run RopeGenerateAutoimportCache every time I open my python project in vim before RopeAutoImport will work. If I run RopeAutoImport before caching the projects modules I get the following error: Global name my_func not found! Is…
Brendan Maguire
  • 4,188
  • 4
  • 24
  • 28