summaryrefslogtreecommitdiff
path: root/.emacs.d.back/.python-environments/default/bin/activate_this.py
diff options
context:
space:
mode:
authorRoger Gonzalez <rogergonzalez21@gmail.com>2020-04-08 10:38:14 -0300
committerRoger Gonzalez <rogergonzalez21@gmail.com>2020-04-08 10:38:14 -0300
commit5f0f2f90361a4c0a76478b288998595fc3ddebd2 (patch)
treefba8d30e376187e1b0b441314497bb1a70989f08 /.emacs.d.back/.python-environments/default/bin/activate_this.py
parent47e1414d1be0069b158d0d0718988d72b0fb5d0d (diff)
Added my old emacs config
Diffstat (limited to '.emacs.d.back/.python-environments/default/bin/activate_this.py')
-rw-r--r--.emacs.d.back/.python-environments/default/bin/activate_this.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/.emacs.d.back/.python-environments/default/bin/activate_this.py b/.emacs.d.back/.python-environments/default/bin/activate_this.py
new file mode 100644
index 00000000..444d3fd3
--- /dev/null
+++ b/.emacs.d.back/.python-environments/default/bin/activate_this.py
@@ -0,0 +1,36 @@
+"""By using execfile(this_file, dict(__file__=this_file)) you will
+activate this virtualenv environment.
+
+This can be used when you must use an existing Python interpreter, not
+the virtualenv bin/python
+"""
+
+try:
+ __file__
+except NameError:
+ raise AssertionError(
+ "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))"
+ )
+import os
+import site
+import sys
+
+old_os_path = os.environ.get("PATH", "")
+os.environ["PATH"] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path
+base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+if sys.platform == "win32":
+ site_packages = os.path.join(base, "Lib", "site-packages")
+else:
+ site_packages = os.path.join(base, "lib", "python%s" % sys.version[:3], "site-packages")
+prev_sys_path = list(sys.path)
+
+site.addsitedir(site_packages)
+sys.real_prefix = sys.prefix
+sys.prefix = base
+# Move the added items to the front of the path:
+new_sys_path = []
+for item in list(sys.path):
+ if item not in prev_sys_path:
+ new_sys_path.append(item)
+ sys.path.remove(item)
+sys.path[:0] = new_sys_path