This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import requests | |
import appex,console,time,os | |
unquote=requests.utils.unquote | |
urlparse=requests.utils.urlparse | |
url=appex.get_url() | |
p=urlparse(url) | |
urlfilename=unquote(unquote(urlparse(appex.get_url()).path.split('/')[-1])) | |
console.hud_alert('downloading '+urlfilename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
import random | |
import ui | |
A = Action | |
g1 ='plc:Grass_Block' | |
g2 ='plc:Dirt_Block' | |
g3 = 'plc:Brown_Block' | |
g4='plc:Roof_South' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scene,ui,math | |
class MyScene(scene.Scene): | |
def update(self): | |
t=self.t | |
self.background_color = ((0.5*t)%1., | |
math.sin(.5*t)+0.5, | |
math.sin(1/3.*t)**2, | |
1) | |
v=ui.View() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
import ctypes | |
app=UIApplication.sharedApplication() | |
#NSURL *url = [NSURL fileURLWithPath:@"/dev/null"]; | |
url = nsurl('/dev/null') | |
import os | |
#url= nsurl(os.path.abspath('test.aac')) | |
settings=ns({ns('AVSampleRateKey'):ns(44100.0), | |
ns('AVFormatIDKey'): ns(1633772320), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
import ctypes | |
app=UIApplication.sharedApplication() | |
#NSURL *url = [NSURL fileURLWithPath:@"/dev/null"]; | |
url = nsurl('/dev/null') | |
import os | |
#url= nsurl(os.path.abspath('test.aac')) | |
settings=ns({ns('AVSampleRateKey'):ns(44100.0), | |
ns('AVFormatIDKey'): ns(1633772320), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
class LogEntry(LabelNode): | |
def __init__(self,text): | |
LabelNode.__init__(self,text) | |
self.anchor_point=(0,0) | |
self.run_action(Action.sequence(Action.fade_to(0,1.5),Action.call(self.cull))) | |
def cull(self): | |
'''remove a log entry''' | |
self.remove_all_actions() | |
self.remove_from_parent() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import json | |
import flask | |
import google.oauth2.credentials | |
import google_auth_oauthlib.flow | |
import googleapiclient.discovery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
''' Statusbarmenu | |
A menu that lives in the status bar | |
A set of tools to add or delete custom buttons from the toolbar. This may not be super robust, but seems to work ok. Button objects and actions are saved so they survive global clearing, but thid has not been tested extensively. If a function relies on imports that occured outside of the function, these might dissappear -- user must make sure those modules are added to a module that is kept by pythonista, such as anything in site-packages, or name starting with __ ''' | |
from objc_util import * | |
import ui,console,editor | |
import weakref | |
from functools import partial | |
MARGIN=10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
''' Statusbarmenu | |
A menu that lives in the status bar | |
A set of tools to add or delete custom buttons from the toolbar. This may not be super robust, but seems to work ok. Button objects and actions are saved so they survive global clearing, but thid has not been tested extensively. If a function relies on imports that occured outside of the function, these might dissappear -- user must make sure those modules are added to a module that is kept by pythonista, such as anything in site-packages, or name starting with __ ''' | |
from objc_util import * | |
import ui,console,editor | |
import weakref | |
from functools import partial | |
MARGIN=10 |