From 5f0f2f90361a4c0a76478b288998595fc3ddebd2 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 8 Apr 2020 10:38:14 -0300 Subject: Added my old emacs config --- .../default/bin/activate_this.py | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .emacs.d.back/.python-environments/default/bin/activate_this.py (limited to '.emacs.d.back/.python-environments/default/bin/activate_this.py') 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 -- cgit v1.2.3