Skip to content
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

Support for missing works_max #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ If you happen to have `git` installed on your computer and run `git clone https:
## Documentation

### `index.json`
Here is a comprehensive example of an `index.json` file. These reside in the package's `silica_data` folder and is required for the repo to properly compile. You **must** include the `bundle_id`, `name`, `version`, `tagline`, `section`, `works_min`, and `works_max`. All other values are optional, but are recommended (if applicable).
Here is a comprehensive example of an `index.json` file. These reside in the package's `silica_data` folder and is required for the repo to properly compile. You **must** include the `bundle_id`, `name`, `version`, `tagline`, `section`, and `works_min`. All other values are optional, but are recommended (if applicable).

```json
{
Expand Down
2 changes: 1 addition & 1 deletion Styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function compatible(works_min, works_max, tweak_compatibility) {
if (currentiOS < works_min) {
el.innerHTML = "Your version of iOS is too old for this package. This package works on " + tweak_compatibility + ".";
el.classList.add("red")
} else if(currentiOS > works_max) {
} else if(works_max != "." && currentiOS > works_max) {
el.innerHTML = "Your version of iOS is too new for this package. This package works on " + tweak_compatibility + ".";
el.classList.add("red")
} else if(String(currentiOS) != "NaN") {
Expand Down
2 changes: 1 addition & 1 deletion Styles/tweak.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="nav_btn changelog_btn" onclick="swap('.tweak_info','.changelog');">Changelog</div>
</div>
<div class="tweak_info">
<p class="compatibility"><b>Compatibility:</b> This package is compatible with iOS {{tweak_compatibility}}.</p>
<p class="compatibility"><b>Compatibility:</b> This package is compatible with {{tweak_compatibility}}.</p>
{{{tweak_carousel}}}
<div class="md_view">
<p>{{{tweak_description}}}</p>
Expand Down
Empty file modified setup.sh
100644 → 100755
Empty file.
8 changes: 6 additions & 2 deletions util/DebianPackager.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,15 @@ def CompileControl(self, tweak_data, repo_settings):
control_file += "Breaks: " + tweak_data['breaks'] + "\n"
except Exception:
pass
if 'works_max' in tweak_data:
compatible_max = ", compatible_max::ios" + tweak_data['works_max']
else:
compatible_max = ""
try:
if tweak_data['tags']:
control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + ", compatible_max::ios" + tweak_data['works_max'] + ", " + tweak_data['tags'] + "\n"
control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + ", " + tweak_data['tags'] + "\n"
except Exception:
control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + ", compatible_max::ios" + tweak_data['works_max'] + "\n"
control_file += "Tags: compatible_min::ios" + tweak_data['works_min'] + compatible_max + "\n"

try:
if tweak_data['developer']:
Expand Down
11 changes: 8 additions & 3 deletions util/DepictionGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,17 @@ def RenderPackageHTML(self, tweak_data):
PackageLister.ErrorReporter(self, "Configuration Error!", "You are missing a package "
"name in its index.json. Make sure this and other required properties are set.")
try:
if 'works_max' in tweak_data:
works_max = " to " + tweak_data['works_max']
replacements['works_max'] = tweak_data['works_max']
else:
works_max = ""
replacements['tweak_developer'] = tweak_data['developer']['name']
replacements['tweak_compatibility'] = "iOS " + tweak_data['works_min'] + " to " + tweak_data['works_max']
replacements['tweak_compatibility'] = "iOS " + tweak_data['works_min'] + works_max
replacements['tweak_version'] = tweak_data['version']
replacements['tweak_section'] = tweak_data['section']
replacements['tweak_bundle_id'] = tweak_data['bundle_id']
replacements['works_min'] = tweak_data['works_min']
replacements['works_max'] = tweak_data['works_max']
replacements['tweak_tagline'] = tweak_data['tagline']
except:
PackageLister.ErrorReporter(self, "Configuration Error!", "You are missing an essential "
Expand Down Expand Up @@ -190,6 +194,7 @@ def RenderPackageNative(self, tweak_data):

changelog = DepictionGenerator.RenderNativeChangelog(self, tweak_data)
screenshot_size = PackageLister.GetScreenshotSize(self, tweak_data)
works_max = " to " + tweak_data['works_max'] if 'works_max' in tweak_data else ""

depiction = {
"minVersion": "0.1",
Expand Down Expand Up @@ -230,7 +235,7 @@ def RenderPackageNative(self, tweak_data):
{
"class": "DepictionTableTextView",
"title": "Compatibility",
"text": "iOS " + tweak_data['works_min'] + " to " + tweak_data['works_max']
"text": "iOS " + tweak_data['works_min'] + works_max
},
{
"class": "DepictionTableTextView",
Expand Down