peakwinter/python-nginx

Doubles comments

Closed this issue · 4 comments

After saving all comment string is doubled in config file.

yep, same here

Could you give me an example of the circumstances under which this occurs? I cannot reproduce it.

Thanks!

@peakwinter if comment have ';' at the end of line( after someone comment line of config), then this two regexp return true for this line, and because you don't use elif, you have double comment lines.

if re.match('.*;', line):          
if re.match('\s*#\s*', line):

simple config:

server {
    # listen 80;
    listen 8080;
    # some comment
    server_name localhost;
    }

will double #listen 80;

Fixed in 0.2, thanks!