pythonhere 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ def get_current_intent() -> Intent:
22
22
  return PythonActivity.mActivity.getIntent()
23
23
 
24
24
 
25
- def get_startup_script(intent: None = None) -> str | None:
25
+ def get_startup_script(intent: Intent | None = None) -> str | None:
26
26
  """Return script entrypoint that was passed to a given, or current, intent."""
27
27
  if not intent:
28
28
  intent = get_current_intent()
@@ -35,8 +35,7 @@ def restart_app(script: str = None):
35
35
  Logger.info("PythonHere: restart requested with a script: %s", script)
36
36
  activity = PythonActivity.mActivity
37
37
  intent = Intent(activity.getApplicationContext(), PythonActivity)
38
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
39
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
38
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK)
40
39
 
41
40
  if script:
42
41
  intent.setData(Uri.parse(script))
@@ -59,11 +58,17 @@ def bind_run_script_on_new_intent():
59
58
 
60
59
 
61
60
  def create_shortcut_icon() -> Icon:
62
- """Create icon to use for a shurtcut."""
61
+ """Create icon to use for a shortcut."""
63
62
  activity = PythonActivity.mActivity
64
- Drawable = autoclass(f"{activity.getPackageName()}.R$drawable")
65
63
  context = cast("android.content.Context", activity.getApplicationContext())
66
- return Icon.createWithResource(context, Drawable.icon)
64
+
65
+ app_info = context.getApplicationInfo()
66
+ icon_res_id = app_info.icon
67
+
68
+ if not icon_res_id:
69
+ raise RuntimeError("Application icon resource id was not found")
70
+
71
+ return Icon.createWithResource(context, icon_res_id)
67
72
 
68
73
 
69
74
  def resolve_script_path(script: str) -> str:
@@ -97,4 +102,6 @@ def pin_shortcut(script: str, label: str):
97
102
  )
98
103
 
99
104
  manager = activity.getSystemService(Context.SHORTCUT_SERVICE)
105
+ if not manager.isRequestPinShortcutSupported():
106
+ raise RuntimeError("Pinned shortcuts are not supported by this launcher")
100
107
  manager.requestPinShortcut(shortcut, None)
pythonhere/server_here.py CHANGED
@@ -30,7 +30,7 @@ async def run_ssh_server(app):
30
30
  try:
31
31
  config = ServerConfig(
32
32
  host="",
33
- chroot=app.upload_dir,
33
+ sftp_root=app.upload_dir,
34
34
  key_path=Path("./key.rsa").resolve(),
35
35
  **app.get_pythonhere_config(),
36
36
  )
@@ -1 +1 @@
1
- __version__ = "0.2.0"
1
+ __version__ = "0.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonhere
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Here is the Kivy based app to run code from the Jupyter magic %there
5
5
  Author-email: b3b <ash.b3b@gmail.com>
6
6
  License-Expression: MIT
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.14
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: LICENSE
19
- Requires-Dist: herethere[magic]>=0.1.0
19
+ Requires-Dist: herethere[magic]>=0.2.1
20
20
  Requires-Dist: ipython
21
21
  Requires-Dist: ipywidgets
22
22
  Requires-Dist: Pillow
@@ -40,7 +40,7 @@ PythonHere
40
40
  :alt: Supported Python versions
41
41
  .. image:: https://github.com/b3b/pythonhere/actions/workflows/tests.yml/badge.svg?branch=master
42
42
  :target: https://github.com/b3b/pythonhere/actions/workflows/tests.yml?query=branch%3Amaster
43
- :alt: CI Status
43
+ :alt: CI Status
44
44
  .. image:: https://codecov.io/github/b3b/pythonhere/coverage.svg?branch=master
45
45
  :target: https://codecov.io/github/b3b/pythonhere?branch=master
46
46
  :alt: Code coverage Status
@@ -68,6 +68,9 @@ Project documentation: https://herethere.me/pythonhere
68
68
  Install the Android app
69
69
  -----------------------
70
70
 
71
+ Install *PythonHere* with `Obtainium <https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/b3b/pythonhere>`_
72
+ to receive updates from GitHub Releases.
73
+
71
74
  Ready-to-use *PythonHere* APKs are available from the `GitHub Releases <https://github.com/b3b/pythonhere/releases>`_ page.
72
75
 
73
76
  For APK provenance and signing checks, see `Android APK verification <https://github.com/b3b/pythonhere/blob/master/docs/android-apk-verification.rst>`_.
@@ -1,5 +1,5 @@
1
1
  pythonhere/__init__.py,sha256=gkVrYFkF3klE1fripHpmTuZx8_BaVHWRRvvr6PK6XWE,212
