Skip to content

Commit

Permalink
Add doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BPerlakiH committed Jan 10, 2024
1 parent da99f1d commit d3ca6d9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/custom_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ def __init__(self):
self.info_files.append(f)

def create_custom_project_file(self, path="custom_project.yml"):
"""Create the project file based of the main repo project.yml
It will contain the targets we need for each custom app, and their build settings,
pointing to their individual info.plist files
Args:
path (str, optional): the output file path where it will be saved. Defaults to "custom_project.yml".
"""
dict = {"include": ["project.yml"]}
targets = {}
for info in self.info_files:
Expand All @@ -23,16 +30,29 @@ def create_custom_project_file(self, path="custom_project.yml"):
yaml.dump(dict, file)

def create_plists(self, custom_plist):
"""Generate the plist files for each brand
Args:
custom_plist (string): the path to the original plist file we are basing this of,
it should be a copy from the Kiwix target
"""
for info in self.info_files:
parser = InfoParser(info)
parser.create_plist(based_on_plist_file=custom_plist)

def download_zim_files(self):
"""Download all the zim files that were declared in the info.json files
"""
for cmd in self._curl_download_commands():
subprocess.call(cmd)

# private
def _curl_download_commands(self):
"""Yield all the curl commands we need to download each zim file from all info.json files
Yields:
array: commands that can be feeded into subprocess.call()
"""
for info in self.info_files:
parser = InfoParser(info)
url = parser.zimurl()
Expand Down

0 comments on commit d3ca6d9

Please sign in to comment.