Skip to content

Commit 4fbcefd

Browse files
committed
Reuse common AssetExtract.java
Also removes unused `mActivity` member. Note we changed the constructor input parameter to accept a `Context` object which is a parent class of the previous `Activity` one. Changes were tested on both kivy and service_only bootstraps. Also removes the `get_common_dir()` as it's no longer used since #2092
1 parent f96356b commit 4fbcefd

File tree

4 files changed

+3
-126
lines changed

4 files changed

+3
-126
lines changed

pythonforandroid/bootstrap.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ def get_build_dir(self):
132132
def get_dist_dir(self, name):
133133
return join(self.ctx.dist_dir, name)
134134

135-
def get_common_dir(self):
136-
return os.path.abspath(join(self.bootstrap_dir, "..", 'common'))
137-
138135
@property
139136
def name(self):
140137
modname = self.__class__.__module__

pythonforandroid/bootstraps/common/build/src/main/java/org/renpy/android/AssetExtract.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import java.io.*;
66

7-
import android.app.Activity;
7+
import android.content.Context;
88
import android.util.Log;
99

1010
import java.io.BufferedInputStream;
@@ -24,11 +24,9 @@
2424
public class AssetExtract {
2525

2626
private AssetManager mAssetManager = null;
27-
private Activity mActivity = null;
2827

29-
public AssetExtract(Activity act) {
30-
mActivity = act;
31-
mAssetManager = act.getAssets();
28+
public AssetExtract(Context context) {
29+
mAssetManager = context.getAssets();
3230
}
3331

3432
public boolean extractTar(String asset, String target) {

pythonforandroid/bootstraps/service_library/build/src/main/java/org/renpy/android/AssetExtract.java

Lines changed: 0 additions & 115 deletions
This file was deleted.

tests/test_bootstrap.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ def test_build_dist_dirs(self):
104104
bs.get_build_dir().endswith("build/bootstrap_builds/sdl2")
105105
)
106106
self.assertTrue(bs.get_dist_dir("test_prj").endswith("dists/test_prj"))
107-
self.assertTrue(
108-
bs.get_common_dir().endswith("pythonforandroid/bootstraps/common")
109-
)
110107

111108
def test__cmp_bootstraps_by_priority(self):
112109
# Test service_only has higher priority than sdl2:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy