Skip to content
This repository has been archived by the owner on Nov 10, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Nunes committed Apr 5, 2016
2 parents d04359b + 2cfd96f commit 37e8ed9
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 33 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

0.2.1 (2016-04-05)

* In-tag text is now properly parsed and saved along with everything else.

----------------------------------

0.2.0 (2016-04-05)

* Users can now modify the installer's objects.
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ deploy:
- provider: GitHub
auth_token:
secure: iMaZrvVT+OI/9jRs8LyOvmzVqIBa0/jpiK96wNzZww/KqKsMcferhIeSK7faNzOo
artifact: dist\*
artifact: '*'
description: '[Changelog.](https://github.com/GandaG/fomod-editor/blob/master/CHANGELOG.md)'
force_update: true
on:
appveyor_repo_tag: true
2 changes: 1 addition & 1 deletion fomod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.2.0"
__version__ = "0.2.1"
13 changes: 7 additions & 6 deletions fomod/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(self, element=None):


class ObjectModName(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Name", "moduleName", 0, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Name", "moduleName", 0, element, allow_text=True, default_text=text)


class ObjectModDepend(base.ObjectBase):
Expand Down Expand Up @@ -215,9 +215,9 @@ def __init__(self, element=None, default_properties=None):


class ObjectPluginDescription(base.ObjectBase):
def __init__(self, element=None):
def __init__(self, element=None, text=""):
super().__init__("Description", "description", 0, element,
allow_text=True)
allow_text=True, default_text=text)


class ObjectImage(base.ObjectBase):
Expand Down Expand Up @@ -246,11 +246,12 @@ def __init__(self, element=None):


class ObjectFlag(base.ObjectBase):
def __init__(self, element=None, default_properties=None):
def __init__(self, element=None, default_properties=None, text=""):
properties = {"name": props.PropertyText("Name", "name", "")}

super().__init__("Flag", "flag", 0, element,
properties=properties, allow_text=True, default_properties=default_properties)
properties=properties, allow_text=True,
default_properties=default_properties, default_text=text)


class ObjectDependencyType(base.ObjectBase):
Expand Down
20 changes: 10 additions & 10 deletions fomod/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ def from_element(element):
if element.tag == "fomod" and not element.getparent():
return info.ObjectInfo(element)
elif element.tag == "Name":
return info.ObjectName(element)
return info.ObjectName(element, element.text)
elif element.tag == "Author":
return info.ObjectAuthor(element)
return info.ObjectAuthor(element, element.text)
elif element.tag == "Version":
return info.ObjectVersion(element)
return info.ObjectVersion(element, element.text)
elif element.tag == "Id":
return info.ObjectID(element)
return info.ObjectID(element, element.text)
elif element.tag == "Website":
return info.ObjectWebsite(element)
return info.ObjectWebsite(element, element.text)
elif element.tag == "Description":
return info.ObjectDescription(element)
return info.ObjectDescription(element, element.text)
elif element.tag == "Groups":
return info.ObjectGroup(element)
elif element.tag == "element":
return info.ObjectElement(element)
return info.ObjectElement(element, element.text)

elif element.tag == "config" and not element.getparent():
return config.ObjectConfig(element)
elif element.tag == "moduleName":
return config.ObjectModName(element)
return config.ObjectModName(element, element.text)
elif element.tag == "moduleDependencies":
return config.ObjectModDepend(element)
elif element.tag == "requiredInstallFiles":
Expand Down Expand Up @@ -84,15 +84,15 @@ def from_element(element):
elif element.tag == "plugin":
return config.ObjectPlugin(element, dict(element.attrib))
elif element.tag == "description":
return config.ObjectPluginDescription(element)
return config.ObjectPluginDescription(element, element.text)
elif element.tag == "image":
return config.ObjectImage(element, dict(element.attrib))
elif element.tag == "conditionFlags":
return config.ObjectConditionFlags(element)
elif element.tag == "typeDescriptor":
return config.ObjectTypeDesc(element)
elif element.tag == "flag":
return config.ObjectFlag(element, dict(element.attrib))
return config.ObjectFlag(element, dict(element.attrib), element.text)
elif element.tag == "dependencyType":
return config.ObjectDependencyType(element)
elif element.tag == "defaultType":
Expand Down
28 changes: 14 additions & 14 deletions fomod/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ def __init__(self, element=None):


class ObjectName(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Name", "Name", 1, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Name", "Name", 1, element, allow_text=True, default_text=text)


class ObjectAuthor(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Author", "Author", 1, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Author", "Author", 1, element, allow_text=True, default_text=text)


class ObjectVersion(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Version", "Version", 1, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Version", "Version", 1, element, allow_text=True, default_text=text)


class ObjectID(base.ObjectBase):
def __init__(self, element=None):
super().__init__("ID", "Id", 1, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("ID", "Id", 1, element, allow_text=True, default_text=text)


class ObjectWebsite(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Website", "Website", 1, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Website", "Website", 1, element, allow_text=True, default_text=text)


class ObjectDescription(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Description", "Description", 1, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Description", "Description", 1, element, allow_text=True, default_text=text)


class ObjectGroup(base.ObjectBase):
Expand All @@ -65,5 +65,5 @@ def __init__(self, element=None):


class ObjectElement(base.ObjectBase):
def __init__(self, element=None):
super().__init__("Element", "element", 0, element, allow_text=True)
def __init__(self, element=None, text=""):
super().__init__("Element", "element", 0, element, allow_text=True, default_text=text)
6 changes: 6 additions & 0 deletions fomod/serializer/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def serialize(info_root, config_root, package_path):
element = etree.Element(node.tag)
node.element = element

if node.allow_text:
element.text = node.text

for key in node.properties:
element.set(key, node.properties[key])

Expand All @@ -48,6 +51,9 @@ def serialize(info_root, config_root, package_path):
element = etree.Element(node.tag)
node.element = element

if node.allow_text:
element.text = node.text

for key in node.properties:
element.set(node.properties[key].tag, str(node.properties[key].value))

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.0
current_version = 0.2.1

[bumpversion:file:fomod/__init__.py]

Expand Down

0 comments on commit 37e8ed9

Please sign in to comment.