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 copy, math, functools | |
| ''' | |
| @Phuket2 | |
| Class - UIText | |
| For writing text in rects. | |
| the instance attrs are preserved if used as a context manager | |
| ie, 'with' | |
| ''' |
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 copy | |
| class UIText(object): | |
| dict_list = [] | |
| def __init__(self, r = ui.Rect(), *args, **kwargs): | |
| r = ui.Rect(*r) | |
| # defaults |
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 datetime as dt | |
| from time import time, strftime | |
| _sfn = 'Arial Rounded MT Bold' | |
| def current_time_str(): | |
| return strftime('%H:%M:%S') | |
| def _make_label(name, text, font, color): |
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
| from threading import Timer | |
| import threading | |
| import datetime as dt | |
| from datetime import timedelta | |
| import ui | |
| class MyTimer(object): | |
| def __init__(self, *args, **kwargs): | |
| self.thread = None |
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 functools | |
| import time | |
| import string | |
| # decorator memoize copied from .... | |
| # https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize | |
| # note that this decorator ignores **kwargs |
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 | |
| # Pythonista Forum - @Phuket2 | |
| # for @ccc , should be pep8 ok and pyflakes :) | |
| # No break through here. just expanded on the Pythonista help | |
| # code for ui.ImageContext | |
| # draw text in a circle, and return a ui.image |
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 | |
| # coding: utf-8 | |
| import calendar | |
| import datetime as dt | |
| import ui | |
| class CalendarView(ui.View): #here | |
| def __init__(self,fldname,dateval,action=None, *args, **kwargs): #here |
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 time | |
| from math import pi, sin, cos, radians | |
| # a dict for kwargs shortcuts | |
| _indicator_attr_short_cuts = \ | |
| { | |
| 'cw' : 'cell_width', |
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 | |
| ''' | |
| Date: 10 March 2016 | |
| Pythonista 2.01 beta | |
| PageIndicator Class | |
| =================== | |
| An attempt to mimick the page indicator found in some iOS interfaces | |
| supports circles/rects, defaults to circles. |
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 | |
| from pygments import highlight | |
| from pygments.formatters import HtmlFormatter | |
| from pygments.styles import get_style_by_name | |
| from pygments.lexers import get_lexer_by_name | |
| from pygments.styles import get_all_styles | |
| class CodeDisplay(ui.View): |