• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python midvatten_utils.returnunicode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中midvatten_utils.returnunicode函数的典型用法代码示例。如果您正苦于以下问题:Python returnunicode函数的具体用法?Python returnunicode怎么用?Python returnunicode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了returnunicode函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_stratigraphy

    def test_stratigraphy(self, mock_skippopup, mock_messagebar):
        """
        :param mock_skippopup:
        :param mock_messagebar:
        :return:
        """
        db_utils.sql_alter_db('''INSERT INTO obs_points (obsid, h_gs, geometry) VALUES ('1', 5, ST_GeomFromText('POINT(633466 711659)', 3006))''')
        db_utils.sql_alter_db('''INSERT INTO obs_points (obsid, h_gs, geometry) VALUES ('2', 10, ST_GeomFromText('POINT(6720727 016568)', 3006))''')
        db_utils.sql_alter_db('''INSERT INTO obs_points (obsid, h_gs, geometry) VALUES ('3', 20, ST_GeomFromText('POINT(6720728 016569)', 3006))''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('1', 1, 0, 1, 'sand', 'sand', '3', 'j')''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('1', 2, 1, 4.5, 'morän', 'morän', '3', 'j')''')

        self.create_and_select_vlayer()

        #print(str(self.vlayer.isValid()))
        #print(str(db_utils.sql_load_fr_db('select * from obs_points')))
        #print(str(db_utils.sql_load_fr_db('select * from stratigraphy')))
        dlg = Stratigraphy(self.iface, self.vlayer, self.ms.settingsdict)
        #print(str(mock_messagebar.mock_calls))
        #print(str(mock_skippopup.mock_calls))
        dlg.showSurvey()
        test = utils.anything_to_string_representation(dlg.data)
        test_survey = utils.anything_to_string_representation(repr(dlg.data['1']))
        test_strata = utils.anything_to_string_representation(utils.returnunicode(dlg.data['1'].strata, keep_containers=True))

        assert len(mock_skippopup.mock_calls) == 0
        print(str(mock_messagebar.mock_calls))
        assert len(mock_messagebar.mock_calls) == 0
        assert test == """{"1": SURVEY('1', 5.000000, '<QgsPointXY: POINT(633466 711659)>')}"""
        assert test_survey == '''"SURVEY('1', 5.000000, '<QgsPointXY: POINT(633466 711659)>')"'''
        print("test_strata: " + test_strata)
        assert test_strata == '''["strata(1, '3', 'sand', 'sand', 0.000000-1.000000)", "strata(2, '3', 'morän', 'moran', 1.000000-4.500000)"]'''
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:32,代码来源:test_stratigraphy_postgis.py


示例2: get_last_used_quality_instruments

def get_last_used_quality_instruments():
    """
    Returns quality instrumentids
    :return: A tuple with instrument ids from w_qual_field
    """
    sql = "select parameter, unit, instrument, staff, max(date_time) from w_qual_field group by parameter, unit, instrument, staff"
    connection_ok, result_dict = utils.get_sql_result_as_dict(sql)
    return returnunicode(result_dict, True)
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:8,代码来源:midvatten_defs.py


示例3: rpt_lower_left

 def rpt_lower_left(self, GeneralData):
     rpt = r"""<p style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;">"""
     if utils.returnunicode(GeneralData[0][24]) not in ['','NULL'] and utils.returnunicode(GeneralData[0][25]) not in ['','NULL']:
         rpt += utils.returnunicode(GeneralData[0][24])
         rpt += utils.returnunicode(GeneralData[0][25])
     elif utils.returnunicode(GeneralData[0][24]) not in ['','NULL']:
         rpt += utils.returnunicode(GeneralData[0][24])
     elif utils.returnunicode(GeneralData[0][25]) not in ['','NULL']:
         rpt += utils.returnunicode(GeneralData[0][25])
     rpt += r"""</p>"""
     return rpt
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:11,代码来源:drillreport.py


