This file contains hidden or 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
''' | |
Launch Application (Emulate standard Alfred operation) | |
+ Requires Alfred Powerpack and Version 3+ | |
A script meant to be used in Alfred Script Filter(Input) within | |
a workflow that is connected to a 'Open File' (Action) | |
looks for entries with ext '.app' in the directories in the _dir_list. | |
Creates a list of dicts as per the Alfred Documentation and returns |
This file contains hidden or 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 toga | |
from toga.style.pack import * | |
def table_callback(widget, **kwargs): | |
x = kwargs.get('row')._source | |
print(dir(x)) | |
class MyApp(toga.App): | |
def startup(self): | |
self.main_window = toga.MainWindow(title=self.name) |
This file contains hidden or 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 ui | |
import io | |
import editor | |
import console | |
import dialogs | |
from pygments import highlight | |
from pygments.formatters import HtmlFormatter | |
from pygments.styles import get_all_styles |
This file contains hidden or 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
[ | |
{ | |
"frame": "{{0.0,44.0},{320.0,320.0}}", | |
"class": "View", | |
"nodes": [ | |
{ | |
"frame": "{{21.0,20.0},{279.0,45.0}}", | |
"class": "Label", | |
"attributes": { | |
"flex": "", |
This file contains hidden or 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
''' | |
this is crap. i mashed to files together without editing. | |
but it could be something. i have just been to lazy to bring it | |
together. i use it the wrench menu myself. | |
it acually works for me as a quickie when i am looking for a script. | |
''' | |
import ui, editor, console, editor | |
import io, re |
This file contains hidden or 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 ui | |
# only use this func to create a button for convienience | |
def quick_button(p, title="", **kwargs): | |
# p is the parent view | |
_inset = 60 | |
btn = ui.Button(name='btn', **kwargs) | |
btn.frame = ui.Rect(0, 0, p.width, p.width).inset(_inset, _inset) | |
btn.corner_radius = btn.width / 2 | |
btn.center = p.bounds.center() |
This file contains hidden or 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 ui | |
from random import choice | |
_color_list = ['purple', 'orange', 'deeppink', 'lightblue', 'cornflowerblue' | |
'red', 'yellow', 'green', 'pink', 'navy', 'teal', 'olive', | |
'lime', 'maroon', 'aqua', 'silver', 'fuchsia', | |
] | |
This file contains hidden or 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 ui | |
import dialogs | |
import datetime as dt | |
class FormDialogWrapper(object): | |
''' | |
A Wrapper/Helper class around the dialogs.form_dialog | |
Does it need one?? Maybe not. But by attempting to do one, I learn more | |
about the form_dialog. | |
To me these wrappers/helps also seem such a good idea in the begining. Then I get |
This file contains hidden or 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
''' | |
****** WRENCH ITEM ****** | |
create notes for the current source file in the Pythonisita Editor | |
This file should be added to the wrench menu, and will be run on the active editor tab | |
The idea is simple. just sometimes you want to make notes as you working on a file. This | |
script just automates creating a sub dir to save a notes file as well as file by the | |
same name, but different ext. The ext can be changed below. | |
A dir will be created in the directory of the source file if one does not exit, |
This file contains hidden or 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
# Pythonista Forum - @Phuket2 | |
import ui, editor | |
from collections import deque, namedtuple | |
# maybe silly, but each view created in here, we add a dynamic attr | |
# called vid (view id) to each view. i use it in add_labels_to_sv, a | |
# debug function, not sure how much more useful it can be. | |
# ammendment, also use in subviews_as_tuples, in this case, its handy | |
_v_id = 1 |
NewerOlder