Skip to content

Commit 328146f

Browse files
committed
Make _BATCH_MODE private
1 parent 50074e9 commit 328146f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

iptc/easy.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# TODO
2-
# - Expose POLICY of a table
1+
# -*- coding: utf-8 -*-
32

43
from .ip4tc import Rule, Table, Chain, IPTCError
54
from .ip6tc import Rule6, Table6
65

7-
BATCH_MODE = False
6+
_BATCH_MODE = False
87

98
def flush_all(ipv6=False):
109
""" Flush all available tables """
@@ -212,7 +211,7 @@ def dump_chain(table, chain, ipv6=False):
212211

213212
def batch_begin(table = None, ipv6=False):
214213
""" Disable autocommit on a table """
215-
BATCH_MODE = True
214+
_BATCH_MODE = True
216215
if table:
217216
tables = (table, )
218217
else:
@@ -223,7 +222,7 @@ def batch_begin(table = None, ipv6=False):
223222

224223
def batch_end(table = None, ipv6=False):
225224
""" Enable autocommit on table and commit changes """
226-
BATCH_MODE = False
225+
_BATCH_MODE = False
227226
if table:
228227
tables = (table, )
229228
else:
@@ -302,7 +301,7 @@ def _iptc_gettables(ipv6=False):
302301
def _iptc_gettable(table, ipv6=False):
303302
""" Return an updated view of an iptc_table """
304303
iptc_table = Table6(table) if ipv6 else Table(table)
305-
if BATCH_MODE is False:
304+
if _BATCH_MODE is False:
306305
iptc_table.commit()
307306
iptc_table.refresh()
308307
return iptc_table

0 commit comments

Comments
 (0)