示例4: rpt_lower_right

 def rpt_lower_right(self, statistics,meas_or_level_masl):
     if meas_or_level_masl == 'meas':
         unit = u' m below toc<br>'
     else:
         unit = u' m above sea level<br>'
     rpt = r"""<p style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;">"""
     if utils.returnunicode(statistics[2]) != '' and utils.returnunicode(statistics[2]) != '0':
         rpt += u'Number of water level measurements: ' +  utils.returnunicode(statistics[2]) + u'<br>'
         if utils.returnunicode(statistics[0]) != '':
             rpt += u'Highest measured water level: ' +  utils.returnunicode(statistics[0]) + unit
         if utils.returnunicode(statistics[1]) != '':
             rpt += u'Median water level: ' +  utils.returnunicode(statistics[1]) + unit
         if utils.returnunicode(statistics[3]) != '':
             rpt += u'Lowest measured water level: ' +  utils.returnunicode(statistics[3]) + unit
     rpt += r"""</p>"""
     return rpt
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:16,代码来源:drillreport.py


示例5: rpt_lower_right_sv

 def rpt_lower_right_sv(self, statistics,meas_or_level_masl):
     if meas_or_level_masl == 'meas':
         unit = u' m u rök<br>'
     else:
         unit = u' m ö h<br>'
     rpt = r"""<p style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;">"""
     if utils.returnunicode(statistics[2]) != '' and utils.returnunicode(statistics[2]) != '0':
         rpt += u'Antal nivåmätningar: ' +  utils.returnunicode(statistics[2]) +  u'<br>'
         if utils.returnunicode(statistics[0]) != '':
             rpt += u'Högsta uppmätta nivå: ' +  utils.returnunicode(statistics[0]) + unit
         if utils.returnunicode(statistics[1]) != '':
             rpt += u'Medianvärde för nivå: ' +  utils.returnunicode(statistics[1]) + unit
         if utils.returnunicode(statistics[3]) != '':
             rpt += u'Lägsta uppmätta nivå: ' +  utils.returnunicode(statistics[3]) + unit
     rpt += r"""</p>"""
     return rpt
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:16,代码来源:drillreport.py


示例6: rpt_upper_right_sv

 def rpt_upper_right_sv(self, StratData):
     rpt = r"""<p style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;">"""
     if len(StratData) > 0:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=17%><P><u>""" + u'nivå (mumy)</P></u></TD>'
         rpt += r"""<TD WIDTH=27%><P><u>""" + u'jordart, fullst beskrivn' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=17%><P><u>""" + u'huvudfraktion' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=5%><P><u>""" + u'vg' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=9%><P><u>""" + u'stänger?' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=27%><P><u>""" + u'kommentar' + '</P></u></TD></TR>'
     for row in StratData:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=17%><P>"""
         rpt += utils.returnunicode(row[2]) + ' - ' + utils.returnunicode(row[3]) + '</P></TD>'
         rpt += r"""<TD WIDTH=27%><P>""" + utils.returnunicode(row[4]) + '</P></TD>'
         rpt += r"""<TD WIDTH=17%><P>""" + utils.returnunicode(row[5]) + '</P></TD>'
         rpt += r"""<TD WIDTH=5%><P>""" + utils.returnunicode(row[6]) + '</P></TD>'
         rpt += r"""<TD WIDTH=9%><P>""" + utils.returnunicode(row[7]) + '</P></TD>'
         rpt += r"""<TD WIDTH=27%><P>""" + utils.returnunicode(row[8]) + '</P></TD></TR>'
     rpt += r"""</p>"""
     return rpt
开发者ID:P4tty,项目名称:qgis-midvatten-plugin,代码行数:19,代码来源:drillreport.py


