diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-14 22:14:36 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-04-14 22:14:36 +0800 |
commit | e6962a4d0939e20c24c5ec171e27cf653c102c3d (patch) | |
tree | d740facf2728a6dd354f758df79a3116e3381fa4 | |
parent | a53d9e469b114b99b3ad0b1a83eaf658a16c20dd (diff) | |
download | pttbbs-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-x | pttbbs/daemon/banipd/banipd.py | 4 |
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): |