File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -120,3 +120,13 @@ Activate python virtual environment. Tramp paths are supported.
120120### pythonic-deactivate
121121
122122Deactivate python virtual environment.
123+
124+
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.
128+
129+ ``` lisp
130+ ((python . ((pythonic-docker-compose-filename . "local.yml")
131+ (pythonic-docker-compose-container-name . "footprint"))))
132+ ```
Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ format."
154154; ;; Docker Compose.
155155
156156(defvar pythonic-docker-compose-filename " docker-compose.yml" )
157+ (defvar pythonic-docker-compose-container-name nil )
157158
158159(defvar pythonic-read-docker-compose-file-code "
159160from __future__ import print_function
@@ -208,6 +209,7 @@ print(json.dumps(yaml.safe_load(open(sys.argv[-1], 'r'))))
208209
209210(defun pythonic-set-docker-compose-alias ()
210211 " Build alias string for current docker-compose project."
212+ (hack-dir-local-variables-non-file-buffer )
211213 (unless
212214 (or (tramp-tramp-file-p default-directory)
213215 (pythonic-has-alias-p default-directory))
@@ -220,7 +222,9 @@ print(json.dumps(yaml.safe_load(open(sys.argv[-1], 'r'))))
220222 ; ; should appears once in the selection and all volumes
221223 ; ; should be added to the alias list.
222224 (volume (if (< 1 (length volumes))
223- (assoc (completing-read " Service: " (mapcar 'car volumes) nil t ) volumes)
225+ (if pythonic-docker-compose-container-name
226+ pythonic-docker-compose-container-name
227+ (assoc (completing-read " Service: " (mapcar 'car volumes) nil t ) volumes))
224228 (car volumes)))
225229 (service (car volume))
226230 (sub-project (f-join project (cadr volume)))
You can’t perform that action at this time.
0 commit comments