示例7: rpt_upper_right

 def rpt_upper_right(self, StratData):
     rpt = r"""<p style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;">"""
     if len(StratData) > 0:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=15%><P><u>""" + u'level (m b gs)</P></u></TD>'
         rpt += r"""<TD WIDTH=27%><P><u>""" + u'geology, full text' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=17%><P><u>""" + u'geology, short' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=9%><P><u>""" + u'capacity' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=13%><P><u>""" + u'development' + '</P></u></TD>'
         rpt += r"""<TD WIDTH=21%><P><u>""" + u'comment' + '</P></u></TD></TR>'
     for row in StratData:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=15%><P>"""
         rpt += utils.returnunicode(row[2]) + ' - ' + utils.returnunicode(row[3]) + '</P></TD>'
         rpt += r"""<TD WIDTH=27%><P>""" + utils.returnunicode(row[4]) + '</P></TD>'
         rpt += r"""<TD WIDTH=17%><P>""" + utils.returnunicode(row[5]) + '</P></TD>'
         rpt += r"""<TD WIDTH=9%><P>""" + utils.returnunicode(row[6]) + '</P></TD>'
         rpt += r"""<TD WIDTH=13%><P>""" + utils.returnunicode(row[7]) + '</P></TD>'
         rpt += r"""<TD WIDTH=21%><P>""" + utils.returnunicode(row[8]) + '</P></TD></TR>'
     rpt += r"""</p>"""
     return rpt
开发者ID:P4tty,项目名称:qgis-midvatten-plugin,代码行数:19,代码来源:drillreport.py


示例8: __init__

 def __init__(self,msettings,activelayer):
     self.ms = msettings
     self.activelayer = activelayer
     self.create_parameter_selection()
     self.get_selected_observations()
     if self.ms.settingsdict['piper_markers']=='type':
         self.get_selected_obstypes()#gets unique plt.plottypes and a plt.plot type dictionary
         self.create_markers()
     elif self.ms.settingsdict['piper_markers']=='obsid' or self.ms.settingsdict['piper_markers']=='obsid but no legend':
         self.create_markers()
     elif self.ms.settingsdict['piper_markers']=='date_time':
         self.get_selected_datetimes()
         self.create_markers()
     self.get_piper_data()
     #here is a simple printout (to python console) to let the user see the piper plt.plot data
     print """obsid, date_time, type, Cl_meqPl, HCO3_meqPl, SO4_meqPl, Na+K_meqPl, Ca_meqPl, Mg_meqPl"""
     for row in self.obsrecarray:
         #print ','.join([unicode(col).encode('utf-8') for col in row])
         try:
             print ','.join([utils.returnunicode(col) for col in row])
         except:
             print "failed printing piper data..."            
     self.make_the_plot()
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:23,代码来源:piper.py


示例9: test_stratigraphy_missing_h_gs

    def test_stratigraphy_missing_h_gs(self, mock_skippopup, mock_messagebar):
        """
        
        :param mock_skippopup:
        :param mock_messagebar:
        :return:
        """
        db_utils.sql_alter_db('''INSERT INTO obs_points (obsid, h_gs, geometry) VALUES ('1', 5, ST_GeomFromText('POINT(633466 711659)', 3006))''')
        db_utils.sql_alter_db('''INSERT INTO obs_points (obsid, h_gs, h_toc, geometry) VALUES ('2', NULL, 10, ST_GeomFromText('POINT(6720727 016568)', 3006))''')
        db_utils.sql_alter_db('''INSERT INTO obs_points (obsid, geometry) VALUES ('3', ST_GeomFromText('POINT(6720728 016569)', 3006))''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('1', 1, 0, 1, 'sand', 'sand', '3', 'j')''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('1', 2, 1, 4.5, 'morän', 'morän', '3', 'j')''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('2', 1, 0, 1, 'sand', 'sand', '3', 'j')''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('2', 2, 1, 4.5, 'morän', 'morän', '3', 'j')''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('3', 1, 0, 2, 'sand', 'sand', '3', 'j')''')
        db_utils.sql_alter_db('''INSERT INTO stratigraphy (obsid, stratid, depthtop, depthbot, geology, geoshort, capacity, development) VALUES ('3', 2, 2, 6, 'morän', 'morän', '3', 'j')''')
        self.create_and_select_vlayer()

        dlg = Stratigraphy(self.iface, self.vlayer, self.ms.settingsdict)

        dlg.showSurvey()
        test = utils.anything_to_string_representation(dlg.data)
        test_survey = utils.anything_to_string_representation(repr(dlg.data['1']))
        test_strata = utils.anything_to_string_representation(utils.returnunicode(dlg.data['1'].strata, keep_containers=True))

        assert len(mock_skippopup.mock_calls) == 1
        print(str(mock_skippopup.mock_calls))
        print(str(mock_messagebar.mock_calls))
        assert mock_skippopup.mock_calls == [mock.call('Warning, h_gs is missing. See messagebar.')]
        assert mock_messagebar.mock_calls == [mock.call.warning(bar_msg="Obsid 2: using h_gs '' failed, using 'h_toc' instead.", duration=90, log_msg='False'),
                                              mock.call.warning(bar_msg="Obsid 3: using h_gs '' failed, using '-1' instead.", duration=90, log_msg='False')]
        print("test: " + test)
        assert test == """{"1": SURVEY('1', 5.000000, '<QgsPointXY: POINT(633466 711659)>'), "2": SURVEY('2', 10.000000, '<QgsPointXY: POINT(6720727 16568)>'), "3": SURVEY('3', -1.000000, '<QgsPointXY: POINT(6720728 16569)>')}"""
        print("test_survey " + test_survey)
        assert test_survey == '''"SURVEY('1', 5.000000, '<QgsPointXY: POINT(633466 711659)>')"'''
        print("Test strata " + test_strata)
        assert test_strata == '''["strata(1, '3', 'sand', 'sand', 0.000000-1.000000)", "strata(2, '3', 'morän', 'moran', 1.000000-4.500000)"]'''
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:37,代码来源:test_stratigraphy_postgis.py


示例10: rpt_upper_left

 def rpt_upper_left(self, GeneralData, CRS='', CRSname=''):
     rpt = r"""<p style="font-family:'arial'; font-size:8pt; font-weight:400; font-style:normal;">"""
     if utils.returnunicode(GeneralData[0][1]) != '' and utils.returnunicode(GeneralData[0][1]) != 'NULL' and utils.returnunicode(GeneralData[0][1]) != utils.returnunicode(GeneralData[0][0]):
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'original name' + r"""</TD><TD WIDTH=67%>""" + utils.returnunicode(GeneralData[0][1]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][3]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'obs type' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][3]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][4]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'depth (m fr gs to bottom)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][4]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][17]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'top of casing, toc (masl)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][17])
         if utils.returnunicode(GeneralData[0][21]) != '':
             rpt += u' (' +  utils.returnunicode(GeneralData[0][21]) + ')'
         rpt += '</TD></TR>'
     if utils.returnunicode(GeneralData[0][18]) not in ['','NULL'] and utils.returnunicode(GeneralData[0][18]) != '0' and utils.returnunicode(GeneralData[0][18]) != '0.0':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'distance toc-gs, tocags (mags)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][18]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][19]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'ground surface level, gs (masl)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][19])
         if utils.returnunicode(GeneralData[0][21]) != '':
             rpt += u' (' +  utils.returnunicode(GeneralData[0][21]) + ')'
         rpt += '</TD></TR>'
     if utils.returnunicode(GeneralData[0][20]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'elevation accuracy (m)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][20]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][13]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'eastern coordinate' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][13]) + ' (' + CRSname  + ', EPSG:' + CRS + ')</TD></TR>'
     if utils.returnunicode(GeneralData[0][14]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'northern coordinate' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][14]) + ' (' + CRSname  + ', EPSG:' + CRS + ')</TD></TR>'
     if utils.returnunicode(GeneralData[0][13]) not in ['','NULL'] and utils.returnunicode(GeneralData[0][14]) != '' and utils.returnunicode(GeneralData[0][15]) != '':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'position accuracy' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][15]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][7]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'material' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][7]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][6]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'inner diameter (mm)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][6]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][5]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'drill stop' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][5]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][8]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'screen type' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][8]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][10]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'drill date' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][10]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][9]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'capacity' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][9]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][2]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'place' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][2]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][23]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'reference' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][23]) + '</TD></TR>'
     rpt += r"""</p>"""
     if utils.returnunicode(GeneralData[0][16]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'source for position' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][16]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][22]) not in ['','NULL']:
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'source for elevation' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][22]) + '</TD></TR>'
     return rpt
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:50,代码来源:drillreport.py


示例11: rpt_upper_left_sv

 def rpt_upper_left_sv(self, GeneralData, CRS='', CRSname=''):
     rpt = r"""<p style="font-family:'arial'; font-size:8pt; font-weight:400; font-style:normal;">"""
     if utils.returnunicode(GeneralData[0][1]) != '' and utils.returnunicode(GeneralData[0][1]) != 'NULL' and utils.returnunicode(GeneralData[0][1]) != utils.returnunicode(GeneralData[0][0]):
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'originalbenämning' + r"""</TD><TD WIDTH=67%>""" + utils.returnunicode(GeneralData[0][1]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][3]) != '' and utils.returnunicode(GeneralData[0][3]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'obstyp' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][3]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][4]) != '' and utils.returnunicode(GeneralData[0][4]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'djup (m fr my t botten)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][4]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][17]) != '' and utils.returnunicode(GeneralData[0][17]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'röröverkant (möh)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][17])
         if utils.returnunicode(GeneralData[0][21]) != '':
             rpt += u' (' +  utils.returnunicode(GeneralData[0][21]) + ')'
         rpt += '</TD></TR>'
     if utils.returnunicode(GeneralData[0][18]) != ''  and utils.returnunicode(GeneralData[0][18]) != 'NULL' and utils.returnunicode(GeneralData[0][18]) != '0' and utils.returnunicode(GeneralData[0][18]) != '0.0':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'rörövermått (m ö my)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][18]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][19]) != '' and utils.returnunicode(GeneralData[0][19]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'markytans nivå, my (möh)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][19])
         if utils.returnunicode(GeneralData[0][21]) != '':
             rpt += u' (' +  utils.returnunicode(GeneralData[0][21]) + ')'
         rpt += '</TD></TR>'
     if utils.returnunicode(GeneralData[0][20]) != '' and utils.returnunicode(GeneralData[0][20]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'onoggrannhet i höjd, avser rök (m)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][20]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][13]) != '' and utils.returnunicode(GeneralData[0][13]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'östlig koordinat' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][13]) + ' (' + CRSname  + ', EPSG:' + CRS + ')</TD></TR>'
     if utils.returnunicode(GeneralData[0][14]) != '' and utils.returnunicode(GeneralData[0][14]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'nordlig koordinat' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][14]) + ' (' + CRSname  + ', EPSG:' + CRS + ')</TD></TR>'
     if utils.returnunicode(GeneralData[0][13]) != ''  and utils.returnunicode(GeneralData[0][13]) != 'NULL' and utils.returnunicode(GeneralData[0][14]) != '' and utils.returnunicode(GeneralData[0][15]) != '':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'lägesonoggrannhet' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][15]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][7]) != '' and utils.returnunicode(GeneralData[0][7]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'material' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][7]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][6]) != '' and utils.returnunicode(GeneralData[0][6]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'innerdiameter (mm)' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][6]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][5]) != '' and utils.returnunicode(GeneralData[0][5]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'borrningens avslut' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][5]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][8]) != '' and utils.returnunicode(GeneralData[0][8]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'filter/spets' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][8]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][10]) != '' and utils.returnunicode(GeneralData[0][10]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'borrningen avslutades' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][10]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][9]) != '' and utils.returnunicode(GeneralData[0][9]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'kapacitet/vg på spetsnivå' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][9]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][2]) != '' and utils.returnunicode(GeneralData[0][2]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'fastighet/plats' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][2]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][23]) != '' and utils.returnunicode(GeneralData[0][23]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'referens' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][23]) + '</TD></TR>'
     rpt += r"""</p>"""
     if utils.returnunicode(GeneralData[0][16]) != '' and utils.returnunicode(GeneralData[0][16]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'lägesangivelsens ursprung' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][16]) + '</TD></TR>'
     if utils.returnunicode(GeneralData[0][22]) != '' and utils.returnunicode(GeneralData[0][22]) != 'NULL':
         rpt += r"""<TR VALIGN=TOP><TD WIDTH=33%>""" + u'höjdangivelsens ursprung' + r"""</TD><TD WIDTH=50%>""" + utils.returnunicode(GeneralData[0][22]) + '</TD></TR>'
     return rpt
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:50,代码来源:drillreport.py


示例12: connection

 def connection(self, value):
     index = self._connection.findText(utils.returnunicode(value))
     if index != -1:
         self._connection.setCurrentIndex(index)
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:4,代码来源:midvsettingsdialog.py


示例13: __init__

    def __init__(self, obsid='', settingsdict = {}):
         #open connection to report file
        reportfolder = os.path.join(QDir.tempPath(), 'midvatten_reports')
        if not os.path.exists(reportfolder):
            os.makedirs(reportfolder)
        reportpath = os.path.join(reportfolder, "drill_report.html")
        logopath = os.path.join(os.sep,os.path.dirname(__file__),"..","about","midvatten_logga.png")
        imgpath = os.path.join(os.sep,os.path.dirname(__file__),"..","reports")
        f = codecs.open(reportpath, "wb", "utf-8")
        
        #write some initiating html, header and also 
        rpt = r"""<meta http-equiv="content-type" content="text/html; charset=utf-8" />""" 
        rpt += r"""<head><title>%s General report from Midvatten plugin for QGIS</title></head>"""%obsid
        rpt += r"""<html><TABLE WIDTH=100% BORDER=0 CELLPADDING=1 CELLSPACING=1><TR VALIGN=TOP><TD WIDTH=15%><h3 style="font-family:'arial';font-size:18pt; font-weight:600">"""
        rpt += obsid
        if  utils.getcurrentlocale() == 'sv_SE':
            rpt += ''.join([r'''</h3><img src="''', os.path.join(imgpath, 'for_general_report_sv.png'), r'''" /><br><img src=''', r"""'"""])
            #rpt += r"""</h3><img src="for_general_report_sv.png" /><br><img src='"""
        else:
            rpt += ''.join([r'''</h3><img src="''', os.path.join(imgpath, 'for_general_report.png'), r'''" /><br><img src=''', r"""'"""])
            #rpt += r"""</h3><img src="for_general_report.png" /><br><img src='"""
        rpt += logopath
        rpt +="""' /></TD><TD WIDTH=85%><TABLE WIDTH=100% BORDER=1 CELLPADDING=4 CELLSPACING=3><TR VALIGN=TOP><TD WIDTH=50%><P><U><B>"""
        if  utils.getcurrentlocale() == 'sv_SE':
            rpt += u'Allmän information' 
        else:
            rpt += u'General information' 
        rpt += r"""</B></U></P><TABLE style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;" WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1><COL WIDTH=43*><COL WIDTH=43*>"""
        f.write(rpt)
        
        # GENERAL DATA UPPER LEFT QUADRANT
        ConnectionOK, GeneralData = self.GetData(obsid, 'obs_points', 'n')#MacOSX fix1
        #utils.pop_up_info(str(ConnectionOK))#debug
        if ConnectionOK==True:
            result2 = (utils.sql_load_fr_db(r"""SELECT srid FROM geometry_columns where f_table_name = 'obs_points'""")[1])[0][0]
            CRS = utils.returnunicode(result2) #1st we need crs
            result3 = (utils.sql_load_fr_db(r"""SELECT ref_sys_name FROM spatial_ref_sys where srid =""" + CRS)[1])[0][0]
            CRSname = utils.returnunicode(result3) # and crs name
            if  utils.getcurrentlocale() == 'sv_SE':
                reportdata_1 = self.rpt_upper_left_sv(GeneralData, CRS, CRSname)
            else:
                reportdata_1 = self.rpt_upper_left(GeneralData, CRS, CRSname)
            f.write(reportdata_1)

            rpt = r"""</TABLE></TD><TD WIDTH=50%><P><U><B>"""
            if  utils.getcurrentlocale() == 'sv_SE':
                rpt += u'Lagerföljd' 
            else:
                rpt += u'Stratigraphy' 
            rpt += r"""</B></U></P><TABLE style="font-family:'arial'; font-size:10pt; font-weight:400; font-style:normal;" WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1><COL WIDTH=43*><COL WIDTH=43*><COL WIDTH=43*><COL WIDTH=43*><COL WIDTH=43*><COL WIDTH=43*>"""
            f.write(rpt)        

            # STRATIGRAPHY DATA UPPER RIGHT QUADRANT
            StratData = self.GetData(obsid, 'stratigraphy', 'n')[1] #MacOSX fix1
            if  utils.getcurrentlocale() == 'sv_SE':
                reportdata_2 = self.rpt_upper_right_sv(StratData)
            else:
                reportdata_2 = self.rpt_upper_right(StratData)
            f.write(reportdata_2)

            rpt = r"""</TABLE></TD></TR><TR VALIGN=TOP><TD WIDTH=50%><P><U><B>""" 
            if  utils.getcurrentlocale() == 'sv_SE':
                rpt += u'Kommentarer' 
            else:
                rpt += u'Comments' 
            rpt += r"""</B></U></P>"""
            f.write(rpt)        

            # COMMENTS LOWER LEFT QUADRANT
            reportdata_3 = self.rpt_lower_left(GeneralData)
            f.write(reportdata_3)

            rpt = r"""</TD><TD WIDTH=50%><P><U><B>""" 
            if  utils.getcurrentlocale() == 'sv_SE':
                rpt += u'Vattennivåer' 
            else:
                rpt += u'Water levels' 
            rpt += r"""</B></U></P>"""
            f.write(rpt)

            # WATER LEVEL STATISTICS LOWER RIGHT QUADRANT
            meas_or_level_masl, statistics = GetStatistics(obsid)#MacOSX fix1
            if  utils.getcurrentlocale() == 'sv_SE':
                reportdata_4 = self.rpt_lower_right_sv(statistics,meas_or_level_masl)
            else:
                reportdata_4 = self.rpt_lower_right(statistics,meas_or_level_masl)
            f.write(reportdata_4)
            
            f.write(r"""</TD></TR></TABLE></TD></TR></TABLE>""")    
            f.write("\n</p></body></html>")        
            f.close()
            #print reportpath#debug
            QDesktopServices.openUrl(QUrl.fromLocalFile(reportpath))
