import os,sys import commands import_path = "/home/jcavner/workspace/lm3/components/LmClient/LmQGIS/V2/lifemapperTools/" sys.path.append(os.path.join(import_path, 'LmShared')) configPath = os.path.join(import_path, 'config', 'config.ini') os.environ["LIFEMAPPER_CONFIG_FILE"] = configPath ####################################### from LmClient.lmClientLib import LMClient client = LMClient() client.login('MobileAlabama2','MobileAlabama2') tifs = ['/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/slope_deg.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/mean_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/min_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/cv_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/max_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/slope_deg.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/mean_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/min_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/cv_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/max_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/slope_deg.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/mean_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/min_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/cv_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/max_flow.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2086 med/GeoTiffProjected/slope_deg.tif' ,'/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2086 med/GeoTiffProjected/mean_flow.tif'
def buildClient(user = '******' ,pwd = 'Dermot'): client = LMClient() client.login(user,pwd) return client
tiffDLoc = '/home/jcavner/Philippines_ScenarionLyrs_Downloaded/' res = commands.getoutput('ls %s*.tif' % (tiffDLoc)) tiffPaths = res.split('\n') user = '******' pwd = 'DermotYeti' client = LMClient() client.login(user,pwd) for fullPath in tiffPaths: try: fullName = os.path.basename(fullPath).replace('.tif','') typeCodeName = fullName.split('_')[0] name = fullName.replace('_AEAC',"") typeCodeTitle = typeCodeName description = typeCodeName newCode = client.sdm.postTypeCode(typeCodeName, title=typeCodeTitle, description=description)
def buildClient(user='******', pwd='Dermot'): client = LMClient() client.login(user, pwd) return client
#self.callBack = None self.hint = Hint(self.client, callBack=self.callBack) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QApplication.translate("MainWindow", "MainWindow", None, QApplication.UnicodeUTF8)) if __name__ == "__main__": # ----- client import_path = "/home/jcavner/ghWorkspace/LmQGIS.git/lifemapperTools/" sys.path.append(os.path.join(import_path, 'LmShared')) configPath = os.path.join(import_path, 'config', 'config.ini') os.environ["LIFEMAPPER_CONFIG_FILE"] = configPath from LmClient.lmClientLib import LMClient # ------- client = LMClient() client.login(userId='Dermot', pwd='Dermot') app = QApplication(sys.argv) MainWindow = QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow, client) MainWindow.show() sys.exit(app.exec_())
return tableView if __name__ == "__main__": # import_path = "/home/jcavner/workspace/lm3/components/LmClient/LmQGIS/V2/lifemapperTools/" sys.path.append(os.path.join(import_path, 'LmShared')) configPath = os.path.join(import_path, 'config', 'config.ini') os.environ["LIFEMAPPER_CONFIG_FILE"] = configPath from LmClient.lmClientLib import LMClient client = LMClient() client.login(userId='Dermot', pwd='Dermot') qApp = QApplication(sys.argv) d = ArchiveBrowserDialog(None,client=client) d.show() sys.exit(qApp.exec_())
import os, sys import commands import_path = "/home/jcavner/workspace/lm3/components/LmClient/LmQGIS/V2/lifemapperTools/" sys.path.append(os.path.join(import_path, 'LmShared')) configPath = os.path.join(import_path, 'config', 'config.ini') os.environ["LIFEMAPPER_CONFIG_FILE"] = configPath ####################################### from LmClient.lmClientLib import LMClient client = LMClient() client.login('MobileAlabama2', 'MobileAlabama2') tifs = [ '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/slope_deg.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/mean_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/min_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/cv_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/current training layers/GeoTiffProjected/max_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/slope_deg.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/mean_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/min_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/cv_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 low/GeoTiffProjected/max_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/slope_deg.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/mean_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/min_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/cv_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2051 high/GeoTiffProjected/max_flow.tif', '/home/jcavner/MobileAlabama/Knouft_data_for_KU/flow_rasters/future projection layers/2086 med/GeoTiffProjected/slope_deg.tif',