本文整理汇总了Python中utilities.Log.orangemsg函数的典型用法代码示例。如果您正苦于以下问题:Python orangemsg函数的具体用法?Python orangemsg怎么用?Python orangemsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了orangemsg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: logMessage
def logMessage(self, type = 'DEFAULT'):
"""
Updates the PM message groupbox message with the one specified below.
"""
msg = ''
if type == 'ADD_SEGMENTS_ACTIVATED':
msg = """To add new PAM3 DNA segments to the list, click on the segment's
axis. Multiple segments can be added at once by doing a
rectangular lasso selection in the 3D workspace."""
elif type == 'REMOVE_SEGMENTS_ACTIVATED':
msg = """To remove segments from the list, click on the segment's
axis. Multiple segments can be removed at once by doing a
rectangular lasso selection in the 3D workspace."""
elif type == 'LEFT_DRAG_STARTED':
msg = """Transparent green spheres (if present) around the atoms indicate
potential crossover sites."""
elif type == 'LEFT_DRAG_FINISHED':
msg = self.propMgr.defaultLogMessage
elif type == 'WARNING_LIMIT_EXCEEDED':
msg = "Only a maximum of <b> %d </b> DNA segments can be searched for "\
"crossover sites. Segments not added to the list"%self.itemLimitForSegmentListWidget()
msg = orangemsg(msg)
elif type == 'WARNING_PAM5_SEGMENT_FOUND':
msg = """Warning: One or more of the PAM5 DNA segments have been
removed from the segment list.Make Crossovers command is only
availble for PAM3 model."""
msg = orangemsg(msg)
else:
msg = self.propMgr.defaultLogMessage
self.propMgr.updateMessage(msg)
开发者ID:elfion,项目名称:nanoengineer,代码行数:31,代码来源:MakeCrossovers_Command.py
示例2: deposit_from_MMKit
def deposit_from_MMKit(self, atom_or_pos):
"""
Deposit the clipboard item being previewed into the 3D workspace
Calls L{self.deposit_from_Clipboard_page}
@attention: This method needs renaming. L{depositMode} still uses it
so simply overriden here. B{NEEDS CLEANUP}.
@see: L{self.deposit_from_Clipboard_page}
"""
if self.o.modkeys is None: # no Shift or Ctrl modifier key.
self.o.assy.unpickall_in_GLPane()
deposited_stuff, status = \
self.command.deposit_from_Clipboard_page(atom_or_pos)
deposited_obj = 'Chunk'
self.o.selatom = None
if deposited_stuff:
self.w.win_update()
status = self.ensure_visible( deposited_stuff, status)
env.history.message(status)
else:
env.history.message(orangemsg(status))
return deposited_obj
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:26,代码来源:PasteFromClipboard_GraphicsMode.py
示例3: __init__
def __init__(self, mapping, chunk):
# immediately memoize some settings which need to be constant
# during use, as a bug precaution. Also do whatever precomputes
# are convenient.
writemmp_mapping_memo.__init__(self, mapping)
self.chunk = chunk
self.ladder = chunk.ladder
if not dna_updater_is_enabled():
msg = "Warning: can't convert PAM model when dna updater is disabled; affects [N] chunk(s)"
env.history.deferred_summary_message( orangemsg( msg))
elif not self.ladder:
# (might happen if dna updater is turned off at runtime -- not sure;
# note, doing that might have worse effects, like self.ladder existing
# but being out of date, causing traceback errors. #### FIX those sometime (elsewhere).)
print "error: ladder not set during writemmp, can't convert pam model, in %r" % chunk
msg = "Error: [N] chunk(s) don't have ladders set"
env.history.deferred_summary_message( redmsg( msg))
else:
self.convert_pam_enabled = True
if self.convert_pam_enabled:
# Note: this only means conversion is possible -- we don't yet know
# if it's requested by options on this mapping and chunk.
# The ladder memo will decide that.
self._ladder_memo = mapping.get_memo_for(self.ladder)
self._save_as_pam = self._ladder_memo._f_save_as_what_PAM_model()
return
开发者ID:elfion,项目名称:nanoengineer,代码行数:26,代码来源:pam_conversion_mmp.py
示例4: Backup
def Backup(self):
"""
Undo any bonds made between chunks.
"""
# This undoes only the last fused chunks. Will work on supporting
# multiple undos when we get a single undo working. Mark 050326
# Bust bonds between last pair/set of fused chunks.
if self.bondable_pairs_atoms:
for a1, a2 in self.bondable_pairs_atoms:
b = a1.get_neighbor_bond(a2)
if b: b.bust()
if self.merged_chunks:
nchunks_str = "%d" % (len(self.merged_chunks) + 1,)
msg = "Fuse Chunks: Bonds broken between %s chunks." % (nchunks_str)
env.history.message(msg)
msg = "Warning: Cannot separate the original chunks. You can " \
"do this yourself using <b>Modify > Separate</b>."
env.history.message(orangemsg(msg))
cnames = "Their names were: "
# Here are the original names...
for chunk in self.merged_chunks:
cnames += '[' + chunk.name + '] '
env.history.message(cnames)
self.o.gl_update()
else:
msg = "Fuse Chunks: No bonds have been made yet. Undo ignored."
env.history.message(redmsg(msg))
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:33,代码来源:FuseChunks_Command.py
示例5: _postProcess
def _postProcess(self, baseList): # bruce 070414
"""
Set bond direction on the backbone bonds.
@param baseList: List of basepair chunks that make up the duplex.
@type baseList: list
@note: baseList must contain at least two base-pair chunks.
"""
# This implem depends on the specifics of how the end-representations
# are terminated. If that's changed, it might stop working or it might
# start giving wrong results. In the current representation,
# baseList[0] (a chunk) is the starting end of the duplex. It has two
# bonds whose directions we should set, which will determine the
# directions of their strands: Se3 -> Ss3, and Sh3 <- Ss3.
# Just find those bonds and set the strand directions.
assert len(baseList) >= 2
basepair1_atoms = baseList[0].atoms.values() # StartBasePair.MMP
basepair2_atoms = baseList[1].atoms.values() # MiddleBasePair or EndBasePair.MMP
Se3_list = filter( lambda atom: atom.element.symbol in ('Se3'), basepair1_atoms)
Sh3_list = filter( lambda atom: atom.element.symbol in ('Sh3'), basepair1_atoms)
# To set the direction of the Se3 -> Ss3 bond, we need the Ss3 atom
# from the second base-pair (i.e. baseList[1]) that is connected to
# the Se3 atom in the first base-pair.
# Ss3_list will have only one Ss3 atom if the duplex is only two
# base-pairs long. Otherwise, Ss3_list will have two Ss3 atoms.
Ss3_list = filter( lambda atom: atom.element.symbol in ('Ss3'), basepair2_atoms)
if len(Se3_list) == len(Sh3_list) == 1:
for atom in Se3_list:
assert len(atom.bonds) == 2
# This is fragile since it is dependent on the bond order in the
# PAM3 StartBasePair.MMP file. If the order gets changed in that
# file, this will fail.
# A more robust approach would be to check for the Se3 -> Ss3
# bond, which is the one we want here. Mark 2007-09-27.
#atom.bonds[1].set_bond_direction_from(atom, 1, propogate = True)
# This implements the more robust stategy mentioned
# above. I'd like Bruce to review it and confirm it is good.
# Mark 2007-09-27.
#atom.bonds[1].set_bond_direction_from(Ss3_list[0], -1, propogate = True)
try: # Try the first Ss3 atom in Ss3_list.
atom.bonds[1].set_bond_direction_from(Ss3_list[0], -1, propogate = True)
except: # That wasn't it, so it must be the second Ss3 atom.
atom.bonds[1].set_bond_direction_from(Ss3_list[1], -1, propogate = True)
for atom in Sh3_list:
assert len(atom.bonds) == 1
atom.bonds[0].set_bond_direction_from(atom, -1, propogate = True)
else:
#bruce 070604 mitigate bug in above code when number of bases == 1
# by not raising an exception when it fails.
msg = "Warning: strand not terminated, bond direction not set \
(too short)"
env.history.message( orangemsg( msg))
return
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:55,代码来源:DnaGenHelper.py
示例6: simMoviePlayer
def simMoviePlayer(assy):
"""
Plays a DPB movie file created by the simulator,
either the current movie if any, or a previously saved
dpb file with the same name as the current part, if one can be found.
"""
from simulation.movie import find_saved_movie, Movie #bruce 050329 precaution (in case of similar bug to bug 499)
win = assy.w
if not assy.molecules: # No model, so no movie could be valid for current part.
# bruce 050327 comment: even so, a movie file might be valid for some other Part...
# not yet considered here. [050427 addendum: note that user can't yet autoload a new Part
# just by opening a movie file, so there's no point in going into the mode -- it's only meant
# for playing a movie for the *current contents of the current part*, for now.]
env.history.message(redmsg("Movie Player: Need a model."))
win.simMoviePlayerAction.setChecked(0) # toggle on the Movie Player icon ninad 061113
return
if assy.current_movie and assy.current_movie.might_be_playable():
win.commandSequencer.userEnterCommand('MOVIE')
return
# no valid current movie, look for saved one with same name as assy
## env.history.message("Plot Tool: No simulation has been run yet.")
if assy.filename:
if assy.part is not assy.tree.part:
msg = "Movie Player: Warning: Looking for saved movie for main part, not for displayed clipboard item."
env.history.message(orangemsg(msg))
errorcode, partdir = assy.find_or_make_part_files_directory()
if not errorcode: # filename could be an MMP or PDB file.
dir, fil = os.path.split(assy.filename)
fil, ext = os.path.splitext(fil)
mfile = os.path.join(partdir, fil + '.dpb')
else:
mfile = os.path.splitext(assy.filename)[0] + ".dpb"
movie = find_saved_movie( assy, mfile)
# checks existence -- should also check validity for current part or main part, but doesn't yet ###e
# (neither did the pre-030527 code for this function, unless that's done in moviePlay, which it might be)
if movie:
# play this movie, and make it the current movie.
assy.current_movie = movie
#e should we switch to the part for which this movie was made? [might be done in moviePlay; if not:]
# No current way to tell how to do that, and this might be done even if it's not valid
# for any loaded Part. So let's not... tho we might presume (from filename choice we used)
# it was valid for Main Part. Maybe print warning for clip item, and for not valid? #e
env.history.message("Movie Player: %s previously saved movie for this part." % ("playing" or "loading"))
win.commandSequencer.userEnterCommand('MOVIE')
return
# else if no assy.filename or no movie found from that:
# bruce 050327 comment -- do what the old code did, except for the moviePlay
# which seems wrong and tracebacks now.
assy.current_movie = Movie(assy)
# temporary kluge until bugs in movieMode for no assy.current_movie are fixed
win.commandSequencer.userEnterCommand('MOVIE')
return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:54,代码来源:movieMode.py
示例7: viewNormalTo
def viewNormalTo(self): #
"""
Set view to the normal vector of the plane defined by 3 or more
selected atoms or a jig's (Motor or RectGadget) axis.
"""
cmd = greenmsg("Set View Normal To: ")
chunks = self.assy.selmols
jigs = self.assy.getSelectedJigs()
atoms = self.assy.selatoms_list()
#following fixes bug 1748 ninad 061003.
if len(chunks) > 0 and len(atoms) == 0:
# Even though chunks have an axis, it is not necessarily the same
# axis attr stored in the chunk. Get the chunks atoms and let
# compute_heuristic_axis() recompute them.
for c in range(len(chunks)):
atoms += chunks[c].atoms.values()
elif len(jigs) == 1 and len(atoms) == 0:
# Warning: RectGadgets have no atoms. We handle this special case below.
atoms = jigs[0].atoms
elif len(atoms) < 3:
# There is a problem when allowing only 2 selected atoms.
# Changing requirement to 3 atoms fixes bug 1418. mark 060322
msg = redmsg("Please select some atoms, jigs, and/or chunks, covering at least 3 atoms")
print "ops_view.py len(atoms) = ", len(atoms)
env.history.message(cmd + msg)
return
# This check is needed for jigs that have no atoms. Currently, this
# is the case for RectGadgets (ESP Image and Grid Plane) only.
if len(atoms):
pos = A( map( lambda a: a.posn(), atoms ) )
nears = [ self.glpane.out, self.glpane.up ]
axis = compute_heuristic_axis( pos, 'normal', already_centered = False, nears = nears, dflt = None )
else: # We have a jig with no atoms.
axis = jigs[0].getaxis() # Get the jig's axis.
# If axis is pointing into the screen, negate (reverse) axis.
if dot(axis, self.glpane.lineOfSight) > 0:
axis = -axis
if not axis:
msg = orangemsg( "Warning: Normal axis could not be determined. No change in view." )
env.history.message(cmd + msg)
return
# Compute the destination quat (q2).
q2 = Q(V(0,0,1), axis)
q2 = q2.conj()
self.glpane.rotateView(q2)
info = 'View set to normal vector of the plane defined by the selected atoms.'
env.history.message(cmd + info)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:54,代码来源:ops_view.py
示例8: _postProcess
def _postProcess(self, baseList): # bruce 070414
"""
Set bond direction on the backbone bonds.
@param baseList: List of basepair chunks that make up the duplex.
@type baseList: list
"""
# This implem depends on the specifics of how the end-representations
# are terminated. If that's changed, it might stop working or it might
# start giving wrong results. In the current representation,
# baseList[0] (a chunk) has two bonds whose directions we must set,
# which will determine the directions of their strands:
# Ss5 -> Sh5, and Ss5 <- Pe5.
# Just find those bonds and set the strand directions (until such time
# as they can be present to start with in the end1 mmp file).
# (If we were instead passed all the atoms, we could be correct if we
# just did this to the first Pe5 and Sh5 we saw, or to both of each if
# setting the same direction twice is allowed.)
atoms = baseList[0].atoms.values()
Pe_list = filter( lambda atom: atom.element.symbol in ('Pe5'), atoms)
Sh_list = filter( lambda atom: atom.element.symbol in ('Sh5'), atoms)
if len(Pe_list) == len(Sh_list) == 1:
for atom in Pe_list:
assert len(atom.bonds) == 1
atom.bonds[0].set_bond_direction_from(atom, 1, propogate = True)
for atom in Sh_list:
assert len(atom.bonds) == 1
atom.bonds[0].set_bond_direction_from(atom, -1, propogate = True)
else:
#bruce 070604 mitigate bug in above code when number of bases == 1
# by not raising an exception when it fails.
msg = "Warning: strand not terminated, bond direction not set \
(too short)"
env.history.message( orangemsg( msg))
# Note: It turns out this bug is caused by a bug in the rest of the
# generator (which I didn't try to diagnose) -- for number of
# bases == 1 it doesn't terminate the strands, so the above code
# can't find the termination atoms (which is how it figures out
# what to do without depending on intimate knowledge of the base
# mmp file contents).
# print "baseList = %r, its len = %r, atoms in [0] = %r" % \
# (baseList, len(baseList), atoms)
## baseList = [<molecule 'unknown' (11 atoms) at 0xb3d6f58>],
## its len = 1, atoms in [0] = [Ax1, X2, X3, Ss4, Pl5, X6, X7, Ss8, Pl9, X10, X11]
# It would be a mistake to fix this here (by giving it that
# intimate knowledge) -- instead we need to find and fix the bug
# in the rest of generator when number of bases == 1.
return
开发者ID:elfion,项目名称:nanoengineer,代码行数:52,代码来源:B_Dna_PAM5_Generator.py
示例9: viewQuteMol
def viewQuteMol(self):
"""
Slot for 'View > QuteMolX'. Opens the QuteMolX Property Manager.
@note: The QuteMolX PM will not open if there are no atoms in the part.
"""
cmd = greenmsg("QuteMolX : ")
if self.assy.molecules:
self.qutemolPM.show()
else:
msg = orangemsg("No atoms in the current part.")
env.history.message(cmd + msg)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:13,代码来源:ops_view.py
示例10: _modifyStructure
def _modifyStructure(self, params):
"""
Modifies the structure (Rotary Motor) using the provided params.
@param params: The parameters used as an input to modify the structure
(Rotary Motor created using this
RotaryMotor_EditCommand)
@type params: tuple
"""
assert self.struct
assert params
assert len(params) == 7
torque, initial_speed, final_speed, \
dampers_state, enable_minimize_state, \
color, atoms = params
numberOfAtoms = len(atoms)
atomNumberRequirementMet, logMessage = \
self._checkMotorAtomLimits(numberOfAtoms)
if not atomNumberRequirementMet:
atoms = self.struct.atoms[:]
logMessage = logMessage + " Motor will remain attached to the"\
" atoms listed in the 'Motor Atoms' list in this" \
" property manager"
logMessage = orangemsg(logMessage)
self.propMgr.updateMessage(logMessage)
assert len(atoms) > 0
self.struct.cancelled = False
self.struct.torque = torque
self.struct.initial_speed = initial_speed
self.struct.speed = final_speed
self.struct.dampers_enabled = dampers_state
self.struct.enable_minimize = enable_minimize_state
self.struct.color = color
#Not sure if it is safe to do self.struct.atoms = atoms
#Instead using 'setShaft method -- ninad 2007-10-09
self.struct.setShaft(atoms)
self.struct.findCenterAndAxis(atoms, self.win.glpane)
self.propMgr.updateAttachedAtomListWidget(atomList = atoms)
self.win.win_update() # Update model tree
self.win.assy.changed()
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:48,代码来源:RotaryMotor_EditCommand.py
示例11: _clear_illegal_direction
def _clear_illegal_direction(bond):
"""
[private helper for _fix_atom_or_return_error_info]
bond has a direction but is not directional
(since one of its atoms does not permit directional bonds,
e.g. it might be an Ss-Ax bond).
Report and immediately fix this error.
@type bond: Bond
"""
bond.clear_bond_direction()
summary_format = "Warning: dna updater cleared [N] bond direction(s) on pseudoelements that don't permit one"
env.history.deferred_summary_message( orangemsg(summary_format) )
return
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:16,代码来源:fix_bond_directions.py
示例12: strandLengthChanged
def strandLengthChanged( self, inStrandLength ):
"""
Slot for the Strand Length spin box, called whenever the value of the
Strand Length spin box changes.
@param inStrandLength: The number of bases in the strand sequence.
@type inStrandLength: int
"""
theSequence = self.getPlainSequence()
sequenceLen = len( theSequence )
lengthChange = inStrandLength - self.getSequenceLength()
# Preserve the cursor's position/selection
cursor = self.sequenceTextEdit.textCursor()
#cursorPosition = cursor.position()
selectionStart = cursor.selectionStart()
selectionEnd = cursor.selectionEnd()
if inStrandLength < 0:
return # Should never happen.
if lengthChange < 0:
# If length is less than the previous length,
# simply truncate the current sequence.
theSequence.chop( -lengthChange )
elif lengthChange > 0:
# If length has increased, add the correct number of base
# letters to the current strand sequence.
numNewBases = lengthChange
# Get current base selected in combobox.
chosenBase = 'X' # Unassigned.
basesToAdd = chosenBase * numNewBases
theSequence.append( basesToAdd )
else:
env.history.message(
orangemsg( "strandLengthChanged(): Length has not changed." ))
self.setSequence( theSequence )
return
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:45,代码来源:DnaGeneratorPropertyManager.py
示例13: adjustSinglet
def adjustSinglet(singlet, minimize=False): # Mark 2007-10-21.
"""
Adjusts I{singlet} using one of two methods based on I{minimize}:
1. Hydrogenate the singlet, then transmute it back to a singlet
(default). Singlet positions are much better after this, but
they are not in their optimal location.
2. Hydrogenate the singlet, then call the simulator via the
L{LocalMinimize_Function} to adjust (minimize) the hydrogen atom, then
tranmute the hydrogen back to a singlet. Singlet positions are best
after using this method, but it has one major drawback -- it
redraws while minimizing. This is a minor problem when breaking
strands, but is intolerable in the DNA duplex generator (which adjusts
open bond singlets in its postProcess method.
@param singlet: A singlet.
@type singlet: L{Atom}
@param minimize: If True, use the minimizer to adjust the singlet
(i.e. method #2).
@type minimize: bool
@note: Real atoms are not adjusted.
@see: L{Hydrogenate} for details about how we are using it to
reposition singlets (via method 1 mentioned above).
"""
if not singlet.is_singlet():
return
singlet.Hydrogenate()
if minimize:
msg = "ATTENTION: Using minimizer to adjust open bond singlets."
env.history.message(orangemsg(msg))
# Singlet is repositioned properly using minimize.
# The problem is that this redraws while running. Don't want that!
# Talk to Bruce and Eric M. about it. Mark 2007-10-21.
LocalMinimize_function([singlet], nlayers=0)
# Transmute() will not transmute singlets. Since <singlet> is a Hydrogen,
# and not a singlet, this will work. -mark 2007-10-31 (Boo!)
from model.elements import Singlet
singlet.Transmute(Singlet)
return
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:45,代码来源:sim_commandruns.py
示例14: recompute_center_axis
def recompute_center_axis(self, glpane): #bruce 060120 replaced los arg with glpane re bug 1344
# try to point in direction of prior axis, or along line of sight if no old axis (self.axis is V(0,0,0) then)
nears = [self.axis, glpane.lineOfSight, glpane.down]
pos = A( map( lambda a: a.posn(), self.atoms ) )
self.center = sum(pos)/len(pos)
relpos = pos - self.center
from geometry.geometryUtilities import compute_heuristic_axis
axis = compute_heuristic_axis( relpos, 'normal', already_centered = True, nears = nears, dflt = None )
if not axis:
#e warning? I think so... BTW we pass dflt = None to make the warning come out more often;
# I don't know if we'd need to check for it here if we didn't.
env.history.message( orangemsg( "Warning: motor axis chosen arbitrarily since atom arrangement doesn't suggest one." ))
#k can this come out too often during movie-playing? No, because we don't recompute axis then at all.
axis = glpane.lineOfSight
self.axis = axis
self.assy.changed() #bruce 060116 fix unreported bug analogous to bug 1331
self._initial_posns = None #bruce 050518; needed in RotaryMotor, harmless in others
return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:18,代码来源:jigs_motors.py
示例15: _modifyStructure
def _modifyStructure(self, params):
"""
Modifies the structure (Plane) using the provided params.
@param params: The parameters used as an input to modify the structure
(Plane created using this Plane_EditCommand)
@type params: tuple
"""
assert self.struct
assert params
assert len(params) == 5
force, stiffness, enable_minimize_state, color, atoms = params
numberOfAtoms = len(atoms)
atomNumberRequirementMet, logMessage = self._checkMotorAtomLimits(numberOfAtoms)
if not atomNumberRequirementMet:
atoms = self.struct.atoms[:]
logMessage = (
logMessage + " Motor will remain attached to the"
" atoms listed in the <b>Attached Atoms</b> list in"
" this property manager"
)
logMessage = orangemsg(logMessage)
self.propMgr.updateMessage(logMessage)
assert len(atoms) > 0
self.struct.cancelled = False
self.struct.force = force
self.struct.stiffness = stiffness
self.struct.enable_minimize = enable_minimize_state
self.struct.color = color
# Not sure if it is safe to do self.struct.atoms = atoms
# Instead using 'setShaft method -- ninad 2007-10-09
self.struct.setShaft(atoms)
self.struct.findCenterAndAxis(atoms, self.win.glpane)
self.propMgr.updateAttachedAtomListWidget(atomList=atoms)
self.win.win_update() # Update model tree
self.win.assy.changed()
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:43,代码来源:LinearMotor_EditCommand.py
示例16: include_dir_ok
def include_dir_ok(include_dir):
"""
Is this include_dir acceptable (or maybe acceptable)? Return (0, "") or (errorcode, errortext).
"""
if env.debug():
print "debug: include_dir_ok(include_dir = %r)" % (include_dir,)
if os.path.isdir(include_dir):
# ok, but warn if transforms.inc is not inside it
if not os.path.exists(os.path.join(include_dir, "transforms.inc")):
msg = "Warning: transforms.inc not present in POV include directory [%s]; rendering might not work" % (include_dir,)
env.history.message(orangemsg(msg))
if env.debug():
print "debug: include_dir_ok returns 0 (ok)"
return 0, "" # ok
else:
if env.debug():
print "debug: include_dir_ok returns 1 (Not found or not a directory)"
return 1, "POV include directory: Not found or not a directory" #e pathname might be too long for a dialog
pass
开发者ID:foulowl,项目名称:nanoengineer,代码行数:19,代码来源:povray.py
示例17: _make_bonds_3
def _make_bonds_3(self):
"""
Make bonds -- part 3.
(Print history warning if self.singlet_found_with_multiple_bonds.)
"""
if self.singlet_found_with_multiple_bonds:
mbonds, singlets_not_bonded, bp = self.multibonds()
self.total_bonds_made = len(self.bondable_pairs_atoms)
if singlets_not_bonded == 1:
msg = "%d bondpoint had more than one way to bond. It was not bonded." % (singlets_not_bonded,)
else:
msg = "%d bondpoints had more than one way to bond. They were not bonded." % (singlets_not_bonded,)
env.history.message(orangemsg(msg))
else:
# All bondpoints had only one way to bond.
self.total_bonds_made = len(self.bondable_pairs_atoms)
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:19,代码来源:fusechunksMode.py
示例18: atom_limit_exceeded_and_confirmed
def atom_limit_exceeded_and_confirmed(parent, natoms, limit = 200):
"""
Displays a warning message if 'natoms' exceeds 'limit'.
Returns False if the number of atoms does not exceed the limit or if the
user confirms that the jigs should still be created even though the limit
was exceeded.
If parent is 0, the message box becomes an application-global modal dialog
box.
If parent is a widget, the message box becomes modal relative to parent.
"""
if natoms < limit:
return False # Atom limit not exceeded.
wmsg = "Warning: Creating a jig with " + str(natoms) \
+ " atoms may degrade performance.\nDo you still want to add the jig?"
dialog = QMessageBox("Warning", wmsg,
QMessageBox.Warning,
QMessageBox.Yes,
QMessageBox.No,
QMessageBox.NoButton,
parent)
# We want to add a "Do not show this message again." checkbox to the dialog
# like this:
# checkbox = QCheckBox("Do not show this message again.", dialog)
# The line of code above works, but places the checkbox in the upperleft
# corner of the dialog, obscuring important text. I'll fix this later.
# Mark 051122.
ret = dialog.exec_()
if ret != QMessageBox.Yes:
return True
# Print warning msg in history widget whenever the user adds new jigs with
# more than 'limit' atoms.
wmsg = "Warning: " + str(natoms) + " atoms selected. A jig with more " \
"than " + str(limit) + " atoms may degrade performance."
env.history.message(orangemsg(wmsg))
return False # from atom_limit_exceeded_and_confirmed
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:42,代码来源:jigmakers_Mixin.py
示例19: _unset_some_open_bond_direction
def _unset_some_open_bond_direction(atom, direction):
"""
Find an open bond on atom with the specified bond direction set
(error if you can't), and unset its bond direction.
"""
assert direction in (-1, 1)
didit = False
for bond in atom.bonds:
if bond.is_open_bond() and \
bond.bond_direction_from(atom) == direction: # bugfix 080201, care which direction is set, not just that some dir was set
bond.clear_bond_direction()
didit = True
break
continue
assert didit
summary_format = "Warning: dna updater unset bond direction on [N] open bond(s)"
env.history.deferred_summary_message( orangemsg(summary_format) )
return
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:20,代码来源:fix_bond_directions.py
示例20: debug_make_BorrowerChunk_raw
def debug_make_BorrowerChunk_raw(do_addmol = True):
win = env.mainwindow()
atomset = win.assy.selatoms
if not atomset:
env.history.message(redmsg("Need selected atoms to make a BorrowerChunk (for debugging only)"))
else:
atomset = dict(atomset) # copy it, since we shouldn't really add singlets to assy.selatoms...
for atom in atomset.values(): # not itervalues, we're changing it in the loop!
# BTW Python is nicer about this than I expected:
# exceptions.RuntimeError: dictionary changed size during iteration
for bp in atom.singNeighbors(): # likely bugs if these are not added into the set!
atomset[bp.key] = bp
assy = atom.molecule.assy # these are all the same, and we do this at least once
chunk = BorrowerChunk(assy, atomset)
if do_addmol:
win.assy.addmol(chunk)
import __main__
__main__._bc = chunk
env.history.message(orangemsg("__main__._bc = %s (for debugging only)" % quote_html(safe_repr(chunk))))
win.win_update() #k is this done by caller?
return
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:21,代码来源:BorrowerChunk.py
注:本文中的utilities.Log.orangemsg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论