Skip to content

Commit 16c1620

Browse files
committed
Rename variable.
1 parent eca5bbd commit 16c1620

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

README.markdown

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,15 @@ Activate python virtual environment. Tramp paths are supported.
121121

122122
Deactivate python virtual environment.
123123

124+
## Project settings
124125

125-
## Project overrides with .dir-locals
126-
You can change the default docker file and set a default
127-
container to run the pythonic commands in with these dir-locals.
126+
You can change the default docker-compose file name and set a default
127+
service name to run the pythonic commands.
128+
129+
Add these lines to the `.dir-locals.el` file in the project root
130+
directory.
128131

129132
```lisp
130133
((python . ((pythonic-docker-compose-filename . "local.yml")
131-
(pythonic-docker-compose-container-name . "footprint"))))
134+
(pythonic-docker-compose-service-name . "web"))))
132135
```

pythonic.el

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; pythonic.el --- Utility functions for writing pythonic emacs package. -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2015-2018 by Artem Malyshev
3+
;; Copyright (C) 2015-2019 by Artem Malyshev
44

55
;; Author: Artem Malyshev <proofit404@gmail.com>
66
;; URL: https://github.com/proofit404/pythonic
@@ -32,6 +32,10 @@
3232
(require 's)
3333
(require 'f)
3434

35+
(defgroup pythonic nil
36+
"Utility functions for writing pythonic emacs package."
37+
:group 'python)
38+
3539

3640
;;; Connection predicates.
3741

@@ -153,8 +157,15 @@ format."
153157

154158
;;; Docker Compose.
155159

156-
(defvar pythonic-docker-compose-filename "docker-compose.yml")
157-
(defvar pythonic-docker-compose-container-name nil)
160+
(defcustom pythonic-docker-compose-filename "docker-compose.yml"
161+
"File name of the docker-compose project file."
162+
:type 'string
163+
:safe 'stringp)
164+
165+
(defcustom pythonic-docker-compose-service-name nil
166+
"Name of the default service to execute commands."
167+
:type 'string
168+
:safe 'stringp)
158169

159170
(defvar pythonic-read-docker-compose-file-code "
160171
from __future__ import print_function
@@ -222,8 +233,8 @@ print(json.dumps(yaml.safe_load(open(sys.argv[-1], 'r'))))
222233
;; should appears once in the selection and all volumes
223234
;; should be added to the alias list.
224235
(volume (if (< 1 (length volumes))
225-
(if pythonic-docker-compose-container-name
226-
pythonic-docker-compose-container-name
236+
(if pythonic-docker-compose-service-name
237+
pythonic-docker-compose-service-name
227238
(assoc (completing-read "Service: " (mapcar 'car volumes) nil t) volumes))
228239
(car volumes)))
229240
(service (car volume))

0 commit comments

Comments
 (0)