def buildClient(user = '******' ,pwd = 'Dermot'): client = LMClient() client.login(user,pwd) return client
from LmClient.lmClientLib import LMClient 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)
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 help(self): self.help = QWidget() self.help.resize(600, 400) self.help.setMinimumSize(600, 400) self.help.setMaximumSize(1000, 1000) layout = QVBoxLayout() helpDialog = QTextBrowser() #helpDialog.setSearchPaths(['documents']) helppath = os.path.dirname( os.path.realpath(__file__)) + '/documents/help.html' helpDialog.setSource(QUrl.fromLocalFile(helppath)) helpDialog.scrollToAnchor('uploadLayers') layout.addWidget(helpDialog) self.help.setLayout(layout) if self.isModal(): self.setModal(False) self.help.show() if __name__ == "__main__": # client = LMClient(userId='blank', pwd='blank') qApp = QApplication(sys.argv) d = UploadDialog(None, client=client) #d = AdvancedAlgo() d.show() sys.exit(qApp.exec_())
helpWindow = QtGui.QDialog() helpWindow.setWindowTitle("Lifemapper Help") self.help = QtGui.QWidget(helpWindow) #self.help.setWindowTitle('LmSDM Help') self.help.resize(600, 400) self.help.setMinimumSize(600, 400) self.help.setMaximumSize(1000, 1000) layout = QtGui.QVBoxLayout() helpDialog = QtGui.QTextBrowser() helpDialog.setOpenExternalLinks(True) #helpDialog.setSearchPaths(['documents']) helppath = os.path.dirname( os.path.realpath(__file__)) + '/documents/help.html' helpDialog.setSource(QtCore.QUrl.fromLocalFile(helppath)) helpDialog.scrollToAnchor(self.helpAnchor) layout.addWidget(helpDialog) self.help.setLayout(layout) #if self.isModal(): # self.setModal(False) #self.help.show() helpWindow.exec_() if __name__ == "__main__": # client = LMClient(userId='', pwd='') qApp = QtGui.QApplication(sys.argv) #d = PostScenarioDialog(match=True,scenarioId=204,client=client) d = PostScenarioDialog(client=client) d.show() sys.exit(qApp.exec_())
def buildClient(user='******', pwd='Dermot'): client = LMClient() client.login(user, pwd) return client
import os, sys import csv sys.path.append( '/home/jcavner/workspace/lm3/components/LmClient/LmQGIS/V2/lifemapperTools/LmShared' ) configPath = '/home/jcavner/workspace/lm3/components/LmClient/LmQGIS/V2/lifemapperTools/config/config.ini' os.environ["LIFEMAPPER_CONFIG_FILE"] = configPath from LmClient.lmClientLib import LMClient client = LMClient(userId='HuwPrice', pwd='HuwPrice') #res = client.sdm.postExperiment('ATT_MAXENT',32,4395448,prjScns=[32], # mdlMask=1569,prjMask=1569) #print res #print res.id # pam = client.rad.getPamCsv(529, 651, headers=True, filePath='/home/jcavner/csvTest/birds.csv') print "done" #pamiter = csv.reader(pam.splitlines(),delimiter=',') #pamL = list(pamiter) #print pamL[0] # #c = 0 #for y in pamL: # l = y[3:] # lInt = map(int,l) #
#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_())
tableView.setModel(self.tableModel) 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',