示例#1
0
#  GNU Affero General Public License for more details.
#
#  You should have received a copy of the GNU Affero General Public License
#  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 import logger
from scratchtocatrobat.tools import helpers

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

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):
    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():
        # TODO: refactor to combined class with explicit environment check method
        tools.svgtopng._checked_batik_jar_path()
        tools.wavconverter._checked_sox_path()

    try:
        from java.io import IOError
示例#2
0
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():
        # TODO: refactor to combined class with explicit environment check method
        tools.svgtopng._checked_batik_jar_path()
示例#3
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

# 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():
        # TODO: refactor to combined class with explicit environment check method
        tools.svgtopng._checked_batik_jar_path()