[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: contrib/removetrailingwhite
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: contrib/removetrailingwhitespace: sed the python |
Date: |
Thu, 17 May 2018 18:38:04 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 4a95f4848 contrib/removetrailingwhitespace: sed the python
4a95f4848 is described below
commit 4a95f48489d0046c4aad919d73573e1a6616688b
Author: Nils Gillmann <address@hidden>
AuthorDate: Thu May 17 16:38:30 2018 +0000
contrib/removetrailingwhitespace: sed the python
Signed-off-by: Nils Gillmann <address@hidden>
---
contrib/Makefile.am | 2 ++
contrib/removetrailingwhitespace | 14 --------------
contrib/removetrailingwhitespace.py.in | 15 +++++++++++++++
pre-commit | 4 ++--
4 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 1db5b3091..40e6d3e92 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -19,6 +19,7 @@ endif
noinst_SCRIPTS = \
terminate.py \
pydiffer.py \
+ removetrailingwhitespace.py \
gnunet_pyexpect.py \
gnunet_janitor.py \
gnunet-chk.py
@@ -52,6 +53,7 @@ EXTRA_DIST = \
gnunet_pyexpect.py.in \
gnunet_janitor.py.in \
gnunet-chk.py.in \
+ removetrailingwhitespace.py.in \
pydiffer.py.in \
gnunet-gns-import.sh \
openvpn-tap32/tapw32/tap0901.sys \
diff --git a/contrib/removetrailingwhitespace b/contrib/removetrailingwhitespace
deleted file mode 100755
index 9e620cbb2..000000000
--- a/contrib/removetrailingwhitespace
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import re
-
-for fileName in sys.argv[1:]:
- f = open(fileName, 'r+')
- fileString = f.read()
-
- fileString = re.sub(r'[ ]+\n', r'\n', fileString)
- fileString = re.sub(r'\r', r'', fileString)
- f.seek(0)
- f.write(fileString)
- f.truncate(len(fileString))
diff --git a/contrib/removetrailingwhitespace.py.in
b/contrib/removetrailingwhitespace.py.in
new file mode 100755
index 000000000..5824fb591
--- /dev/null
+++ b/contrib/removetrailingwhitespace.py.in
@@ -0,0 +1,15 @@
address@hidden@
+
+import sys
+import re
+
+
+for fileName in sys.argv[1:]:
+ f = open(fileName, 'r+')
+ fileString = f.read()
+
+ fileString = re.sub(r'[ ]+\n', r'\n', fileString)
+ fileString = re.sub(r'\r', r'', fileString)
+ f.seek(0)
+ f.write(fileString)
+ f.truncate(len(fileString))
diff --git a/pre-commit b/pre-commit
index 5213f2cf4..777728a6b 100755
--- a/pre-commit
+++ b/pre-commit
@@ -12,8 +12,8 @@ find $PATHS -name "*.c" -exec indent {} \;
find $PATHS -name "*.h" -exec indent {} \;
find $PATHS -name "*.c" -exec indent {} \;
find $PATHS -name "*.h" -exec indent {} \;
-find $PATHS -name "*.c" -exec contrib/removetrailingwhitespace {} \;
-find $PATHS -name "*.h" -exec contrib/removetrailingwhitespace {} \;
+find $PATHS -name "*.c" -exec contrib/removetrailingwhitespace.py {} \;
+find $PATHS -name "*.h" -exec contrib/removetrailingwhitespace.py {} \;
if test -x "`which 'dos2unix'`"
then
find $PATHS -name "*.c" -exec dos2unix {} \;
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: contrib/removetrailingwhitespace: sed the python,
gnunet <=