-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Usage examples: * calling by the name: ck virtual env:python_simport --shell_cmd="python -m importme" * calling using tags: ck virtual env --tags=simport,lib --shell_cmd="python -m importme"
- Loading branch information
Showing
10 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9b9b3208ac44b891 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5d14fc2889a207e6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python_simport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"backup_data_uid": "5d14fc2889a207e6", | ||
"backup_module_uid": "9b9b3208ac44b891", | ||
"backup_module_uoa": "env", | ||
"control": { | ||
"engine": "CK", | ||
"iso_datetime": "2018-07-23T18:33:59.001180", | ||
"version": [ | ||
"1", | ||
"9", | ||
"4", | ||
"4" | ||
] | ||
}, | ||
"data_name": "python_simport" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"tags": [ | ||
"simport", | ||
"lib" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@echo off | ||
|
||
if not [%1] == [1] (if defined CK_ENV_PYTHON_SIMPORT_SET exit /b 0) | ||
|
||
rem Finding the path to the directory that contains THIS batch script, | ||
rem the solution borrowed from here: | ||
rem https://stackoverflow.com/questions/8797983/can-a-windows-batch-file-determine-its-own-file-name | ||
rem https://stackoverflow.com/questions/778135/how-do-i-get-the-equivalent-of-dirname-in-a-batch-file/778147 | ||
|
||
set PATH_TO_THIS_ENTRY_DIR=%~dp0 | ||
|
||
echo Adding %PATH_TO_THIS_ENTRY_DIR% to the PYTHONPATH ... | ||
|
||
set PYTHONPATH=%PATH_TO_THIS_ENTRY_DIR%;%PYTHONPATH% | ||
|
||
set CK_ENV_PYTHON_SIMPORT_SET=1 | ||
|
||
exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" != "1" ]; then if [ "$CK_ENV_PYTHON_SIMPORT_SET" == "1" ]; then return; fi; fi | ||
|
||
# Finding the path to the directory that contains THIS bash script, | ||
# the solution borrowed from here: | ||
# https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself | ||
|
||
PATH_TO_THIS_ENTRY_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )" | ||
|
||
echo Adding $PATH_TO_THIS_ENTRY_DIR to the PYTHONPATH ... | ||
|
||
export PYTHONPATH=${PATH_TO_THIS_ENTRY_DIR}:${PYTHONPATH} | ||
|
||
export CK_ENV_PYTHON_SIMPORT_SET=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python3 | ||
|
||
def runme(n = 100): | ||
print( "runme({}): Hello, world!".format(n) ) | ||
|
||
if __name__ == '__main__': | ||
|
||
# When the entry's code is run as a script, perform local tests: | ||
# | ||
|
||
runme(222) |