Exemplo n.º 1
0
import datetime
import hashlib
import importlib
import os
import sys
import time

from collections import namedtuple

from capturing import Capturing
from status import Status
from virtualenvironment import IsolatedVirtualEnvironment

import database

db = database.getInstance()

Chord = namedtuple("Chord", ["path", "name"])


def findChords(directory, logging):
    chords = []
    logging.debug("Looking for chords in %s", directory)
    for path, dirs, files in os.walk(directory):
        files = [f for f in files if not f.endswith(".pyc")]
        files = [f for f in files if f.endswith(".py")]
        for file in files:
            name = file.split(".")[0]
            if name != "__init__":
                logging.debug("Found chord %s", file)
                chords.append(Chord(path, name))
Exemplo n.º 2
0
 def setUp(self):
     self.db = database.getInstance(":memory:", True)