[crossfire] [PATCH] Add new utility utils/arch2json.py

Bob Tanner tanner at real-time.com
Tue Apr 23 14:34:59 CDT 2019


Convert archetype files into json



Initial commit of Arch2Json converter with testsuite.

Added function to take an archfile face and build a list of PNG files

Added function to check if report url path exits

Added fuction to trim a path from a string to get a relative path

Added DjangoJsonDump class to create a json file appropriate for a manage.py loaddata --format json for Django

New command line argument --trimpath Trim this path to create a relative path to the .arc files

New command line argument --facepng Generate JSON for faces PNG database table

Many new tests and testing data

Add arch2json python package requirements.txt

Refactor the face to png code to it's own function

Added filter_walk() to allow ignoring a specific directory as you walk the sub-directories

Added logic to test arch key and it's associated end key

Fixed bug in the find function
    The title isn't the right key to look for the end it's new style(?) arch that
    requires an associated end.

Refactor the code to set the item name to the object if the name is not set.
    See http://mailman.metalforge.org/pipermail/crossfire/2019-April/013601.html

Make the boolean not more clear

Fixed the problem were 1 extraneous field/model with no data was making the import into django fail

Fixes https://github.com/basictheprogram/crossfire-server/network/alert/requirements.txt/urllib3/closed

Special handling of the Balrog object.

    The object is Balrog, the name is Balrog, but the face is
    jessyb.*.x[123].png. I am sure there are other objects that will need
    special handling this is just 1 side case

    Added test suite for Balrog special handling

    Even more testing on the filter_walk really confirming the /dev/
    folder is removed

The changes are also on my personal GitHub project page.

https://github.com/basictheprogram/crossfire-server/tree/arch2json

commit 9636c1c534eb399c63cf855c4802bfd3f6ec5c53
commit 69eb1bba68018af3587a93cbd5f070958859078f
commit 9cc4998f1526076ab74822296fe045b5d3074f9b
commit 4e2366fbd083b8771453a795868dd80be0421177
commit 8f69b86b9372e6fc3f53f304142d4bc3a164d9bc
commit da848c17893f6e02bff9a2308bd2e40614a71bb4
commit d88e3623e91a625878941a356f85eec1c9045258
commit e8c8890dad7d3dfdcc297c7dff685d6bba9295c5
commit d801ae689549cf00b87f8cb5ac045fd030692165
commit ad9ac13abae3e8509ff09dc7046ad3e285fb4ab6
commit 379835a8c02ef6b45e6ec57446e7b5bc2dda6b92
commit fde888f35127f524416cb759958a49df74e22f4c

—
Bob Tanner <tanner at real-time.com<mailto:tanner at real-time.com>>           | Phone : 952-943-8700
http://www.real-time.com, Linux, macOS      | Fax   : 952-943-8500
Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20190423/912960f7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crossfire-server_arch2json.diff
Type: application/octet-stream
Size: 17511 bytes
Desc: crossfire-server_arch2json.diff
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20190423/912960f7/attachment.obj>


More information about the crossfire mailing list