Skip to content

Commit

Permalink
include formatting for vim
Browse files Browse the repository at this point in the history
  • Loading branch information
uermel committed Apr 5, 2024
1 parent 796a609 commit cc0cf93
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/map_data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# vim: set expandtab shiftwidth=4 softtabstop=4:
2 changes: 2 additions & 0 deletions src/map_data/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# vim: set expandtab shiftwidth=4 softtabstop=4:

UNITFACTOR = {
"angstrom": 1.0,
"attometer": 1e-8,
Expand Down
1 change: 1 addition & 0 deletions src/util/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# vim: set expandtab shiftwidth=4 softtabstop=4:
10 changes: 4 additions & 6 deletions src/util/env.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# vim: set expandtab shiftwidth=4 softtabstop=4:

import os
import sys
import subprocess
import sys
from typing import Dict


# On Macs the environment of applications can be very different from that in shells, so this convenience function can
# be used to source a file and return the environment that results from sourcing it.
# From: https://stackoverflow.com/a/47080959
def env_from_sourcing(file_to_source_path, include_unexported_variables=False):

a = {}
if os.path.isfile(file_to_source_path):
command = f"source {file_to_source_path} && env"
for line in subprocess.getoutput(command).split("\n"):
kv = line.split("=")
k = kv[0]
if len(kv) > 1:
v = kv[1]
else:
v = ""
v = kv[1] if len(kv) > 1 else ""
a[k] = v

return a
Expand Down

0 comments on commit cc0cf93

Please sign in to comment.