This file contains 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 argparse | |
import getpass | |
import os | |
import select | |
import socket | |
import sys | |
import tarfile | |
import tempfile | |
import threading |
This file contains 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 eventlet | |
eventlet.monkey_patch(os=False, thread=False) | |
import time | |
import threading | |
LOCK = threading.Lock() | |
This file contains 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/python | |
from BaseHTTPServer import (HTTPServer, BaseHTTPRequestHandler) | |
from optparse import OptionParser | |
from rpmUtils.miscutils import splitFilename | |
from yum import packages | |
import StringIO | |
import cgi |
This file contains 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 yum import packages | |
def to_envra(name, version, arch="noarch", epoch=0): | |
pieces = version.split(".") | |
version_segments = [] | |
release_segments = [] | |
in_release = True | |
for segment in version.split("."): | |
if segment.isdigit() and in_release: |
This file contains 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 time | |
import threading | |
import sloq | |
THREADS = 5 | |
RATE = 1 | |
WORK_UNITS = 100 | |
WORK_DELAY = 0.1 |
This file contains 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 abc | |
import six | |
@six.add_metaclass(abc.ABCMeta) | |
class BaseStorage(object): | |
def ensure_atom(self, atom): | |
def set_atom_state(self, atom_name, state): |
This file contains 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 a | |
class B(a.A): | |
pass | |
def itersubclasses(cls, _seen=None): | |
"""Generator over all subclasses of a given class in depth first order.""" |
This file contains 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 prettytable | |
import six | |
import sys | |
class FSM(object): | |
"""A basic state machine.""" | |
def __init__(self, start_state): | |
self._table = {} |
This file contains 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 taskflow.types import fsm | |
from taskflow import states as st | |
m = fsm.FSM(st.UNDEFINED) | |
m.add_state(st.UNDEFINED) | |
m.add_state(st.RESUMING) | |
m.add_state(st.REVERTED) | |
m.add_state(st.SCHEDULING) |
This file contains 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 taskflow.types import fsm | |
from taskflow import states as st | |
m = fsm.FSM(st.UNDEFINED) | |
def on_enter(new_state, event): | |
print("Entering new state '%s' in " | |
"response to event '%s'" % (new_state, event)) |
OlderNewer