Реализовал настройки которые будут применяться к проектному файлу

This commit is contained in:
Rustam Zaitov 2013-10-06 19:45:53 +04:00
parent bfc9c18a3f
commit 1512d69649
5 changed files with 40 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -0,0 +1,7 @@
class CsprojSettingBase:
def __init__(self):
pass
def apply(self, csproj):
pass

View File

@ -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

View File

@ -0,0 +1 @@
__author__ = 'rzaitov'