-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: xcgspring <[email protected]>
- Loading branch information
Showing
6 changed files
with
81 additions
and
5 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
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
|
||
#used by config module | ||
from image_config import * | ||
#other interface | ||
from image_compare import image_compare |
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
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,42 @@ | ||
|
||
import os | ||
|
||
config_section="image" | ||
default_configs={ "gen_diff_image" : "True", | ||
"diff_image_location" : os.path.dirname(os.path.abspath(__file__)), | ||
} | ||
|
||
GenDiffImage=default_configs["gen_diff_image"] | ||
DiffImageLocation=default_configs["diff_image_location"] | ||
|
||
def config(configs=default_configs): | ||
'''call back function used by config module | ||
set the global variables according to configuration | ||
''' | ||
global GenDiffImage | ||
global DiffImageLocation | ||
|
||
GenDiffImage=configs["gen_diff_image"] | ||
DiffImageLocation=configs["diff_image_location"] | ||
|
||
#used by config module | ||
__all__=["config_section", "default_configs", "config"] | ||
|
||
def query_diff_image_location(): | ||
'''query diff_image_location from config | ||
''' | ||
if not os.path.isdir(DiffImageLocation): | ||
os.makedirs(DiffImageLocation) | ||
|
||
return DiffImageLocation | ||
|
||
def query_gen_diff_image(): | ||
'''query gen_diff_image from config | ||
''' | ||
results = {"True":True, "False":False} | ||
|
||
if GenDiffImage in results: | ||
return results[GenDiffImage] | ||
else: | ||
#use default | ||
return results[default_configs["gen_diff_image"]] |
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