Example #1
0
def merge_dss(src_dss, dest_dss):
    '''
    Return list containing FQPN of DSS files

    Input: java.nio.file.Path src_path java.lang.String dest_path
    Merge all grid paths in the source dss file into the destination dss file
    '''
    start_timer = System.currentTimeMillis()
    dss7 = HecDSSUtilities()
    dss6 = HecDSSUtilities()
    merged_paths = list()
    # Process the DSS file
    if Files.exists(src_dss):
        # try:
        dss6path = src_dss.toString().replace("dss7", "dss6")
        dss7.setDSSFileName(src_dss.toString())
        dss7.convertVersion(dss6path)
        dss6.setDSSFileName(dss6path)
        dss6.copyFile(dest_dss)
        dss7.copyFile(dest_dss)
        dss7.close()
        dss6.close()
        if dest_dss not in merged_paths: merged_paths.append(dest_dss)

    end_timer = System.currentTimeMillis()
    cumulus_logger.debug(
        "Merging DSS records (milliseconds): {}".format(
            (end_timer - start_timer)
        )
    )

    return merged_paths
    def __init__(self, url, username, password, proxy_host=None, proxy_port=None, ant_executable="ant.sh",
                 migration_tool_jar="salesforce/ant-salesforce.jar"):

        path = Paths.get(migration_tool_jar)
        if not Files.exists(path):
            raise Exception("Migration jar not found [%s]." % migration_tool_jar)
        self.migration_tool_jar = str(path.toAbsolutePath())
        self.ant_executable = ant_executable
        self.proxy_port = proxy_port
        self.proxy_host = proxy_host
        self.url = url
        self.username = username
        self.password = password