Example #1
0
def execute_from_commandline():
    try:
        subcommand = sys.argv[1]
    except IndexError:
        subcommand = 'help'
    
    commands = get_commands()
    
    if subcommand in ('help', '--help', '-h'):
        try:
            cmd = commands[sys.argv[2]]
            cmd.print_help(sys.argv[0], sys.argv[2])
        except IndexError:
            # TODO print general help
            print "Usage: %s <command-name> [args]" % sys.argv[0]
            print_possible_commands(commands)
        except KeyError:
            print "Command '%s' not found.\n" % sys.argv[2]
            print_possible_commands(commands)
        
    elif subcommand == '--version':
        print eoxserver.get_version()
    
    else:
        try:
            commands[subcommand].run_from_argv(sys.argv)
        except KeyError:
            print "Command '%s' not found.\n" % sys.argv[2]
            print_possible_commands(commands)
            sys.exit(1)
        except CommandError, e:
            print termcolors.colorize("Error: %s" % e, fg="red")
            sys.exit(1)
Example #2
0
def index(request):
    return render_to_response(
        'eoxserver_index.html', {
            "version": get_version(),
        },
        context_instance=RequestContext(request)
    )
Example #3
0
def execute_from_commandline():
    try:
        subcommand = sys.argv[1]
    except IndexError:
        subcommand = 'help'

    commands = get_commands()

    if subcommand in ('help', '--help', '-h'):
        try:
            cmd = commands[sys.argv[2]]
            cmd.print_help(sys.argv[0], sys.argv[2])
        except IndexError:
            # TODO print general help
            print "Usage: %s <command-name> [args]" % sys.argv[0]
            print_possible_commands(commands)
        except KeyError:
            print "Command '%s' not found.\n" % sys.argv[2]
            print_possible_commands(commands)

    elif subcommand == '--version':
        print eoxserver.get_version()

    else:
        try:
            command = commands[subcommand]
        except KeyError:
            print "Command '%s' not found.\n" % sys.argv[1]
            print_possible_commands(commands)
            sys.exit(1)

        try:
            command.run_from_argv(sys.argv)
        except CommandError, e:
            print termcolors.colorize("Error: %s" % e, fg="red")
            sys.exit(1)
Example #4
0
def index(request):
    dataset_series_ids = models.DatasetSeries.objects.values_list(
        "identifier", flat=True
    )
    stitched_mosaic_ids = models.RectifiedStitchedMosaic.objects.values_list(
        "identifier", flat=True
    )
    return render_to_response(
        'webclient/index.html', {
            "datasetseries_eoids": dataset_series_ids,
            "stitchedmosaic_eoids": stitched_mosaic_ids,
            "path": request.path,
            "version": get_version(),
        },
        context_instance=RequestContext(request)
    )
Example #5
0
def main():
    parser = OptionParser(usage=textwrap.dedent("""\
            %prog [options] <instance-name> [<target-directory>]

            Creates a new EOxServer instance with all necessary files and
            folder structure. Optionally, a SQLite database is initiated.
        """),
                          version=eoxserver.get_version())
    parser.add_option('-i',
                      '--init-spatialite',
                      '--init_spatialite',
                      dest='init_spatialite',
                      action='store_true',
                      default=False,
                      help='Flag to initialize the sqlite database.')
    parser.add_option('-v',
                      '--verbosity',
                      action='store',
                      dest='verbosity',
                      default='1',
                      type='choice',
                      choices=['0', '1', '2', '3'])
    parser.add_option('--traceback',
                      action='store_true',
                      help='Raise on exception')

    options, args = parser.parse_args()

    error_stream = OutputWrapper(sys.stderr, color_style().ERROR)

    if not args:
        error_stream.write("Mandatory argument 'instance-name' not given.\n")
        sys.exit(1)

    name = args[0]
    try:
        target = args[1]
    except IndexError:
        target = None

    try:
        create_instance(name, target, **options.__dict__)
    except Exception as e:
        if options.traceback:
            raise
        error_stream.write("%s: %s\n" % (e.__class__.__name__, e))
def main():
    parser = OptionParser(
        usage=textwrap.dedent("""\
            %prog [options] <instance-name> [<target-directory>]

            Creates a new EOxServer instance with all necessary files and
            folder structure. Optionally, a SQLite database is initiated.
        """),
        version=eoxserver.get_version()
    )
    parser.add_option('-i', '--init-spatialite', '--init_spatialite',
        dest='init_spatialite', action='store_true', default=False,
        help='Flag to initialize the sqlite database.'
    )
    parser.add_option('-v', '--verbosity',
        action='store', dest='verbosity', default='1',
        type='choice', choices=['0', '1', '2', '3']
    )
    parser.add_option('--traceback',
        action='store_true', help='Raise on exception'
    )

    options, args = parser.parse_args()

    error_stream = OutputWrapper(sys.stderr, color_style().ERROR)

    if not args:
        error_stream.write("Mandatory argument 'instance-name' not given.\n")
        sys.exit(1)

    name = args[0]
    try:
        target = args[1]
    except IndexError:
        target = None

    try:
        create_instance(name, target, **options.__dict__)
    except Exception as e:
        if options.traceback:
            raise
        error_stream.write("%s: %s\n" % (e.__class__.__name__, e))
Example #7
0
del sdist.finders[:]

from setuptools import setup
from setuptools.command.install import install as _install

from eoxserver import get_version


class install(_install):
    def run(self):
        _install.run(self)

        self.prefix


version = get_version()

data_files = []
for dirpath, dirnames, filenames in os.walk('autotest/data'):
    data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])

setup(
    name='EOxServer_autotest',
    version=version.replace(' ', '-'),
    # TODO: packages
    data_files=data_files,
    install_requires=['eoxserver'],

    # Metadata
    author="EOX IT Services GmbH",
    author_email="*****@*****.**",
Example #8
0
# The encoding of source files.
#source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'EOxServer'
copyright = u'2011 - 2020 EOX IT Services GmbH'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ".".join(get_version().split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = get_version()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
#unused_docs = []
Example #9
0
import os, sys

# Hack to remove setuptools "feature" which resulted in
# ignoring MANIFEST.in when code is in an svn repository.
# TODO find a nicer solution
import subprocess
from setuptools.command import sdist
from distutils.extension import Extension
del sdist.finders[:]

from setuptools import setup

from eoxserver import get_version

version = get_version()

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

def fullsplit(path, result=None):
    """
    Split a pathname into components (the opposite of os.path.join) in a
    platform-neutral way.
    """
    if result is None:
        result = []
    head, tail = os.path.split(path)
    if head == '':
        return [tail] + result
    if head == path:
Example #10
0
def index(request):
    return render(request, 'eoxserver_index.html', {
        "version": get_version(),
    })
Example #11
0
def index(request):
    return render_to_response('eoxserver_index.html', {
        "version": get_version(),
    },
                              context_instance=RequestContext(request))
Example #12
0
# The encoding of source files.
#source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'EOxServer'
copyright = u'2011, 2012, 2013, 2014, EOX IT Services GmbH'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ".".join(get_version().split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = get_version()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
#unused_docs = []