开发者ID:mirouml,项目名称:qgis-midvatten-plugin,代码行数:93,代码来源:drillreport.py


示例14: dbpath

 def dbpath(self):
     return utils.returnunicode(self._dbpath.text())
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:2,代码来源:midvsettingsdialog.py


示例15: dbtype_combobox

 def dbtype_combobox(self, value):
     index = self._dbtype_combobox.findText(utils.returnunicode(value))
     if index != -1:
         self._dbtype_combobox.setCurrentIndex(index)
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:4,代码来源:midvsettingsdialog.py


示例16: select_file

 def select_file(self):
     """ Open a dialog to locate the sqlite file and some more..."""
     dbpath, __ = QFileDialog.getOpenFileName(None, str("Select database:"), "*.sqlite")
     if dbpath:  # Only get new db name if not cancelling the FileDialog
         self.dbpath = dbpath
         self.midvsettingsdialogdock.ms.settingsdict['database'] = utils.anything_to_string_representation({'spatialite': {'dbpath': dbpath}})
         self.midvsettingsdialogdock.ms.save_settings('database')
         self.midvsettingsdialogdock.load_plot_settings()
         warn_about_old_database()
     else:  # debug
         utils.MessagebarAndLog.info(log_msg=ru(QCoreApplication.translate('SpatialiteSettings', "DB selection cancelled and still using database path %s"))%utils.returnunicode(self.midvsettingsdialogdock.ms.settingsdict['database']))
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:11,代码来源:midvsettingsdialog.py


示例17: GetData


#.........这里部分代码省略.........
        if not parameters:
            qgis.utils.iface.messageBar().pushMessage("Debug","Something is wrong, no parameters are found in table w_qual_lab for "+ obsid, 0 ,duration=10)#DEBUG
            return False
        print('parameters for ' + obsid + ' is loaded at time: ' + str(time.time()))#debug
        # Load all date_times, stored in two result columns: reportnr, date_time
        if not (self.settingsdict['wqual_sortingcolumn'] == ''):          #If there is a a specific sorting column
            sql =r"""select distinct """
            sql += self.settingsdict['wqual_sortingcolumn']
            sql += r""", date_time from """      #including parameters
        else:                     # IF no specific column exist for sorting
            sql =r"""select distinct date_time, date_time from """      # The twice selection of date_time is a dummy to keep same structure (2 cols) of sql-answer as if reportnr exists
        sql += self.settingsdict['wqualtable']
        sql += """ where obsid = '"""
        sql += obsid 
        sql += """' ORDER BY date_time"""
        #sql2 = unicode(sql) #To get back to unicode-string
        date_times_cursor = curs.execute(sql) #Send SQL-syntax to cursor,
        date_times = date_times_cursor.fetchall()

        print (sql)#debug
        print('loaded distinct date_time for the parameters for ' + obsid + ' at time: ' + str(time.time()))#debug
        
        if not date_times:
            qgis.utils.iface.messageBar().pushMessage("Debug","Something is wrong, no parameters are found in table w_qual_lab for "+ obsid, 0 ,duration=10)#DEBUG
            return

        ReportTable = ['']*(len(parameters)+2)    # Define size of ReportTable
        for i in range(len(parameters)+2): # Fill the table with ''
            ReportTable[i] = [''] * (len(date_times)+1)

        #Populate First 'column' w parameters
        parametercounter = 2    #First two rows are for obsid and date_time    
        for p, u in parameters:
            if not(self.settingsdict['wqual_unitcolumn']==''):
 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python midvatten_utils.ru函数代码示例发布时间:2022-05-27
下一篇:
Python _i18n._LE函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap