diff options
Diffstat (limited to 'snippets')
-rw-r--r-- | snippets/python/cutf8.py | 2 | ||||
-rw-r--r-- | snippets/python/fabfile.py | 33 | ||||
-rw-r--r-- | snippets/python/pudb.py | 1 | ||||
-rw-r--r-- | snippets/python/pyclass.py | 5 | ||||
-rw-r--r-- | snippets/python/pydef.py | 12 |
5 files changed, 53 insertions, 0 deletions
diff --git a/snippets/python/cutf8.py b/snippets/python/cutf8.py new file mode 100644 index 0000000..fa3f8e5 --- /dev/null +++ b/snippets/python/cutf8.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +""".""" diff --git a/snippets/python/fabfile.py b/snippets/python/fabfile.py new file mode 100644 index 0000000..c519167 --- /dev/null +++ b/snippets/python/fabfile.py @@ -0,0 +1,33 @@ +"""Fabfile for automating some mundane tasks.""" +from fabric.api import cd, env, prefix, run + +# Use local SSH config +env.use_ssh_config = True + + +def prod(): + """Production host.""" + env.hosts = ['myserver'] + env.virtual_env = 'projname' + env.forward_agent = True + + +def prod_old(): + """Old way of defining.""" + env.user = 'cody' + env.hosts = ['123.123.123.123:1234'] + env.virtual_env = 'projname' + env.forward_agent = True + + +def deploy_virstualenv(): + """Deploy through virtualenv.""" + with prefix('workon {}'.format(env.virtual_env)): + run('deploy') + + +def deploy_git_folder(): + """Deploy the application.""" + with cd('www'): + run('git fetch origin master') + run('git reset --hard origin/master') diff --git a/snippets/python/pudb.py b/snippets/python/pudb.py new file mode 100644 index 0000000..80b65ef --- /dev/null +++ b/snippets/python/pudb.py @@ -0,0 +1 @@ +from pudb import set_trace; set_trace() diff --git a/snippets/python/pyclass.py b/snippets/python/pyclass.py new file mode 100644 index 0000000..07d0493 --- /dev/null +++ b/snippets/python/pyclass.py @@ -0,0 +1,5 @@ + class jump(jump): + """jump + + jump + """ diff --git a/snippets/python/pydef.py b/snippets/python/pydef.py new file mode 100644 index 0000000..a3d8224 --- /dev/null +++ b/snippets/python/pydef.py @@ -0,0 +1,12 @@ +def jump(jump): + """jump. + + jump + + Args: + jump (jump_type): jump_desc + Example: jump + + Return: + jump_type: jump_desc + """ |