# Path: lib/crypto/packaged.py
# class SigningError(Exception):
# def sign_app(src, dest, ids, reviewer=False, local=False):
# def _sign_app(src, dest, ids, reviewer, tempname, local=False):
# def _get_endpoint(reviewer=False):
# def _no_sign(src, dst_path):
# def sign(version_id, reviewer=False, resign=False, **kw):
# 
# Path: lib/crypto/packaged.py
# class SigningError(Exception):
#     pass


import os
import socket
import StringIO
import tempfile
import time
import traceback
import commonware.log
import elasticsearch
import requests
        import M2Crypto  # NOQA
from django.conf import settings
from cache_nuggets.lib import memoize
from PIL import Image
from lib.crypto import packaged, receipt
from lib.crypto.packaged import SigningError as PackageSigningError
from lib.crypto.receipt import SigningError
from mkt.site.storage_utils import local_storage
    try:
        Image.new('RGB', (16, 16)).save(StringIO.StringIO(), 'JPEG')
        libraries_results.append(('PIL+JPEG', True, 'Got it!'))
    except Exception, e:
        msg = "Failed to create a jpeg image: %s" % e
        libraries_results.append(('PIL+JPEG', False, msg))

    try:
        libraries_results.append(('M2Crypto', True, 'Got it!'))
    except ImportError:
        libraries_results.append(('M2Crypto', False, 'Failed to import'))

    if settings.SPIDERMONKEY:
        if os.access(settings.SPIDERMONKEY, os.R_OK):
            libraries_results.append(('Spidermonkey is ready!', True, None))
            # TODO: see if it works?
        else:
            msg = "You said spidermonkey was at (%s)" % settings.SPIDERMONKEY
            libraries_results.append(('Spidermonkey', False, msg))
    # If settings are debug and spidermonkey is empty,
    # thorw this error.
    elif settings.DEBUG and not settings.SPIDERMONKEY:
        msg = 'SPIDERMONKEY is empty'
        libraries_results.append(('Spidermonkey', True, msg))
    else:
        msg = "Please set SPIDERMONKEY in your settings file."
        libraries_results.append(('Spidermonkey', False, msg))

    missing_libs = [l for l, s, m in libraries_results if not s]
    if missing_libs:

# Path: lib/crypto/packaged.py
# class SigningError(Exception):
# def sign_app(src, dest, ids, reviewer=False, local=False):
# def _sign_app(src, dest, ids, reviewer, tempname, local=False):
# def _get_endpoint(reviewer=False):
# def _no_sign(src, dst_path):
# def sign(version_id, reviewer=False, resign=False, **kw):
# 
# Path: lib/crypto/packaged.py
# class SigningError(Exception):
#     pass


# Path: mkt/site/monitors.py
import os
import socket
import StringIO
import tempfile
import time
import traceback
import commonware.log
import elasticsearch
import requests
        import M2Crypto  # NOQA
from django.conf import settings
from cache_nuggets.lib import memoize
from PIL import Image
from lib.crypto import packaged, receipt
from lib.crypto.packaged import SigningError as PackageSigningError
from lib.crypto.receipt import SigningError
from mkt.site.storage_utils import local_storage

    try:
        Image.new('RGB', (16, 16)).save(StringIO.StringIO(), 'JPEG')
        libraries_results.append(('PIL+JPEG', True, 'Got it!'))
    except Exception, e:
        msg = "Failed to create a jpeg image: %s" % e
        libraries_results.append(('PIL+JPEG', False, msg))

    try:
        libraries_results.append(('M2Crypto', True, 'Got it!'))
    except ImportError:
        libraries_results.append(('M2Crypto', False, 'Failed to import'))

    if settings.SPIDERMONKEY:
        if os.access(settings.SPIDERMONKEY, os.R_OK):
            libraries_results.append(('Spidermonkey is ready!', True, None))
            # TODO: see if it works?
        else:
            msg = "You said spidermonkey was at (%s)" % settings.SPIDERMONKEY
            libraries_results.append(('Spidermonkey', False, msg))
    # If settings are debug and spidermonkey is empty,
    # thorw this error.
    elif settings.DEBUG and not settings.SPIDERMONKEY:
        msg = 'SPIDERMONKEY is empty'
        libraries_results.append(('Spidermonkey', True, msg))
    else:
        msg = "Please set SPIDERMONKEY in your settings file."
        libraries_results.append(('Spidermonkey', False, msg))

    missing_libs = [l for l, s, m in libraries_results if not s]
    if missing_libs:

        status = 'missing libs: %s' % ",".join(missing_libs)