こんなコードはよいコード
- 読みやすいことはよいことだ
- 見た目が単純だと読みやすい
- 皆がよく知っている構成は読みやすい (標準に従う。すでに知っているもの (Unix のコマンドとか) に従う。すでにあるものに従う)
- 書かないことはよいことだ
| Microsoft Windows [Version 6.1.7601] | |
| Copyright (c) 2009 Microsoft Corporation. All rights reserved. | |
| C:\Users\tkondou>python | |
| Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win | |
| 32 | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> from distutils.command.install_scripts import install_scripts | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> |
| C:\Users\tkondou\Downloads>pip | |
| Usage: pip COMMAND [OPTIONS] | |
| You must give a command (use "pip help" to see a list of commands) | |
| C:\Users\tkondou\Downloads>pip install ipython | |
| Exception: | |
| Traceback (most recent call last): | |
| File "C:\Python27-x64\lib\site-packages\pip\basecommand.py", line 107, in main | |
| status = self.run(options, args) |
| C:\Users\tkondou\Downloads>python ez_setup.py | |
| Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-p | |
| y2.7.egg | |
| Traceback (most recent call last): | |
| File "ez_setup.py", line 278, in <module> | |
| main(sys.argv[1:]) | |
| File "ez_setup.py", line 212, in main | |
| from setuptools.command.easy_install import main | |
| File "C:\Users\tkondou\Downloads\setuptools-0.6c11-py2.7.egg\setuptools\__init | |
| __.py", line 2, in <module> |
| C:\Users\tkondou\Downloads>python distribute_setup.py | |
| Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.2 | |
| 8.tar.gz | |
| Extracting in c:\tmp\tmp8xdb58 | |
| Now working in c:\tmp\tmp8xdb58\distribute-0.6.28 | |
| Installing Distribute | |
| Traceback (most recent call last): | |
| File "setup.py", line 41, in <module> | |
| exec(open(init_path).read(), d) | |
| File "<string>", line 8, in <module> |
| ## Ignore Visual Studio temporary files, build results, and | |
| ## files generated by popular Visual Studio add-ons. | |
| # User-specific files | |
| *.suo | |
| *.user | |
| *.sln.docstates | |
| # Build results |
| {{{ | |
| #!python | |
| ** Mercurial version (2.3). TortoiseHg version (2.4.3) | |
| ** Command: | |
| ** CWD: C:\windows\system32 | |
| ** Encoding: cp932 | |
| ** Extensions loaded: graphlog, mq, rebase, purge, win32mbcs, convert, record, hgsubversion, info, transplant | |
| ** Python version: 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] | |
| ** Windows version: sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') | |
| ** Processor architecture: x86 |
| #!/bin/bash | |
| if [[ -z $1 ]]; then | |
| echo "Usage: $0 repository" | |
| exit 1; | |
| fi | |
| function getFirstRev # $1: Repository path | |
| { | |
| if [[ $(uname -s) = MINGW* ]]; then |
| #!/bin/sh -e | |
| # Windows batch command | |
| # - tested on msysgit on Windows | |
| export LANGUAGE=C | |
| hg version -q | |
| reporoot=temp #temp directory | |
| centrepo=$reporoot/centrepo |
| #!/bin/sh -e | |
| HGROOT="$HOME/work/hghacks/mercurial" | |
| HG="$HGROOT/hg" | |
| LANG=C | |
| TESTTMP="/tmp/subrepo+mq.d" | |
| make -C "$HGROOT" local > /dev/null | |
| "$HG" --version -q |