Реализовал настройки которые будут применяться к проектному файлу
This commit is contained in:
parent
bfc9c18a3f
commit
1512d69649
|
|
@ -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)
|
||||
|
|
@ -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)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
class CsprojSettingBase:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def apply(self, csproj):
|
||||
pass
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1 @@
|
|||
__author__ = 'rzaitov'
|
||||
Loading…
Reference in New Issue