コード例 #1
0
reload(sys)
if hasattr(sys, 'setdefaultencoding'):
    sys.setdefaultencoding(encoding)
import pytest
from retriever.lib.tools import getmd5
from retriever import ENGINE_LIST

# Set postgres password, Appveyor service needs the password given
# The Travis service obtains the password from the config file.
if os.name == "nt":
    os_password = "******"
else:
    os_password = ""

mysql_engine, postgres_engine, sqlite_engine, msaccess_engine, csv_engine, download_engine, json_engine, xml_engine = ENGINE_LIST(
)
file_location = os.path.dirname(os.path.realpath(__file__))
retriever_root_dir = os.path.abspath(os.path.join(file_location, os.pardir))
working_script_dir = os.path.abspath(
    os.path.join(retriever_root_dir, "scripts"))
HOMEDIR = os.path.expanduser('~')

download_md5 = [('mt-st-helens-veg', 'd5782e07241cb3fe9f5b2e1bb804a794'),
                ('bird-size', '45c7507ae945868c71b5179f7682ea9c'),
                ('mammal-masses', 'b54b80d0d1959bdea0bb8a59b70fa871')]

db_md5 = [
    # ('mt_st_helens_veg', '0'),
    ('bird_size', '98dcfdca19d729c90ee1c6db5221b775'),
    ('mammal_masses', '6fec0fc63007a4040d9bbc5cfcd9953e')
]
コード例 #2
0
ファイル: try_install_all.py プロジェクト: dlebauer/retriever
"""Attempt to install all datasets into all database management systems

This module, when run, attempts to install datasets from all Retriever scripts
in the /scripts folder (except for those listed in IGNORE), for each engine in
ENGINE_LIST() from __init__.py. In other words, it runs trys to install using
all possible combinations of database platform and script and checks to
see if there are any errors. It does not check the values in the database.

"""
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
from imp import reload
from retriever.lib.tools import choose_engine
from retriever import MODULE_LIST, ENGINE_LIST, SCRIPT_LIST

reload(sys)
if hasattr(sys, 'setdefaultencoding'):
    sys.setdefaultencoding('latin-1')
if os.name == "nt":
    os_password = "******"
else:
    os_password = ""

MODULE_LIST = MODULE_LIST()
ENGINE_LIST = ENGINE_LIST()
if len(sys.argv) > 1:
    ENGINE_LIST = [
        e for e in ENGINE_LIST
コード例 #3
0
"""Contains implementations of wx.App and wx.Frame for the GUI."""

import wx
from retriever.app.connect_wizard import ConnectWizard
from retriever.app.controls import *
from retriever.app.download_manager import DownloadManager
from retriever.app.images import icon, cycle, download, downloaded, error, warning, logo
from retriever.lib.tools import get_default_connection, get_saved_connection, choose_engine
from retriever.lib.lists import Category
from retriever import VERSION, ENGINE_LIST, SCRIPT_LIST

ENGINE_LIST = ENGINE_LIST()


class App(wx.App):
    def __init__(self, lists):
        wx.App.__init__(self, redirect=False)

        mfs = wx.MemoryFSHandler()
        wx.FileSystem_AddHandler(mfs)
        mfs.AddFile("globe.png", icon.GetImage(), wx.BITMAP_TYPE_PNG)
        mfs.AddFile("cycle.png", cycle.GetImage(), wx.BITMAP_TYPE_PNG)
        mfs.AddFile("download.png", download.GetImage(), wx.BITMAP_TYPE_PNG)
        mfs.AddFile("downloaded.png", downloaded.GetImage(),
                    wx.BITMAP_TYPE_PNG)
        mfs.AddFile("error.png", error.GetImage(), wx.BITMAP_TYPE_PNG)
        mfs.AddFile("warning.png", warning.GetImage(), wx.BITMAP_TYPE_PNG)
        mfs.AddFile("logo.png", logo.GetImage(), wx.BITMAP_TYPE_PNG)

        default_connection = get_default_connection()
        if default_connection: