forked from NebulaSS13/Nebula
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates check_icon_state_limit.py to use byondtoolsv3
- Loading branch information
1 parent
b4be6cc
commit 15ae1ed
Showing
3 changed files
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,6 +186,7 @@ function setup_python3 { | |
pip3 install --upgrade pip -q | ||
pip3 install pyyaml==5.3 -q | ||
pip3 install beautifulsoup4==4.8.2 -q | ||
pip3 install git+https://github.com/ComicIronic/[email protected]#egg=ByondToolsv3 -q | ||
} | ||
|
||
function run_code_tests { | ||
|
@@ -206,7 +207,8 @@ function run_code_tests { | |
run_test "check tags" "python3 tools/TagMatcher/tag-matcher.py ." | ||
run_test "check color hex" "python3 tools/ColorHexChecker/color-hex-checker.py ." | ||
run_test "check punctuation" "python3 tools/PunctuationChecker/punctuation-checker.py ." | ||
run_test "check icon state limit" "python3 tools/dmitool/check_icon_state_limit.py ." | ||
run_test "check icon state limit (icons)" "python3 tools/check_icon_state_limit.py icons" | ||
run_test "check icon state limit (mods)" "python3 tools/check_icon_state_limit.py mods" | ||
run_test_ci "check changelog builds" "python3 tools/changelog/ss13_genchangelog.py html/changelog.html html/changelogs" | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import argparse, sys, logging | ||
from os import path, walk | ||
from byond.DMI import DMI | ||
|
||
opt = argparse.ArgumentParser() | ||
opt.add_argument('dir', help='The directory to scan for *.dmi files with an excess number of icon states.') | ||
args = opt.parse_args() | ||
|
||
if(not path.isdir(args.dir)): | ||
print('Not a directory') | ||
sys.exit(1) | ||
|
||
failed = False | ||
logging.getLogger().setLevel(logging.ERROR) # we don't care that byond is bad at pngs | ||
# This section parses all *.dmi files in the given directory, recursively. | ||
for root, subdirs, files in walk(args.dir): | ||
for filename in files: | ||
if not filename.endswith('.dmi'): | ||
continue | ||
file_path = path.join(root, filename) | ||
dmi = DMI(file_path) | ||
dmi.loadMetadata() | ||
number_of_icon_states = len(dmi.states) | ||
if number_of_icon_states > 512: | ||
failed = True | ||
print("{0} had too many icon states. {1}/512".format(file_path, number_of_icon_states)) | ||
if failed: | ||
sys.exit(1) |
This file was deleted.
Oops, something went wrong.