示例#1
0
# Version 1.0 - Created.

import eodatadown.eodatadownutils
import argparse
import logging
import rsgislib

logger = logging.getLogger('eoddpassencode.py')

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("-p",
                        "--password",
                        type=str,
                        required=True,
                        help="Password which is going to be encoded.")
    args = parser.parse_args()

    t = rsgislib.RSGISTime()
    t.start(True)
    try:
        eddPassEncoder = eodatadown.eodatadownutils.EDDPasswordTools()
        encodedPass = eddPassEncoder.encodePassword(args.password)
        print(encodedPass)
        logger.info('Successfully created encoded password.')
    except Exception as e:
        logger.error('Failed to open file', exc_info=True)
    t.end(reportDiff=True,
          preceedStr='EODataDown processing completed ',
          postStr=' - eoddpassencode.py.')
示例#2
0
            if not envVar == None:
                if envVar == "TRUE":
                    args.simpledos = True
                    print(
                        "Using simple DOS method due to environment variable.")
                else:
                    args.simpledos = False
                    print(
                        "Not using simple DOS method due to environment variable."
                    )

            envVar = arcsiUtils.getEnvironmentVariable("ARCSI_SCALE_FACTOR")
            if not envVar == None:
                args.scalefac = int(envVar)

            runTimer = rsgislib.RSGISTime()
            runTimer.start(True)

            try:
                ######### Initialise and parameters object. #########
                rsgisUtils = rsgislib.RSGISPyUtils()
                inputHeadersLst = rsgisUtils.readTextFile2List(
                    args.inputheaders)
                paramsLst = []
                calc6SSREF = False
                exportMetaData = False
                calcAOT = False
                useAOTImage = False
                first = True
                for inputHeader in inputHeadersLst:
                    paramsObj = None