2
- pythonhere/android_here.py,sha256=imQCNkhAJYgT3gMeX25kd9cQzH5ZbeF5PlgP8e9sbl0,3316
2
+ pythonhere/android_here.py,sha256=wBZNDgglichTFDpGuKFwdNbPXS2kVw8XvssnGd_4Y9Q,3546
3
3
  pythonhere/enum_here.py,sha256=FPj3pBeXfpPwl4-LDdC-wmbaoiv4QdbKHkGoBfTXnTE,449
4
4
  pythonhere/exception_manager_here.kv,sha256=FZNhQgVojSLcVxZ0vjAxAF915xCBP-3nldPXVczRzCE,656
5
5
  pythonhere/exception_manager_here.py,sha256=-UYqGRbzkoyfF0-pLWbxaFGEAvAdaw6b8hkm_bMIKx8,1943
@@ -8,8 +8,8 @@ pythonhere/main.py,sha256=7vAF6mznCr2JFxeXjm3-a6PN1abPt-loI8ZHncAAPp0,7237
8
8
  pythonhere/network_here.py,sha256=e3FDlBcXPaTFlWaqW2_bcWctht-ifpFIvtOj0lO4S9w,1558
9
9
  pythonhere/patches_here.py,sha256=zB7Ohbk5PIXt0imnnrV5Mtl-Y7jpD_p5IBPlijQcCCQ,1727
10
10
  pythonhere/pythonhere.kv,sha256=x1xwiKvJAevqBhtXGLb_axIf-VRos4V_jM9Q2i44f2U,1453
11
- pythonhere/server_here.py,sha256=ss4Alg4ySkI0aG58l8D2SQMXiGHJeK-hGUIIBrbQ6nE,1854
12
- pythonhere/version_here.py,sha256=Zn1KFblwuFHiDRdRAiRnDBRkbPttWh44jKa5zG2ov0E,22
11
+ pythonhere/server_here.py,sha256=Y3tOIQo0JBp50AUXOKQhxKMokvedV7QV_JSYPh4t99U,1857
12
+ pythonhere/version_here.py,sha256=HfjVOrpTnmZ-xVFCYSVmX50EXaBQeJteUHG-PD6iQs8,22
13
13
  pythonhere/window_here.py,sha256=na47v7bgomAjb6VC_g35RwhzEtm5RCInQIuQK27zY8U,2023
14
14
  pythonhere/data/logo/logo-128.png,sha256=4sitDJcVBHOU5UPxicmrzc6YqFY7_xtYrc_ULyrw9ks,4161
15
15
  pythonhere/data/logo/logo-32.png,sha256=qanrIAt6vK_2BsCjCxth2B4vxBa0ONnpDlils7syUWE,1247
@@ -26,8 +26,8 @@ pythonhere/ui_here/server_screen_here.kv,sha256=x0Se8hmgjS57gFIPa1r2lf6yJchs3lXO
26
26
  pythonhere/ui_here/server_screen_here.py,sha256=2zQv1YFmiKNxa__7UZDYbAAAwYFLoZPSZPhr7vjCAkU,925
27
27
  pythonhere/ui_here/settings_here.kv,sha256=stMcDq8dCYjay4idK30_7EUu5edkMDAQVPv0H0GuAcM,710
28
28
  pythonhere/ui_here/settings_here.py,sha256=7NflZBUqY2ANZaSEuubaX9wIKniqbekcNQkUbqhhmto,4093
29
- pythonhere-0.2.0.dist-info/licenses/LICENSE,sha256=nW9_eVi3dSMOkr6xghsobAovBEJiffjl_5WjujJTa74,1071
30
- pythonhere-0.2.0.dist-info/METADATA,sha256=s6EVWNzwY9n6PDwLpNX6kVrd55fGxGpba3j26LYz7cQ,4790
31
- pythonhere-0.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
32
- pythonhere-0.2.0.dist-info/top_level.txt,sha256=dvkfRGF1tFbkjXzD9vwqXTge1Znkv7ga5fRJy5yhJsE,11
33
- pythonhere-0.2.0.dist-info/RECORD,,
29
+ pythonhere-0.2.1.dist-info/licenses/LICENSE,sha256=nW9_eVi3dSMOkr6xghsobAovBEJiffjl_5WjujJTa74,1071
30
+ pythonhere-0.2.1.dist-info/METADATA,sha256=YT9FBxQE48qfzrGFDwvRi8rYOkv4_xxlZLbWTqQ5GWw,4958
31
+ pythonhere-0.2.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
32
+ pythonhere-0.2.1.dist-info/top_level.txt,sha256=dvkfRGF1tFbkjXzD9vwqXTge1Znkv7ga5fRJy5yhJsE,11
33
+ pythonhere-0.2.1.dist-info/RECORD,,