本文整理汇总了Python中safe.defaults.disclaimer函数的典型用法代码示例。如果您正苦于以下问题:Python disclaimer函数的具体用法?Python disclaimer怎么用?Python disclaimer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disclaimer函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: set_org_disclaimer
def set_org_disclaimer(self):
"""Auto-connect slot activated when org disclaimer checkbox is toggled.
"""
settings = QtCore.QSettings()
if self.custom_org_disclaimer_checkbox.isChecked():
# Show previous organisation disclaimer
org_disclaimer = settings.value(
'inasafe/reportDisclaimer',
disclaimer(),
type=str)
else:
# Set the organisation disclaimer to the default one
org_disclaimer = disclaimer()
self.txtDisclaimer.setPlainText(org_disclaimer)
开发者ID:dynaryu,项目名称:inasafe,代码行数:15,代码来源:options_dialog.py
示例2: __init__
def __init__(self, iface, template, layer):
"""Constructor for the Composition Report class.
:param iface: Reference to the QGIS iface object.
:type iface: QgsAppInterface
:param template: The QGIS template path.
:type template: str
"""
LOGGER.debug('InaSAFE Impact Report class initialised')
self._iface = iface
self._template = template
self._layer = layer
self._extent = self._iface.mapCanvas().extent()
self._page_dpi = 300.0
self._safe_logo = resources_path(
'img', 'logos', 'inasafe-logo-url.svg')
self._organisation_logo = default_organisation_logo_path()
self._north_arrow = default_north_arrow_path()
self._disclaimer = disclaimer()
# For QGIS < 2.4 compatibility
# QgsMapSettings is added in 2.4
if qgis_version() < 20400:
map_settings = self._iface.mapCanvas().mapRenderer()
else:
map_settings = self._iface.mapCanvas().mapSettings()
self._template_composition = TemplateComposition(
template_path=self.template,
map_settings=map_settings)
self._keyword_io = KeywordIO()
开发者ID:NyakudyaA,项目名称:inasafe,代码行数:32,代码来源:impact_report.py
示例3: __init__
def __init__(self, parent=None):
"""Constructor for the dialog.
:param parent: Parent widget of this dialog
:type parent: QWidget
"""
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
self.setWindowTitle(self.tr('About InaSAFE %s' % get_version()))
self.parent = parent
# Set Limitations Text
limitations_text = ''
for index, limitation in enumerate(limitations()):
limitations_text += '%s. %s \n' % (index + 1, limitation)
self.limitations_text.setFontPointSize(11)
self.limitations_text.setText(limitations_text)
# Set Disclaimer Text
self.disclaimer_text.setFontPointSize(11)
self.disclaimer_text.setText(disclaimer())
# Set Attributions text
image_credits_text = ''
for index, limitation in enumerate(self.attributions()):
image_credits_text += '%s. %s \n' % (index + 1, limitation)
self.image_credits_text.setFontPointSize(11)
self.image_credits_text.setText(image_credits_text)
supporters_path = resources_path('img', 'logos', 'supporters.png')
pixmap = QtGui.QPixmap(supporters_path)
self.supporters_label.setPixmap(pixmap)
开发者ID:Mloweedgar,项目名称:inasafe,代码行数:33,代码来源:about_dialog.py
示例4: test_disclaimer
def test_disclaimer(self):
"""Verify the disclaimer works.
This text will probably change a lot so just test to ensure it is
not empty.
"""
actual = disclaimer()
self.assertTrue(len(actual) > 0)
开发者ID:Mloweedgar,项目名称:inasafe,代码行数:8,代码来源:test_defaults.py
示例5: disclaimer
def disclaimer(self, text):
"""Set text that will be used as disclaimer in reports.
:param text: Disclaimer text
:type text: str
"""
if not isinstance(text, str):
self._disclaimer = disclaimer()
else:
self._disclaimer = text
开发者ID:NyakudyaA,项目名称:inasafe,代码行数:10,代码来源:impact_report.py
示例6: restore_state
def restore_state(self):
"""Reinstate the options based on the user's stored session info.
"""
settings = QtCore.QSettings()
# flag = settings.value(
# 'inasafe/useThreadingFlag', False)
# hack set use thread to false see #557
flag = False
self.cbxUseThread.setChecked(flag)
flag = bool(settings.value(
'inasafe/visibleLayersOnlyFlag', True, type=bool))
self.cbxVisibleLayersOnly.setChecked(flag)
flag = bool(settings.value(
'inasafe/set_layer_from_title_flag', True, type=bool))
self.cbxSetLayerNameFromTitle.setChecked(flag)
flag = bool(settings.value(
'inasafe/setZoomToImpactFlag', True, type=bool))
self.cbxZoomToImpact.setChecked(flag)
# whether exposure layer should be hidden after model completes
flag = bool(settings.value(
'inasafe/setHideExposureFlag', False, type=bool))
self.cbxHideExposure.setChecked(flag)
flag = bool(settings.value(
'inasafe/clip_hard', False, type=bool))
self.cbxClipHard.setChecked(flag)
flag = bool(settings.value(
'inasafe/useSentry', False, type=bool))
self.cbxUseSentry.setChecked(flag)
flag = bool(settings.value(
'inasafe/show_intermediate_layers', False, type=bool))
self.cbxShowPostprocessingLayers.setChecked(flag)
ratio = self.defaults['FEMALE_RATIO']
self.dsbFemaleRatioDefault.setValue(ratio)
path = settings.value(
'inasafe/keywordCachePath',
self.keyword_io.default_keyword_db_path(), type=str)
self.leKeywordCachePath.setText(path)
flag = bool(settings.value(
'inasafe/template_warning_verbose', True, type=bool))
self.template_warning_checkbox.setChecked(flag)
# Restore Organisation Logo Path
org_logo_path = settings.value(
'inasafe/organisation_logo_path',
supporters_logo_path(),
type=str)
custom_org_logo_flag = (
org_logo_path != supporters_logo_path())
self.custom_org_logo_checkbox.setChecked(custom_org_logo_flag)
self.leOrganisationLogoPath.setText(org_logo_path)
user_directory_path = settings.value(
'inasafe/defaultUserDirectory',
temp_dir('impacts'), type=str)
custom_user_directory_flag = (
user_directory_path != temp_dir('impacts'))
self.custom_UseUserDirectory_checkbox.setChecked(
custom_user_directory_flag)
self.splitter_user_directory.setEnabled(custom_user_directory_flag)
self.leUserDirectoryPath.setText(user_directory_path)
# Restore Show Organisation Logo in Dock Flag
flag = bool(settings.value(
'inasafe/showOrganisationLogoInDockFlag', False, type=bool))
self.organisation_on_dock_checkbox.setChecked(flag)
# Restore North Arrow Image Path
north_arrow_path = settings.value(
'inasafe/north_arrow_path', default_north_arrow_path(), type=str)
custom_north_arrow_flag = (
north_arrow_path != default_north_arrow_path())
self.custom_north_arrow_checkbox.setChecked(custom_north_arrow_flag)
self.leNorthArrowPath.setText(north_arrow_path)
# Restore Report Template Directory Path
report_template_dir = settings.value(
'inasafe/reportTemplatePath',
'',
type=str)
custom_templates_dir_flag = (report_template_dir != '')
self.custom_templates_dir_checkbox.setChecked(
custom_templates_dir_flag)
self.leReportTemplatePath.setText(report_template_dir)
# Restore Disclaimer
org_disclaimer = settings.value(
'inasafe/reportDisclaimer', disclaimer(), type=str)
custom_org_disclaimer_flag = (org_disclaimer != disclaimer())
self.custom_org_disclaimer_checkbox.setChecked(
custom_org_disclaimer_flag)
self.txtDisclaimer.setPlainText(org_disclaimer)
#.........这里部分代码省略.........
开发者ID:dynaryu,项目名称:inasafe,代码行数:101,代码来源:options_dialog.py
示例7: impact_attribution
def impact_attribution(keywords, inasafe_flag=False):
"""Make a little table for attribution of data sources used in impact.
:param keywords: A keywords dict for an impact layer.
:type keywords: dict
:param inasafe_flag: bool - whether to show a little InaSAFE promotional
text in the attribution output. Defaults to False.
:returns: An html snippet containing attribution information for the impact
layer. If no keywords are present or no appropriate keywords are
present, None is returned.
:rtype: safe.messaging.Message
"""
if keywords is None:
return None
join_words = ' - %s ' % tr('sourced from')
analysis_details = tr('Analysis details')
hazard_details = tr('Hazard details')
hazard_title_keywords = 'hazard_title'
hazard_source_keywords = 'hazard_source'
exposure_details = tr('Exposure details')
exposure_title_keywords = 'exposure_title'
exposure_source_keyword = 'exposure_source'
if hazard_title_keywords in keywords:
hazard_title = tr(keywords[hazard_title_keywords])
else:
hazard_title = tr('Hazard layer')
if hazard_source_keywords in keywords:
hazard_source = tr(keywords[hazard_source_keywords])
else:
hazard_source = tr('an unknown source')
if exposure_title_keywords in keywords:
exposure_title = keywords[exposure_title_keywords]
else:
exposure_title = tr('Exposure layer')
if exposure_source_keyword in keywords:
exposure_source = keywords[exposure_source_keyword]
else:
exposure_source = tr('an unknown source')
report = m.Message()
report.add(m.Heading(analysis_details, **INFO_STYLE))
report.add(hazard_details)
report.add(m.Paragraph(
hazard_title,
join_words,
hazard_source))
report.add(exposure_details)
report.add(m.Paragraph(
exposure_title,
join_words,
exposure_source))
if inasafe_flag:
report.add(m.Heading(tr('Software notes'), **INFO_STYLE))
# noinspection PyUnresolvedReferences
inasafe_phrase = tr(
'This report was created using InaSAFE version %s. Visit '
'http://inasafe.org to get your free copy of this software! %s'
) % (get_version(), disclaimer())
report.add(m.Paragraph(m.Text(inasafe_phrase)))
return report
开发者ID:felix-yew,项目名称:inasafe,代码行数:70,代码来源:utilities.py
示例8: __init__
def __init__(self, parent=None, iface=None):
"""Constructor for dialog.
:param parent: Optional widget to use as parent
:type parent: QWidget
:param iface: An instance of QGisInterface
:type iface: QGisInterface
"""
QDialog.__init__(self, parent)
self.parent = parent
self.setupUi(self)
self.setWindowTitle(self.tr('InaSAFE Impact Layer Merge Tool'))
self.iface = iface
self.keyword_io = KeywordIO()
# Template Path for composer
self.template_path = resources_path(
'qgis-composer-templates', 'merged_report.qpt')
# Safe Logo Path
self.safe_logo_path = white_inasafe_logo_path()
# Organisation Logo Path - defaults to supporters logo, will be
# updated to user defined organisation logo path in read_settings in
# user has specified a custom logo.
self.organisation_logo_path = supporters_logo_path()
# Disclaimer text
self.disclaimer = disclaimer()
# The output directory
self.out_dir = None
# Stored information from first impact layer
self.first_impact = {
'layer': None,
'map_title': None,
'hazard_title': None,
'exposure_title': None,
'postprocessing_report': None,
}
# Stored information from second impact layer
self.second_impact = {
'layer': None,
'map_title': None,
'hazard_title': None,
'exposure_title': None,
'postprocessing_report': None,
}
# Stored information from aggregation layer
self.aggregation = {
'layer': None,
'aggregation_attribute': None
}
# Available aggregation layer
self.available_aggregation = []
# The summary report, contains report for each aggregation area
self.summary_report = OrderedDict()
# The html reports and its file path
self.html_reports = OrderedDict()
# A boolean flag whether to merge entire area or aggregated
self.entire_area_mode = False
# Get the global settings and override some variable if exist
self.read_settings()
# Get all current project layers for combo box
self.get_project_layers()
# Set up things for context help
self.help_button = self.button_box.button(QtGui.QDialogButtonBox.Help)
# Allow toggling the help button
self.help_button.setCheckable(True)
self.help_button.toggled.connect(self.help_toggled)
self.main_stacked_widget.setCurrentIndex(1)
# Show usage info
self.restore_state()
开发者ID:jobel-openscience,项目名称:inasafe,代码行数:85,代码来源:impact_merge_dialog.py
示例9: __init__
def __init__(self, parent=None, iface=None):
"""Constructor for dialog.
:param parent: Optional widget to use as parent
:type parent: QWidget
:param iface: An instance of QGisInterface
:type iface: QGisInterface
"""
QDialog.__init__(self, parent)
self.parent = parent
self.setupUi(self)
self.setWindowTitle(self.tr('InaSAFE Impact Layer Merge Tool'))
self.iface = iface
self.keyword_io = KeywordIO()
# Template Path for composer
self.template_path = resources_path(
'qgis-composer-templates', 'merged_report.qpt')
# Safe Logo Path
self.safe_logo_path = resources_path(
'img', 'logos', 'inasafe-logo-url.png')
# Organisation Logo Path
self.organisation_logo_path = resources_path(
'img', 'logos', 'supporters.png')
# Disclaimer text
self.disclaimer = disclaimer()
# The output directory
self.out_dir = None
# Stored information from first impact layer
self.first_impact = {
'layer': None,
'map_title': None,
'hazard_title': None,
'exposure_title': None,
'postprocessing_report': None,
}
# Stored information from second impact layer
self.second_impact = {
'layer': None,
'map_title': None,
'hazard_title': None,
'exposure_title': None,
'postprocessing_report': None,
}
# Stored information from aggregation layer
self.aggregation = {
'layer': None,
'aggregation_attribute': None
}
# The summary report, contains report for each aggregation area
self.summary_report = {}
# The html reports and its file path
self.html_reports = {}
# A boolean flag whether to merge entire area or aggregated
self.entire_area_mode = False
# Get the global settings and override some variable if exist
self.read_settings()
# Get all current project layers for combo box
self.get_project_layers()
# Set up context help
help_button = self.button_box.button(QtGui.QDialogButtonBox.Help)
help_button.clicked.connect(self.show_help)
# Show usage info
self.show_info()
self.restore_state()
开发者ID:severinmenard,项目名称:inasafe,代码行数:80,代码来源:impact_merge_dialog.py
注:本文中的safe.defaults.disclaimer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论