diff --git a/scripts/parser/CsprojParser/Csproj.py b/scripts/parser/CsprojParser/Csproj.py new file mode 100644 index 0000000..f842fc9 --- /dev/null +++ b/scripts/parser/CsprojParser/Csproj.py @@ -0,0 +1,7 @@ +class Csproj: + def __init__(self, appName): + self.appName = appName + self.settings = {} + + def __str__(self): + return 'app Name: {0} settings: {1}'.format(self.appName, self.settings) \ No newline at end of file diff --git a/scripts/parser/CsprojParser/CsprojSetting/AttribureSetting.py b/scripts/parser/CsprojParser/CsprojSetting/AttribureSetting.py new file mode 100644 index 0000000..f6f5315 --- /dev/null +++ b/scripts/parser/CsprojParser/CsprojSetting/AttribureSetting.py @@ -0,0 +1,10 @@ +from parser.CsprojParser.CsprojSetting.CsprojSettingBase import CsprojSettingBase + + +class AttributeSetting(CsprojSettingBase): + def __init__(self, name, value): + self.attribute_name = name + self.attribute_value = value + + def apply(self, csproj): + setattr(csproj, self.attribute_name, self.attribute_value) diff --git a/scripts/parser/CsprojParser/CsprojSetting/CsprojSettingBase.py b/scripts/parser/CsprojParser/CsprojSetting/CsprojSettingBase.py new file mode 100644 index 0000000..12663b1 --- /dev/null +++ b/scripts/parser/CsprojParser/CsprojSetting/CsprojSettingBase.py @@ -0,0 +1,7 @@ +class CsprojSettingBase: + def __init__(self): + pass + + def apply(self, csproj): + pass + diff --git a/scripts/parser/CsprojParser/CsprojSetting/KeyValueSetting.py b/scripts/parser/CsprojParser/CsprojSetting/KeyValueSetting.py new file mode 100644 index 0000000..70e09ac --- /dev/null +++ b/scripts/parser/CsprojParser/CsprojSetting/KeyValueSetting.py @@ -0,0 +1,15 @@ +from parser.CsprojParser.CsprojSetting.CsprojSettingBase import CsprojSettingBase + + +class KeyValueSetting(CsprojSettingBase): + def __init__(self, key, value): + assert key is not None and key != '' + assert value is not None and value != '' + + self.key = key + self.value = value + + def apply(self, csproj): + assert csproj is not None + + csproj.settings[self.key] = self.value diff --git a/scripts/parser/CsprojParser/CsprojSetting/__init__.py b/scripts/parser/CsprojParser/CsprojSetting/__init__.py new file mode 100644 index 0000000..cc31abc --- /dev/null +++ b/scripts/parser/CsprojParser/CsprojSetting/__init__.py @@ -0,0 +1 @@ +__author__ = 'rzaitov'