Commit ace2b6e2 authored by Soldatoff's avatar Soldatoff

Исправил содержимое генерируемого map файла

parent 3a76be47
%define biname nginx-redirector %define biname nginx-redirector
Name: nginx-redirector Name: nginx-redirector
Version: 0.1.4 Version: 0.1.5
Release: alt1 Release: alt1
Summary: CLI-utility for building nginx redirects Summary: CLI-utility for building nginx redirects
......
...@@ -51,7 +51,7 @@ class MapGenerator: ...@@ -51,7 +51,7 @@ class MapGenerator:
data = self.start_line % project_name data = self.start_line % project_name
for arg1, arg2 in redirects: for arg1, arg2 in redirects:
# print('redirect is', arg1, arg2) # print('redirect is', arg1, arg2)
data += "\n\t%s\t%s;" % (arg1, arg2) data += "\n\t/%s\t/%s;" % (project_name+arg1, project_name+arg2)
data += self.endline data += self.endline
return data return data
...@@ -80,7 +80,7 @@ class ConfigGenerator: ...@@ -80,7 +80,7 @@ class ConfigGenerator:
self.option_line = "return %s;\n}\n" self.option_line = "return %s;\n}\n"
def generate_config(self, project_name, options): def generate_config(self, project_name, options):
data = (self.start_line % project_name) + (self.rewrite_line % (project_name, project_name, "break")) + "}\n" data = (self.start_line % project_name) + (self.rewrite_line % (project_name, project_name, "redirect")) + "}\n"
for code in options: for code in options:
if code == "permanent": if code == "permanent":
...@@ -88,6 +88,6 @@ class ConfigGenerator: ...@@ -88,6 +88,6 @@ class ConfigGenerator:
elif code == "redirect": elif code == "redirect":
data += (self.opt_start_line % (project_name, "redirect")) + (self.opt_rewrite_line % (project_name, project_name, "redirect", "redirect")) + "}\n" data += (self.opt_start_line % (project_name, "redirect")) + (self.opt_rewrite_line % (project_name, project_name, "redirect", "redirect")) + "}\n"
else: else:
data += (self.opt_start_line % (project_name, code)) + (self.opt_rewrite_line % (project_name, project_name, code, "break")) + (self.option_line % code) data += (self.opt_start_line % (project_name, code)) + (self.opt_rewrite_line % (project_name, project_name, code, "redirect")) + (self.option_line % code)
return data return data
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment