add <info> key (#251)

* add <info> key

* cleanup doubled

* add schemaLocation attribute

* updated date output

* space

* updated version output

* bump to v4

* escape quotes

* fix schema version

* fix

* move comment to match token

* escape

* Revert "escape"

This reverts commit 18df8eda30.

* Revert "move comment to match token"

This reverts commit f1ce0cb850.

* correct direct file link

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update magic_spoiler/__main__.py

* Update magic_spoiler/__main__.py

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
tooomm 2022-02-07 00:38:31 +01:00 committed by GitHub
parent bd910e37de
commit 8deb35f745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,15 +208,16 @@ def open_header(card_xml_file: IO[Any]) -> None:
:param card_xml_file: Card file path
"""
card_xml_file.write(
"<cockatrice_carddatabase version='4'>\n"
"<cockatrice_carddatabase version='4' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='https://raw.githubusercontent.com/Cockatrice/Cockatrice/master/doc/carddatabase_v4/cards.xsd'>\n"
+ " <!--\n"
+ " Created At: "
+ datetime.datetime.utcnow().strftime("%a, %b %d %Y, %H:%M:%S")
+ " (UTC)\n"
+ " Created By: Magic-Spoiler project @ https://github.com/Cockatrice/Magic-Spoiler\n"
+ " \n"
+ " THIS FILE IS AUTOMATICALLY GENERATED & ALL EDITS WILL BE OVERRIDDEN.\n"
+ " -->\n"
+ "<info>\n"
+ " <author>Cockatrice/Magic-Spoiler</author>\n"
+ " <createdAt>" + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + " (UTC)</createdAt>\n"
+ " <sourceUrl>https://raw.githubusercontent.com/Cockatrice/Magic-Spoiler/files/spoiler.xml</sourceUrl>\n"
+ " <sourceVersion></sourceVersion>\n"
+ "</info>\n"
+ "<sets>\n"
)