summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-04-14 22:14:36 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-04-14 22:14:36 +0800
commite6962a4d0939e20c24c5ec171e27cf653c102c3d (patch)
treed740facf2728a6dd354f758df79a3116e3381fa4
parenta53d9e469b114b99b3ad0b1a83eaf658a16c20dd (diff)
downloadpttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.tar
pttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.tar.gz
pttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.tar.bz2
pttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.tar.lz
pttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.tar.xz
pttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.tar.zst
pttbbs-e6962a4d0939e20c24c5ec171e27cf653c102c3d.zip
Improve input format (allow comments in IP list) and strip trailing spaces in
desc. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5650 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rwxr-xr-xpttbbs/daemon/banipd/banipd.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pttbbs/daemon/banipd/banipd.py b/pttbbs/daemon/banipd/banipd.py
index 4ba0fcb7..773eb99c 100755
--- a/pttbbs/daemon/banipd/banipd.py
+++ b/pttbbs/daemon/banipd/banipd.py
@@ -51,10 +51,12 @@ def LoadConfigTable(filename):
for ip in ips:
if ip in table:
raise ValueError('duplicated IP: %s' % ip)
- table[ip] = self.text
+ table[ip] = self.text.rstrip() + "\n"
self.clear()
def add_ip(self, s):
+ if '#' in s:
+ s = s.partition('#')[0]
self.ip += ' ' + s
def add_text(self, s):