def main():
    setup_logging()
    _logger = logging.getLogger('websocket')
    _logger.addHandler(logging.NullHandler())
    config_params = readConfig()
    failure = False
    failure |= test_web_api(config_params.webapirul)
    failure |= test_conversion(config_params)
    if failure:
        mailcontent = "There was an error at converting. Log is:\n" +getlog()
        log.info(SmtpUtility.send(config_params.mailinfo, mailcontent))
Esempio n. 2
0
from __future__ import print_function
import logging
import os
import sys
from docopt import docopt
from scratchtocatrobat.tools import logger
from scratchtocatrobat.tools import helpers
from scratchtocatrobat.scratch import scratch3

# TODO: not best solution! {
reload(sys)
sys.setdefaultencoding('utf-8') #@UndefinedVariable
# }

logger.setup_logging()
log = logging.getLogger("scratchtocatrobat.main")
__version__ = helpers.application_info("version")

def run_converter(scratch_project_file_or_url, output_dir,
                  extract_resulting_catrobat=False, temp_rm=True,
                  show_version_only=False, show_info_only=False,
                  archive_name=None,
                  web_mode=False):
    def check_base_environment():
        if "java" not in sys.platform:
            raise EnvironmentError("Must be called with Jython interpreter.")
        if System.getProperty(helpers.JYTHON_RESPECT_JAVA_ACCESSIBILITY_PROPERTY) != 'false':
            raise EnvironmentError("Jython registry property '%s' must be set to 'false'." % helpers.JYTHON_RESPECT_JAVA_ACCESSIBILITY_PROPERTY)

    def check_converter_environment():
Esempio n. 3
0
#  along with this program.  If not, see http://www.gnu.org/licenses/.

from __future__ import print_function
import logging
import os
import sys
from docopt import docopt
from scratchtocatrobat.tools import logger
from scratchtocatrobat.tools import helpers

# TODO: not best solution! {
reload(sys)
sys.setdefaultencoding('utf-8') #@UndefinedVariable
# }

logger.setup_logging()
log = logging.getLogger("scratchtocatrobat.main")
__version__ = helpers.application_info("version")

def run_converter(scratch_project_file_or_url, output_dir,
                  extract_resulting_catrobat=False, temp_rm=True,
                  show_version_only=False, show_info_only=False,
                  archive_name=None,
                  web_mode=False):
    def check_base_environment():
        if "java" not in sys.platform:
            raise EnvironmentError("Must be called with Jython interpreter.")
        if System.getProperty(helpers.JYTHON_RESPECT_JAVA_ACCESSIBILITY_PROPERTY) != 'false':
            raise EnvironmentError("Jython registry property '%s' must be set to 'false'." % helpers.JYTHON_RESPECT_JAVA_ACCESSIBILITY_PROPERTY)

    def check_converter_environment():