コード例 #1
0
 def new_plugin(self):
     # Before I created this little function,
     # python was giving me a bizillion "NoneType object has no
     # attribute" warnings, I think because tearDown is called,
     # removing the base class, before the plugin objects are deleted.
     # why this fixed it is a mystery to me
     plugin =  self.plugin_module.Plugin("What's", "here", "doesn't matter",
                                        {"showDebugInfo" : False})
     plugin.startup()
     return plugin
コード例 #2
0
ファイル: test_plugin.py プロジェクト: gazally/indigo-chatbot
 def new_plugin(self, path="./test_scripts"):
     # Before I created this little function,
     # python was giving me a bizillion "NoneType object has no
     # attribute" warnings, I think because tearDown is called,
     # removing the base class, before the plugin objects are deleted.
     # why this fixed it is a mystery to me
     props = {"showDebugInfo": False, "scriptsPath": path}
     plugin = self.plugin_module.Plugin("", "", _VERSION, props)
     plugin.startup()
     return plugin
コード例 #3
0
ファイル: test_plugin.py プロジェクト: gazally/indigo-chatbot
 def new_plugin(self, path="./test_scripts"):
     # Before I created this little function,
     # python was giving me a bizillion "NoneType object has no
     # attribute" warnings, I think because tearDown is called,
     # removing the base class, before the plugin objects are deleted.
     # why this fixed it is a mystery to me
     props = {"showDebugInfo" : False,
              "scriptsPath": path}
     plugin = self.plugin_module.Plugin("", "", _VERSION, props)
     plugin.startup()
     return plugin
コード例 #4
0
import plugin

plugin = plugin.SPWFinder()
tFile = h5py.File(testDataFile)
tData = tFile["/recordings/0/data"]
sample_rate = tFile["/recordings/0"].attrs["sample_rate"][0]
bit_volts = tFile["/recordings/0/application_data"].attrs["channel_bit_volts"]

samples_in_441k_rate = 1024

samples_per_frame = int(samples_in_441k_rate * sample_rate / 44100.)

print "tData: ", tData
print "sample_rate: ", sample_rate

plugin.startup(sample_rate)


def reload_plugin():
    reload(plugin)
    plugin = plugin.SPWFinder()


def lookup_data(tStart, tEnd):
    iStart = int(tStart * sample_rate)
    print "iStart: ", iStart
    iEnd = int(tEnd * sample_rate)
    iD = iEnd - iStart
    iD = samples_per_frame * math.floor(iD / samples_per_frame)
    iEnd = int(iStart + iD)