Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
"""
TODO: Please add here the short description of the xontrib to show in `xonfig web`.
"""
from xonsh.built_ins import XSH

{% if not pure_py %}
# Note! If you write the xontrib on Python it will work faster
# until https://github.com/xonsh/xonsh/issues/3953 hasn't released yet.
import xonsh
{% endif %}
# Good start! Get more documentation -> https://xon.sh/contents.html#guides

__all__ = ()

print('This is {{ project_repo_name }}!')


# Good start! Get more documentation -> https://xon.sh/contents.html#guides

# Accessing environment variables
# Note! If you want to create new env variables please name it with the beginning of the xontrib name
# i.e. if the xontrib called xontrib-hello-world name the variables as XONTRIB_HELLO_WORLD_NEW_VARIABLE
{% if pure_py %}
from xonsh.built_ins import XSH

# If your xontrib was made only for interactive mode it's good practice to check this before executing.
if XSH.env.get("XONSH_INTERACTIVE"):
# Some code in Using Python API:
var = XSH.env.get("VAR", "default")
result = XSH.subproc_captured_stdout(['echo', '1'])
result = XSH.subproc_captured_stdout(['echo', '1']) # Same as `$(echo 1)`
{% else %}
# Note! If you write the xontrib on Python it will work faster
# until https://github.com/xonsh/xonsh/issues/3953 hasn't released yet.

# If your xontrib was made only for interactive mode it's good practice to check this before executing.
if $XONSH_INTERACTIVE:
var = XSH.env.get('VAR', 'default')
var = @.env.get('VAR', 'default')
result = $(echo 1)
{% endif %}

# Accessing environment variables
# Note! If you want to create new env variables please name it with the beginning of the xontrib name
# i.e. if the xontrib called xontrib-hello-world name the variables as XONTRIB_HELLO_WORLD_NEW_VARIABLE

print('This is {{ project_repo_name }}!')