Skip to content

Instantly share code, notes, and snippets.

View ColdGrub1384's full-sized avatar
🤖

Emma Cold ColdGrub1384

🤖
View GitHub Profile
@ColdGrub1384
ColdGrub1384 / install_ipython.py
Last active June 2, 2020 02:51
Install IPython on Pyto (11.1.12+)
"""
Installs IPython on Pyto.
Usage: Usage: import requests as r; exec(r.get('https://bit.ly/35iSbM1').content.decode())
"""
from pip import main as pip
import os.path
docs = os.path.expanduser("~/Documents")
@ColdGrub1384
ColdGrub1384 / test_pyto.py
Created June 2, 2020 03:02
Pyto Basic Unit Tests
"""
Tests for Pyto before submitting to the App Store.
"""
import unittest
import runpy
import sys
from apps import Shortcuts
shortcuts = Shortcuts()
@ColdGrub1384
ColdGrub1384 / README.md
Last active June 3, 2020 23:46
UIKit views on PytoUI

objc_view

This is a small module for building pyto_ui views with UIKit. Here is an example with UIDatePicker.

import objc_view as ov
from UIKit import UIDatePicker
from datetime import datetime
from typing import Callable
import pyto_ui as ui
@ColdGrub1384
ColdGrub1384 / fix_extensions.py
Created June 17, 2020 14:55
Fixes C extensions when ODR fail to load and scripts are in site-packages
from extensionsimporter import DownloadableImporter, update_mods, c
from pyto import __Class__
import sys
import threading
try:
__Class__("PyCore").startupScript = threading.current_thread().script_path
except AttributeError:
pass # Running from startup
@ColdGrub1384
ColdGrub1384 / Theme.py
Last active June 28, 2020 03:55
Import and export Pyto themes
"""
A script for importing and exporting Pyto themes.
"""
from rubicon.objc import ObjCClass, at
from console import clear
import sys
import base64
import sharing
@ColdGrub1384
ColdGrub1384 / 2020.gif
Last active August 31, 2020 22:03
2020
2020.gif
@ColdGrub1384
ColdGrub1384 / Text Widget.py
Created September 20, 2020 15:50
Make a static widget with a text with Pyto
import widgets as wd
import pyto_ui as ui
import pyto_core as pc
import sys
from rubicon.objc import ObjCClass
from mainthread import mainthread
from time import sleep
UIColorPickerViewController = ObjCClass("UIColorPickerViewController")
@ColdGrub1384
ColdGrub1384 / Battery.py
Created September 22, 2020 15:32
A battery widget for the Home Screen monitoring in background.
# Created with Pyto
import widgets as wd
import sf_symbols as sf
import sys
from datetime import time
from UIKit import UIDevice
from background import BackgroundTask
from threading import Thread
@ColdGrub1384
ColdGrub1384 / Watch.py
Created October 21, 2020 13:09
Pyto Apple Watch Complication
"""
A watchOS complication for Pyto showing the current minute of the hour.
The script must be selected in Settings -> Apple Watch Script.
After running the script,
the complication named 'Minutes' should appear in the Watch Face customizer.
"""
import widgets as wd
import watch as wt