Skip to content

Commit ee05363

Browse files
committed
0.1.3
1 parent e5a2e88 commit ee05363

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

nginx/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ def as_block(self):
175175
for x in self.blocks:
176176
if isinstance(x, (Key, Comment)):
177177
ret.append(INDENT + x.as_block())
178+
elif isinstance(x, Container):
179+
y = x.as_block()
180+
ret.append('\n'+INDENT+INDENT+y[0])
181+
for z in y[1:]:
182+
ret.append(INDENT+z)
178183
else:
179184
y = x.as_block()
180185
ret.append(INDENT+y)
@@ -252,6 +257,10 @@ def loads(data, conf=True):
252257
lpath = re.match('\s*location\s*(.*\S+)\s*{', line).group(1)
253258
l = Location(lpath)
254259
lopen.insert(0, l)
260+
if re.match('\s*if.*{', line):
261+
ifs = re.match('\s*if\s*(.*\S+)\s*{', line).group(1)
262+
ifs = If(ifs)
263+
lopen.insert(0, ifs)
255264
if re.match('\s*upstream.*{', line):
256265
ups = re.match('\s*upstream\s*(.*\S+)\s*{', line).group(1)
257266
u = Upstream(ups)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
setup(
66
name='python-nginx',
7-
version='0.1.2',
7+
version='0.1.3',
88
description='Create and modify nginx serverblock configs in Python',
99
author='Jacob Cook',
1010
author_email='jacob@peakwinter.net',
1111
url='https://github.com/peakwinter/python-nginx',
1212
packages=['nginx'],
1313
keywords = ['nginx', 'web servers', 'serverblock', 'server block'],
14-
download_url = 'https://github.com/peakwinter/python-nginx/archive/0.1.2.tar.gz',
14+
download_url = 'https://github.com/peakwinter/python-nginx/archive/0.1.3.tar.gz',
1515
license = 'GPLv3',
1616
classifiers = [
1717
"Development Status :: 3 - Alpha",

0 commit comments

Comments
 (0)