Skip to content

Instantly share code, notes, and snippets.

'''
Useful threaded GUI routines
'''
# Author: thodnev
# TODO: add docstrings to methods
import queue
class Polling:
def __init__(self, routine):
self.routine = routine
def __call__(self, *args, **kwargs):
self.__last = self.routine(*args, **kwargs)
return self.__last
@property
def last(self):
'''A throughput-limiting message dispatcher for Telegram bots'''
import sys
import time
import threading
if sys.version_info.major > 2:
import queue as q
else:
import Queue as q
'''A throughput-limiting message dispatcher for Telegram bots'''
import sys
import time
import threading
if sys.version_info.major > 2:
import queue as q
else:
import Queue as q
@thodnev
thodnev / cache_add.py
Last active July 22, 2017 01:19
werkzeug cache additions
'''This module contains cache-related logic'''
## TODO: improve documentation of contents
import threading
import exceptions
from werkzeug.contrib.cache import (SimpleCache, MemcachedCache, RedisCache,
FileSystemCache, NullCache)
class CacheMixin:
@thodnev
thodnev / arvfakegvcamera.cpp
Created April 30, 2018 08:54
Modified version of ARAVIS fake camera
/* The modified ArvFake component, allowing to stream from
* actual web camera.
* Please don't expect production-ready code here. It's dirty,
* contains a lot of hardcoded stuff. But enough for
* conducting experiments.
* Be sure to comment-out the #error block in original source
* if problems arise during build.
* Below is listed the original LICENSE of ARAVIS
*/