# Path: pyrikura/ipyrikura.py
# class IPyrikuraPlugin(Interface):
# class ITrigger(Interface):
# class IImageProcessor(Interface):
# class IFileOp(Interface):
# class ICamera(Interface):
#     def trigger(self):
#     def process(self):
#     def process(self):
# 
# Path: pyrikura/resources.py

# 
# Path: pyrikura/template.py
# def needed_captures(template):
# 
# Path: pyrikura/config.py
# def reload(path):


import sys
import os
import serial
import traceback
import threading
import pygame
import re
import logging
    import time
from twisted.internet import reactor, defer, task, protocol
from twisted.internet.serialport import SerialPort
from twisted.protocols import basic
from twisted.plugin import getPlugins
from six.moves import configparser
from pyrikura import ipyrikura
from pyrikura import resources
from pyrikura import template
from pyrikura.config import Config

# load all the stuff
resources.load()

# i'm lazy!
bell0 = resources.sounds['bell0']
bell1 = resources.sounds['bell1']
error = resources.sounds['error']
finished = resources.sounds['finished']

# manage volumes a bit
bell1.set_volume(bell1.get_volume() * 1.0)
finished.set_volume(finished.get_volume() * .9)

in_session = False


def get_class(o):
    name = o.__class__.__name__
    if name.endswith('Factory'):
        return name[:-7]
    else:
        return name


class Session:
    def __init__(self):
        logger.debug('building new session...')

        self.template = configparser.ConfigParser()

# Path: pyrikura/ipyrikura.py
# class IPyrikuraPlugin(Interface):
# class ITrigger(Interface):
# class IImageProcessor(Interface):
# class IFileOp(Interface):
# class ICamera(Interface):
#     def trigger(self):
#     def process(self):
#     def process(self):
# 
# Path: pyrikura/resources.py

# 
# Path: pyrikura/template.py
# def needed_captures(template):
# 
# Path: pyrikura/config.py
# def reload(path):


# Path: pyrikura/apps/service.py
import sys
import os
import serial
import traceback
import threading
import pygame
import re
import logging
    import time
from twisted.internet import reactor, defer, task, protocol
from twisted.internet.serialport import SerialPort
from twisted.protocols import basic
from twisted.plugin import getPlugins
from six.moves import configparser
from pyrikura import ipyrikura
from pyrikura import resources
from pyrikura import template
from pyrikura.config import Config


# load all the stuff
resources.load()

# i'm lazy!
bell0 = resources.sounds['bell0']
bell1 = resources.sounds['bell1']
error = resources.sounds['error']
finished = resources.sounds['finished']

# manage volumes a bit
bell1.set_volume(bell1.get_volume() * 1.0)
finished.set_volume(finished.get_volume() * .9)

in_session = False


def get_class(o):
    name = o.__class__.__name__
    if name.endswith('Factory'):
        return name[:-7]
    else:
        return name


class Session:
    def __init__(self):
        logger.debug('building new session...')

        self.template = configparser.ConfigParser()

        self.template.read(template_path)