comparison .bashrc @ 564:047a53a8fbad

py3
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 19 Dec 2013 18:03:05 -0800
parents 2daf6543e42c
children 7b70e5c0d410
comparison
equal deleted inserted replaced
563:2daf6543e42c 564:047a53a8fbad
30 export EDITOR='emacs -nw' 30 export EDITOR='emacs -nw'
31 export JS_EDITLINE=1 31 export JS_EDITLINE=1
32 export JS_EDITLINE=1 32 export JS_EDITLINE=1
33 33
34 # aliases 34 # aliases
35 alias awd="python -c 'import os; print os.path.realpath(\".\")'" 35 alias awd="python -c 'import os; print (os.path.realpath(\".\"))'"
36 alias currentpatch='echo `hg root`/.hg/patches/`hg qapp -v | tail -n 1 | cut -f 3 -d " "`' 36 alias currentpatch='echo `hg root`/.hg/patches/`hg qapp -v | tail -n 1 | cut -f 3 -d " "`'
37 alias datestamp='date +%Y%m%d%H%M%S' 37 alias datestamp='date +%Y%m%d%H%M%S'
38 alias grep='grep --colour=auto' 38 alias grep='grep --colour=auto'
39 alias ls='ls --color=auto' 39 alias ls='ls --color=auto'
40 alias patch='patch --reject-file=-' 40 alias patch='patch --reject-file=-'
41 alias random="python -c 'import sys, random; foo = sys.argv[1:]; random.shuffle(foo); print \" \".join(foo)'" 41 alias random="python -c 'import sys, random; foo = sys.argv[1:]; random.shuffle(foo); print (\" \".join(foo)')"
42 alias straceff="attach.py firefox --kill" 42 alias straceff="attach.py firefox --kill"
43 alias weekstamp="date --date=\"$((`date '+%u'`-1)) days ago\" '+%b %d'" 43 alias weekstamp="date --date=\"$((`date '+%u'`-1)) days ago\" '+%b %d'"
44 alias wget='wget --no-check-certificate' 44 alias wget='wget --no-check-certificate'
45 alias xpcshell="LD_LIBRARY_PATH=${MOZOBJ}/dist/bin ${MOZOBJ}/dist/bin/xpcshell" 45 alias xpcshell="LD_LIBRARY_PATH=${MOZOBJ}/dist/bin ${MOZOBJ}/dist/bin/xpcshell"
46 if [ -e ~/.bashttw ] 46 if [ -e ~/.bashttw ]
71 export PYTHONPATH=~/python:$PYTHONPATH:~/virtualenv 71 export PYTHONPATH=~/python:$PYTHONPATH:~/virtualenv
72 72
73 ### functions 73 ### functions
74 74
75 lspath() { 75 lspath() {
76 python -c 'import os; print "\n".join(os.environ["PATH"].split(os.path.pathsep))' 76 python -c 'import os; print ("\n".join(os.environ["PATH"].split(os.path.pathsep)))'
77 } 77 }
78 78
79 apply-patch() { 79 apply-patch() {
80 # apply a patch 80 # apply a patch
81 # TODO: 81 # TODO:
244 done 244 done
245 } 245 }
246 246
247 fn() { 247 fn() {
248 # full name 248 # full name
249 python -c "import os; print os.path.realpath('$*')" 249 python -c "import os; print (os.path.realpath('$*'))"
250 } 250 }
251 251
252 swap() { 252 swap() {
253 # swap two files 253 # swap two files
254 if [ "$#" != "2" ] 254 if [ "$#" != "2" ]
332 332
333 realwhich() { 333 realwhich() {
334 # which -> real paths 334 # which -> real paths
335 command which $@ | while read line 335 command which $@ | while read line
336 do 336 do
337 python -c "import os; print os.path.realpath('${line}')" 337 python -c "import os; print (os.path.realpath('${line}'))"
338 done 338 done
339 } 339 }
340 340
341 whview() { 341 whview() {
342 # which view 342 # which view
351 351
352 ### functions for python 352 ### functions for python
353 353
354 pyfile() { 354 pyfile() {
355 # python file path 355 # python file path
356 python -c "import $1; print $1.__file__" 356 python -c "import $1; print ($1.__file__)"
357 } 357 }
358 358
359 setup-all() { 359 setup-all() {
360 # setup all for development 360 # setup all for development
361 # TODO: flowerbed? 361 # TODO: flowerbed?
379 then 379 then
380 directory=$PWD 380 directory=$PWD
381 else 381 else
382 directory=$1 382 directory=$1
383 fi 383 fi
384 directory=$(python -c "import os; print os.path.abspath('${directory}')") 384 directory=$(python -c "import os; print (os.path.abspath('${directory}'))")
385 385
386 while [[ "${directory}" != "/" ]] 386 while [[ "${directory}" != "/" ]]
387 do 387 do
388 activate="${directory}/bin/activate" 388 activate="${directory}/bin/activate"
389 if [ -e "${activate}" ] 389 if [ -e "${activate}" ]