Skip to content

Instantly share code, notes, and snippets.

View geier's full-sized avatar
🐜
Slow but steady

Christian Geier geier

🐜
Slow but steady
View GitHub Profile
@geier
geier / test.py
Last active February 15, 2018 22:03
from totest import function
import logging
import click_log
def test_function(caplog):
click_log.basic_config('test').setLevel(logging.DEBUG)
caplog.set_level(logging.WARNING)
assert 1 == function()
assert caplog.records == 1
#!/usr/bin/python
# coding: utf-8
# Copyright (C) 2013 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
#
# adapted from example1.py and example3.collapse.py from the urwidtrees examples
from urwidtrees.tree import SimpleTree # noqa
from urwidtrees.decoration import CollapseIconMixin, DecoratedTree, CollapsibleIndentedTree, CollapsibleArrowTree # noqa
from urwidtrees.nested import NestedTree # noqa
#!/usr/bin/python
# coding: utf-8
# Copyright (C) 2013 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
#
# adapted from example1.py and example3.collapse.py from the urwidtrees examples
from urwidtrees.tree import SimpleTree
from urwidtrees.decoration import CollapseIconMixin, DecoratedTree
from urwidtrees.nested import NestedTree
#!/usr/bin/python
# Copyright (C) 2013 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
#
# adapted from example1.py and example3.collapse.py from the urwidtrees examples
from urwidtrees.tree import SimpleTree
from urwidtrees.decoration import CollapseIconMixin, DecoratedTree
from urwidtrees.widgets import TreeBox
import urwid
Verifying that "cgeier.id" is my Blockstack ID. https://onename.com/cgeier
@geier
geier / test.conf
Created June 14, 2016 23:20
example khal config
[calendars]
[[home]]
path = ~/.local/share/khal/calendars_test/home/
color = dark green
[[work]]
path = ~/.local/share/khal/calendars_test/work/
color = dark blue
[[events]]
@geier
geier / generate_example_events.py
Created June 14, 2016 23:19
example of creating new events with khal (hardcoded config file named test.conf)
import khal
from khal.settings import get_config
from khal.cli import build_collection
from khal.controllers import new_from_string
from datetime import date, timedelta
today = date.today()
config = get_config('test.conf')
@geier
geier / urwid_example.py
Created May 3, 2016 15:41
minimal urwid example (ListWalker)
import urwid
class SelectableText(urwid.Text):
def selectable(self):
return True
def keypress(self, size, key):
return key
content = urwid.SimpleListWalker([
@geier
geier / calendar_widget_test.py
Last active June 7, 2023 19:44
minimial test for CalendarWidget for urwid
from datetime import date as date
import urwid
from calendarwidget import CalendarWidget
PALETTE = [
('header', 'white', 'black'),
('footer', 'white', 'black'),
('line header', 'black', 'white', 'bold'),
('bright', 'dark blue', 'white', ('bold', 'standout')),