本文整理汇总了Python中pyface.message_dialog.warning函数的典型用法代码示例。如果您正苦于以下问题:Python warning函数的具体用法?Python warning怎么用?Python warning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了warning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: check_dependencies
def check_dependencies():
"""
check the dependencies and
"""
from pyface.api import warning
try:
mod = __import__('uncertainties',
fromlist=['__version__']
)
__version__ = mod.__version__
except ImportError:
warning(None, 'Install "{}" package. required version>={} '.format('uncertainties', '2.1'))
return
vargs = __version__.split('.')
maj = vargs[0]
if int(maj) < 2:
warning(None, 'Update "{}" package. your version={}. required version>={} '.format('uncertainties',
__version__,
'2.1'
))
return
return True
开发者ID:jirhiker,项目名称:pychron,代码行数:25,代码来源:pychron_run.py
示例2: __init__
def __init__(self, *args, **kw):
p = os.path.join(paths.setup_dir, 'initialization.xml')
if os.path.isfile(p):
super(InitializationParser, self).__init__(p, *args, **kw)
else:
warning(None, 'No initialization file')
sys.exit()
开发者ID:softtrainee,项目名称:arlab,代码行数:7,代码来源:initialization_parser.py
示例3: build_globals
def build_globals(debug):
try:
from pychron.envisage.initialization.initialization_parser import InitializationParser
except ImportError, e:
from pyface.message_dialog import warning
warning(None, str(e))
开发者ID:NMGRL,项目名称:pychron,代码行数:7,代码来源:helpers.py
示例4: _get_runner
def _get_runner(self, event):
app = event.task.application
runner = app.get_service(IPyScriptRunner)
if not runner:
warning(None, 'No runner available')
return runner
开发者ID:NMGRL,项目名称:pychron,代码行数:7,代码来源:experiment_actions.py
示例5: save
def save(self, ans, db):
append = False
if not self.name:
warning(None, 'Please specify a name for the analysis group')
return
if not self.project:
warning(None, 'Please specify an associated project for the analysis group')
return
gdb = db.get_analysis_groups_by_name(self.name, self.project)
ok = True
if gdb:
gdb = gdb[-1]
if db.confirmation_dialog('"{}" already exists? Would you like to append your selection'.format(gdb.name)):
append = True
else:
ok = False
if append:
db.append_analysis_group(gdb, ans)
elif ok:
db.add_analysis_group(ans, self.name, self.project)
return True
开发者ID:NMGRL,项目名称:pychron,代码行数:25,代码来源:add_analysis_group_view.py
示例6: _run
def _run(self):
p = os.path.join(self.root, self.name)
if not os.path.exists(p):
warning(None, 'Invalid Clovera path {}'.format(self.root))
return
# n = 5
# pd = MProgressDialog(max=n, size=(550, 15))
# do_later(pd.open)
# do_later(pd.change_message, '{} process started'.format(self.name))
try:
p = subprocess.Popen([p],
shell=False,
bufsize=1024,
stdout=subprocess.PIPE
)
self._process = p
while p.poll() == None:
if self.queue:
self.queue.put(p.stdout.readline())
time.sleep(1e-6)
self.success = True
# do_later(pd.change_message, '{} process complete'.format(self.name))
return True
except OSError, e:
self.warning_dialog('Clovera programs are not executable. Check Default Clovera Directory.\n{}'.format(e))
import traceback
traceback.print_exc()
开发者ID:softtrainee,项目名称:arlab,代码行数:31,代码来源:fortran_process.py
示例7: submit
def submit(self, info):
if not self.model.title:
warning(None, 'Please enter a Title for this issue')
return
self.submit_issue_github()
info.ui.dispose()
开发者ID:NMGRL,项目名称:pychron,代码行数:7,代码来源:exception_helper.py
示例8: git_post
def git_post(cmd, return_json=True, **kw):
usr = os.environ.get('GITHUB_USER')
pwd = os.environ.get('GITHUB_PASSWORD')
if not pwd:
warning(None, 'No password set for "{}". Contact Developer.\n'
'Pychron will quit when this window is closed'.format(usr))
sys.exit()
kw['auth'] = (usr, pwd)
if globalv.cert_file:
kw['verify'] = globalv.cert_file
r = requests.post(cmd, **kw)
if r.status_code == 401:
warning(None, 'Failed to submit issue. Username/Password incorrect.')
elif r.status_code == 403:
print('asf', r.json())
if r.status_code in (201, 422):
ret = True
if return_json:
ret = r.json()
return ret
开发者ID:NMGRL,项目名称:pychron,代码行数:25,代码来源:exception_helper.py
示例9: start
def start(self):
try:
import xlwt
except ImportError:
warning(None, '''"xlwt" package not installed.
Install to enable MS Excel export''')
开发者ID:UManPychron,项目名称:pychron,代码行数:7,代码来源:processing_plugin.py
示例10: get_plugin
def get_plugin(pname):
klass = None
if not pname.endswith('Plugin'):
pname = '{}Plugin'.format(pname)
if pname in PACKAGE_DICT:
package = PACKAGE_DICT[pname]
klass = get_klass(package, pname)
else:
logger.warning('****** {} not a valid plugin name******'.format(pname),
extra={'threadName_': 'Launcher'})
if klass is not None:
plugin = klass()
if isinstance(plugin, BasePlugin):
check = plugin.check()
if check is True:
return plugin
else:
logger.warning('****** {} not available {}******'.format(klass, check),
extra={'threadName_': 'Launcher'})
warning(None, 'Failed loading plugin.\n {}'.format(plugin.name))
else:
logger.warning('***** Invalid {} needs to be a subclass of Plugin ******'.format(klass),
extra={'threadName_': 'Launcher'})
开发者ID:NMGRL,项目名称:pychron,代码行数:26,代码来源:pychron_run.py
示例11: _handle
def _handle(*args, **kw):
try:
return func(*args, **kw)
except Exception, e:
import traceback
traceback.print_exc()
warning(None, 'There is a problem in your initialization file {}'.format(e))
sys.exit()
开发者ID:softtrainee,项目名称:arlab,代码行数:8,代码来源:initialization_parser.py
示例12: perform
def perform(self, event):
if os.path.isfile(paths.last_experiment):
with open(paths.last_experiment, 'r') as fp:
path = fp.readline()
if os.path.isfile(path):
self._open_experiment(event, path)
else:
warning(None, 'No last experiment available')
开发者ID:jirhiker,项目名称:pychron,代码行数:8,代码来源:experiment_actions.py
示例13: _load_analyses
def _load_analyses(self):
from pychron.core.csv.csv_parser import CSVColumnParser
par = CSVColumnParser(delimiter=',')
par.load(self.path)
if par.check(('runid', 'age', 'age_err')):
return self._get_items_from_file(par)
else:
warning(None, 'Invalid file format. Minimum columns required are "runid", "age", "age_err"')
开发者ID:NMGRL,项目名称:pychron,代码行数:9,代码来源:data.py
示例14: _add_root_button_fired
def _add_root_button_fired(self):
dlg = DirectoryDialog(default_path=paths.mdd_data_dir)
if dlg.open() == OK and dlg.path:
name = os.path.basename(dlg.path)
if os.path.isfile(os.path.join(dlg.path, '{}.in'.format(name))):
self.roots.append(dlg.path)
else:
warning(None, 'Invalid MDD directory. {}. Directory must contain file '
'named {}.in'.format(dlg.path, name))
开发者ID:NMGRL,项目名称:pychron,代码行数:9,代码来源:nodes.py
示例15: _check_refit
def _check_refit(self, ai):
for k in self._keys:
num, dem = k.split('/')
i = ai.get_isotope(detector=dem)
if i is not None:
if not i.ic_factor_reviewed:
return True
else:
from pyface.message_dialog import warning
warning(None, 'Data for detector {} is missing from {}'.format(dem, ai.record_id))
raise RefitException()
开发者ID:NMGRL,项目名称:pychron,代码行数:11,代码来源:fit.py
示例16: __init__
def __init__(self, path=None, *args, **kw):
if path:
self.path = path
try:
self._parse_file(path)
except ParseError as e:
from pyface.message_dialog import warning
warning(None, str(e))
else:
self._root = Element('root')
开发者ID:NMGRL,项目名称:pychron,代码行数:11,代码来源:xml_parser.py
示例17: load_isotopedb_defaults
def load_isotopedb_defaults(db):
for name, mass in MOLECULAR_WEIGHTS.iteritems():
db.add_molecular_weight(name, mass)
for at in ['blank_air',
'blank_cocktail',
'blank_unknown',
'background', 'air', 'cocktail', 'unknown']:
# blank', 'air', 'cocktail', 'background', 'unknown']:
db.add_analysis_type(at)
for mi in ['obama', 'jan', 'nmgrl map']:
db.add_mass_spectrometer(mi)
for i, di in enumerate(['blank_air',
'blank_cocktail',
'blank_unknown',
'background', 'air', 'cocktail']):
samp = db.add_sample(di)
db.add_labnumber(i + 1, sample=samp)
for hi, kind, make in [('Fusions CO2', '10.6um co2', 'photon machines'),
('Fusions Diode', '810nm diode', 'photon machines'),
('Fusions UV', '193nm eximer', 'photon machines')
]:
db.add_extraction_device(name=hi,
kind=kind,
make=make
)
mdir = os.path.join(paths.setup_dir, 'irradiation_tray_maps')
if not os.path.isdir(mdir):
warning(None, 'No irradiation_tray_maps directory. add to .../setupfiles')
else:
for t in os.listdir(mdir):
if t.startswith('.'):
continue
p = os.path.join(mdir, t)
if not os.path.isfile(p):
continue
with open(p, 'r') as f:
h = f.readline()
nholes, _diam = h.split(',')
nholes = int(nholes)
holes = [map(float, l.strip().split(',')) for i, l in enumerate(f) if i < nholes]
blob = ''.join([struct.pack('>ff', x, y) for x, y in holes])
db.add_irradiation_holder(t, geometry=blob)
db.commit()
开发者ID:softtrainee,项目名称:arlab,代码行数:51,代码来源:defaults.py
示例18: _new_fit_series
def _new_fit_series(self, pid, po):
ymi, yma = self._plot_unknowns_current(pid, po)
args = self._plot_references(pid, po)
if args:
reg, a, b = args
ymi = min(ymi, a)
yma = max(yma, b)
if reg:
a, b = self._plot_interpolated(pid, po, reg)
ymi = min(ymi, a)
yma = max(yma, b)
self.graph.set_y_limits(ymi, yma, pad='0.05', plotid=pid)
else:
warning(None, 'Invalid Detector choices for these analyses. {}'.format(po.name))
开发者ID:NMGRL,项目名称:pychron,代码行数:15,代码来源:references_series.py
示例19: perform
def perform(self, event):
from pychron.experiment.conditional.conditionals_edit_view import edit_conditionals
task = event.task
dnames = None
spec = task.application.get_service(
'pychron.spectrometer.base_spectrometer_manager.BaseSpectrometerManager')
if spec:
dnames = spec.spectrometer.detector_names
p = get_path(paths.spectrometer_dir, '.*conditionals', ('.yaml','.yml'))
if p:
edit_conditionals(p, detectors=dnames, app=task.application)
else:
warning(None, 'No system conditionals file at {}'.format(p))
开发者ID:kenlchen,项目名称:pychron,代码行数:15,代码来源:experiment_actions.py
示例20: __init__
def __init__(self, *args, **kw):
ver = '_proc'
# ver = '_exp'
#ver = '_exp_uv'
#ver= '_spec'
# ver='_diode'
# ver = '_dash'
#ver = '_dash_client'
#ver = ''
p = os.path.join(paths.setup_dir, 'initialization{}.xml'.format(ver))
if not os.path.isfile(p):
p = os.path.join(paths.setup_dir, 'initialization.xml')
if not os.path.isfile(p):
warning(None, 'No initialization file.\n{} is not a valid file'.format(p))
sys.exit()
super(InitializationParser, self).__init__(p, *args, **kw)
开发者ID:jirhiker,项目名称:pychron,代码行数:17,代码来源:initialization_parser.py
注:本文中的pyface.message_dialog.warning函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论