-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace WhatsNew file with Script #254
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
551cfba
chore: add default_config/config_settings.yaml to ignore
rnr 9391e8f
chore: added FF for skip page in What's New
rnr 12ebdfa
chore: merge dictionaries from ios and shared yaml files instead of u…
rnr fc83a4e
chore: little refactor
rnr e47e4fa
chore: changed back gitignor
rnr 8e09940
chore: little refactor
rnr 46b82aa
chore: deleted FF
rnr 8baff13
chore: added copying of whatsnew json file
rnr c81cc94
chore: returned back changes
rnr 42dd169
chore: address review feedback
rnr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -58,6 +58,9 @@ class WhitelabelApp: | |
medium: 'FontName-Medium' | ||
semiBold: 'FontName-Semibold' | ||
bold: 'FontName-Bold' | ||
whatsnew: | ||
whatsnew_import_file_path: 'path/to/importing/whats_new.json' | ||
project_whatsnew_file_path: 'path/to/json/file/in/project/WhatsNew.json' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use the same pattern |
||
""") | ||
|
||
def __init__(self, **kwargs): | ||
|
@@ -68,6 +71,7 @@ def __init__(self, **kwargs): | |
self.assets = kwargs.get('assets', {}) | ||
self.project_config = kwargs.get('project_config', {}) | ||
self.font = kwargs.get('font', {}) | ||
self.whatsnew = kwargs.get('whatsnew', {}) | ||
|
||
if "project_path" in self.project_config: | ||
self.config_project_path = self.project_config["project_path"] | ||
|
@@ -78,6 +82,7 @@ def whitelabel(self): | |
# Update the properties, resources, and configuration of the current app. | ||
self.copy_assets() | ||
self.copy_font() | ||
self.copy_whatsnew() | ||
self.set_app_project_config() | ||
|
||
def copy_assets(self): | ||
|
@@ -425,7 +430,7 @@ def copy_font(self): | |
if "project_font_file_path" in self.font: | ||
project_font_file_path = self.font["project_font_file_path"] | ||
# if source and destination file exist | ||
self.copy_font_file(font_import_file_path, project_font_file_path) | ||
self.copy_file(font_import_file_path, project_font_file_path, "Font") | ||
else: | ||
logging.error("'project_font_file_path' not found in config") | ||
else: | ||
|
@@ -440,14 +445,14 @@ def copy_font(self): | |
else: | ||
logging.debug("Font not found in config") | ||
|
||
def copy_font_file(self, file_src, file_dest): | ||
# try to copy font file and show success/error message | ||
def copy_file(self, file_src, file_dest, title): | ||
# try to copy file and show success/error message | ||
try: | ||
shutil.copy(file_src, file_dest) | ||
except IOError as e: | ||
logging.error("Unable to copy file. "+e) | ||
else: | ||
logging.debug("Font was copied to project") | ||
logging.debug(title+" file was copied to project") | ||
|
||
def set_font_names(self, font_names): | ||
if "project_font_names_json_path" in self.font: | ||
|
@@ -469,6 +474,22 @@ def set_font_names(self, font_names): | |
else: | ||
logging.error("'project_font_names_json_path' not found in config") | ||
|
||
def copy_whatsnew(self): | ||
# check if whatsnew config exists | ||
if self.whatsnew: | ||
if "whatsnew_import_file_path" in self.whatsnew: | ||
whatsnew_import_file_path = self.whatsnew["whatsnew_import_file_path"] | ||
if "project_whatsnew_file_path" in self.whatsnew: | ||
project_whatsnew_file_path = self.whatsnew["project_whatsnew_file_path"] | ||
# if source and destination file exist | ||
self.copy_file(whatsnew_import_file_path, project_whatsnew_file_path, "What's new") | ||
else: | ||
logging.error("'project_whatsnew_file_path' not found in config") | ||
else: | ||
logging.error("'whatsnew_import_file_path' not found in config") | ||
else: | ||
logging.debug("What's New not found in config") | ||
|
||
def main(): | ||
""" | ||
Parse the command line arguments, and pass them to WhitelabelApp. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the same pattern
whats_new.json
orWhatsNew.json