Skip to content
Austin Bingham edited this page Dec 24, 2015 · 5 revisions

emacs-traad is the emacs client for using the traa Python refactoring server.

Simple installation

For many emacs users, the simplest way to install the server and client is with package.el and the traad-install-server command. From inside Emacs, first install traad:

M-x package-install<RET>traad

or, using elisp:

(package-install "traad")

When that finishes, you can install the Python server component with traad-install-server:

M-x traad-install-server

This will install the server into a virtual environment using python-environment.el <https://github.com/tkf/emacs-python-environment>_. The value of python-environment-directory will determine where the virtual environment is created. By default it's ~/.emacs.d/.python-environments.

The name of the virtual environment is "traad" by default, but you can control this by setting traad-environment-root.

The command used to create the virtual environment is in python-environment-virtualenv by default. You can control it by setting traad-environment-virtualenv.

Supporting multiple versions of traad


If you need to support multiple versions of traad (e.g. Python 2 and
Python 3), you can do this by running `traad-install-server` multiple
times with different `traad-environment-root` and
`traad-environment-virtualenv` values. The
`traad-environment-virtualenv` setting can control which version of
Python is being used, and this in turn controls which version of
Python will be supported by the installed `traad` server.

Once you've got two installations of traad, you can switch between
them by changing `traad-environment-root` and restarting the server.

For example:
```
;; First install for Python 2
(setq traad-environment-root "traad")
(setq traad-environment-virtualenv '("virtualenv-2.7"))
(traad-install-server)

;; Then install for Python 3
(setq traad-environment-root "traad3")
(setq traad-environment-virtualenv '("virtualenv-3.4"))
(traad-install-server)

;; To use Python 2
(setq traad-environment-root "traad")
(traad-open "/some/python2/project")
. . . do some refactorings . . .

;; To use Python 3
(setq traad-environment-root "traad3")
(traad-open "/some/python3/project")
. . . do some refactorings . . .
```

## Installation from source

If you can't or don't want to use the emacs package, then you can
install directly from the source code.

To install the elisp components, copy `traad.el` into your
emacs load-path and call `(require 'traad)` somewhere in your emacs
startup. You can get more details in the documentation in `traad.el`
itself.

Make sure, of course, to install the traad dependencies as well. They
are listed in the `Package-Requires` header in `traad.el`.
Clone this wiki locally