Skip to content

Commit da21933

Browse files
authored
Merge pull request #131 from ndem0/master
PEP8 style
2 parents 4df1c09 + 45d5878 commit da21933

40 files changed

+5448
-5658
lines changed

code_formatter.sh

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#######################################
44

5-
required_command="yapf unexpand"
5+
required_command="yapf"
66
code_directories="pygem tests"
77

88
#######################################
@@ -38,31 +38,15 @@ for dir in $code_directories; do
3838
done
3939
[[ $# != 0 ]] && python_files=$@
4040

41-
# The files unvhandler.py and params.py can not be formatted because there are
42-
# strings with spaces inside that otherwise would be converted in tabs.
43-
python_files_true=""
44-
for file in $python_files; do
45-
if [ $file != "pygem/unvhandler.py" ] && [ $file != "pygem/params.py" ]; then
46-
python_files_true="$python_files_true $file"
47-
fi
48-
done
4941

50-
# Here the important part:
51-
# - first, yapf format the files; it works very well just setting few option
52-
# by command line, but at the moment it has bugs for tabs, so uses spaces.
53-
# - second, convert 4 spaces to tab character
54-
# - third, you can look a very pretty code
55-
for file in $python_files_true; do
42+
# Here the important part: yapf format the files.
43+
for file in $python_files; do
5644
echo "Making beatiful $file..."
5745
[[ ! -f $file ]] && echo "$file does not exist; $0 -h for more info" && exit
5846

5947
yapf --style='{
6048
based_on_style: pep8,
6149
indent_width: 4,
62-
dedent_closing_brackets = true,
63-
coalesce_brackets = true,
64-
column_limit = 80
50+
column_limit: 80
6551
}' -i $file
66-
unexpand -t 4 $file > tmp.py
67-
mv tmp.py $file
68-
done
52+
done

pygem/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
"""
33
__all__ = [
4-
'affine', 'filehandler', 'freeform', 'radial', 'openfhandler', 'params',
5-
'stlhandler', 'unvhandler', 'vtkhandler', 'nurbshandler', 'stephandler',
6-
'igeshandler', 'utils', 'gui', 'khandler', 'idw', 'params_idw'
4+
'affine', 'filehandler', 'freeform', 'radial', 'openfhandler', 'params',
5+
'stlhandler', 'unvhandler', 'vtkhandler', 'nurbshandler', 'stephandler',
6+
'igeshandler', 'utils', 'gui', 'khandler', 'idw', 'params_idw'
77
]
88

99
from . import affine

0 commit comments

Comments
 (0)