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
--+--------------------------------------------------------------------------+ | |
-- Class Constructor. | |
-- | |
-- Supports single inheritance. To define a new class use as | |
-- | |
-- A = class() | |
-- | |
-- To define a class B that inherits from A, use as | |
-- | |
-- B = class(A) |
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
#!/usr/bin/env python | |
""" | |
This file is part of "blighty" which is released under GPL. | |
See file LICENCE or go to http://www.gnu.org/licenses/ for full license | |
details. | |
blighty is a desktop widget creation and management library for Python 3. |
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 math import pi as PI | |
import psutil | |
from attrdict import AttrDict | |
from blighty import CanvasGravity, TextAlign | |
from blighty.legacy import Graph | |
from blighty.x11 import Canvas, start_event_loop | |
from fonts import Fonts |
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 math import pi as PI | |
import psutil | |
from attrdict import AttrDict | |
from blighty import CanvasGravity, TextAlign | |
from blighty.legacy import Graph | |
from blighty.x11 import Canvas, start_event_loop | |
from fonts import Fonts |
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 socket | |
from time import sleep | |
import psutil | |
from attrdict import AttrDict | |
from blighty import CanvasGravity, TextAlign | |
from blighty.legacy import Graph | |
from blighty.x11 import Canvas, start_event_loop | |
from requests import 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
from multiprocessing import Pool, Queue, Manager, cpu_count | |
from multiprocessing.queues import Empty | |
from threading import Thread | |
from tqdm import tqdm | |
def parallelize(func: callable, iterable: list, processes: int = None) -> list: | |
"""Parallelize the execution of a function over a list. | |
This method runs a given function over chunks of the given list in |
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
class FiniteAutomaton: | |
def __init__(self): | |
self._states = {} | |
self._initial = None | |
self._current = None | |
def add_state(self, name, handler, initial=False): | |
if initial: | |
if self._initial: | |
raise RuntimeError("Initial state already added!") |
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 Thread, Event | |
class WakeSignal(Thread): | |
def __init__(self, interval, rising=None, falling=None): | |
super().__init__() | |
self._interval = interval | |
self._stopped = False | |
self._awake = False |
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
TRUE = lambda x: lambda y: x | |
FALSE = lambda x: lambda y: y | |
PAIR = lambda a: lambda b: lambda f: f(a)(b) | |
D = lambda x: PAIR(x)(x) | |
FIRST = lambda p: p(TRUE) | |
SECOND = lambda p: p(FALSE) |
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
#!/bin/bash | |
set -e | |
sudo apt-get -y install libsecret-1-0 libsecret-1-dev libglib2.0-dev | |
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret | |
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret |
OlderNewer