-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Images listing file to help content checking; util to update it; test…
… to check it.
- Loading branch information
Showing
4 changed files
with
580 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
*.py[co] | ||
|
||
# Packages | ||
*.egg? | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-cache | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
.pytest_cache | ||
|
||
#Translations | ||
*.mo | ||
|
||
# Pydev/Eclipse files | ||
.project | ||
.pydevproject | ||
.settings | ||
|
||
# PyCharm files | ||
/.idea | ||
*.cover | ||
|
||
# Created by editiors | ||
*~ | ||
\#* | ||
\.\#* | ||
*.swp |
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 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import os.path | ||
from glob import glob | ||
|
||
REPO_MAIN_DIRPATH = os.path.dirname(os.path.abspath(__file__)) | ||
V4_DIR = os.sep.join([REPO_MAIN_DIRPATH, 'images', 'v4']) | ||
V4_LISTFILE_NAME = 'v4_files_listing.txt' | ||
V4_LISTFILE_PATH = os.sep.join([REPO_MAIN_DIRPATH, V4_LISTFILE_NAME]) | ||
|
||
def get_v4_imagefile_names(search_dirpath=V4_DIR, filespec='*.png'): | ||
"""Return a list of the current image files in the v4 subdirectory.""" | ||
files_spec = os.path.join(search_dirpath, filespec) | ||
file_paths = glob(files_spec) | ||
return [os.path.basename(file_path) for file_path in file_paths] | ||
|
||
|
||
def create_v4_images_listfile(search_dirpath=V4_DIR, filespec='*.png', | ||
output_filepath=V4_LISTFILE_PATH): | ||
file_names = get_v4_imagefile_names(search_dirpath, filespec) | ||
with open(output_filepath, 'w') as f_out: | ||
for file_name in file_names: | ||
f_out.write('{}\n'.format(file_name)) | ||
|
||
|
||
if __name__ == '__main__': | ||
create_v4_images_listfile() |
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
Oops, something went wrong.