diff --git a/plugins/django/djtest.fish b/plugins/django/djtest.fish new file mode 100644 index 0000000..9726130 --- /dev/null +++ b/plugins/django/djtest.fish @@ -0,0 +1,13 @@ +# time, cleanup pyc and running test, settings as first argument +# e.g. djtest settings_dev +function djtest + set VERBOSE --verbosity=1 + find . -name "*.pyc" -delete + + if set -q argv + time python manage.py test $VERBOSE --settings=$argv + else + time python manage.py test $VERBOSE + end + +end diff --git a/plugins/python/pybeautifyjson.fish b/plugins/python/pybeautifyjson.fish new file mode 100644 index 0000000..ab2d9ca --- /dev/null +++ b/plugins/python/pybeautifyjson.fish @@ -0,0 +1,5 @@ +# beautify json string +# use : pybeautifyjson '{"foo": "lorem", "bar": "ipsum"}' +function pybeautifyjson + echo $argv | python -mjson.tool +end \ No newline at end of file diff --git a/plugins/python/pyclean.fish b/plugins/python/pyclean.fish new file mode 100644 index 0000000..3b5475a --- /dev/null +++ b/plugins/python/pyclean.fish @@ -0,0 +1,10 @@ +# clean current directory recursively from any .pyc and .pyo files +function pyclean + if test -n $argv + set path2CLEAN $argv + else + set path2CLEAN . + end + + find $path2CLEAN -name "*.py[co]" -type f -delete +end \ No newline at end of file diff --git a/plugins/python/pyhttp.fish b/plugins/python/pyhttp.fish new file mode 100644 index 0000000..06c6c8b --- /dev/null +++ b/plugins/python/pyhttp.fish @@ -0,0 +1,9 @@ +# start in-place a simple http server, take a optional parameter for the port number +function pyhttp + if test -n "$argv" + set HTTPPORT $argv + else + set HTTPPORT 1025 + end + python -m SimpleHTTPServer $HTTPPORT; +end diff --git a/plugins/python/pysmtp.fish b/plugins/python/pysmtp.fish new file mode 100644 index 0000000..3872f48 --- /dev/null +++ b/plugins/python/pysmtp.fish @@ -0,0 +1,10 @@ +# start smtp debugging server, can pass an option port parameter. Default to 1025 +function pysmtp + if test -n "$argv" + set SMTPPORT $argv + else + set SMTPPORT 1025 + end + echo "smtp server started on port" $SMTPPORT; + python -m smtpd -n -c DebuggingServer localhost:$SMTPPORT; +end diff --git a/plugins/python/python.load b/plugins/python/python.load index 64159fa..7f2bbc2 100644 --- a/plugins/python/python.load +++ b/plugins/python/python.load @@ -1,3 +1,4 @@ if test -d /usr/local/share/python set PATH /usr/local/share/python $PATH end +