OpenInternet / copilot

An easy to use censorship simulating access point in a box
https://openinternet.github.io/copilot/
GNU Lesser General Public License v3.0
26 stars 2 forks source link

Config files need to only be touched once per write #63

Closed seamustuohy closed 9 years ago

seamustuohy commented 9 years ago

write_rule, write_header, and prepare need to only open the file once. the Watchdog is gong to pop off on every write and I don't want to have that happen a bunch of times in a row.

It should look something like this

def write(self):
    with open(config, "w+") as config:
        prepare(config)
        write_head(config)
        write_rules(config)
seamustuohy commented 9 years ago

Fixed in https://github.com/OpenInternet/co-pilot/pull/66