Changeset 7432acb in sasview for src/sas/sasgui
- Timestamp:
- Apr 9, 2017 4:11:31 AM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 45dffa69
- Parents:
- ac07a3a
- Location:
- src/sas/sasgui
- Files:
-
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/dataFitting.py
r235f514 r7432acb 154 154 result.lam = np.append(self.lam, other.lam) 155 155 result.lam = result.lam[ind] 156 if result.dlam !=None:156 if result.dlam is not None: 157 157 result.dlam = np.append(self.dlam, other.dlam) 158 158 result.dlam = result.dlam[ind] 159 if result.dy !=None:159 if result.dy is not None: 160 160 result.dy = np.append(self.dy, other.dy) 161 161 result.dy = result.dy[ind] … … 307 307 result.lam = np.append(self.lam, other.lam) 308 308 result.lam = result.lam[ind] 309 if result.dy !=None:309 if result.dy is not None: 310 310 result.dy = np.append(self.dy, other.dy) 311 311 result.dy = result.dy[ind] -
src/sas/sasgui/guiframe/data_processor.py
rac07a3a r7432acb 1028 1028 label += create_label(col_name, 1029 1029 int(new_row) + 1, None) 1030 if row_min != None and row_max !=None:1030 if row_min is not None and row_max is not None: 1031 1031 if index == 0: 1032 1032 label += create_label(col_name, … … 1374 1374 wx.PostEvent(self.parent.parent, StatusEvent(status=msg, info="error")) 1375 1375 return 1376 if dy !=None and (len(y) != len(dy)):1376 if dy is not None and (len(y) != len(dy)): 1377 1377 msg = "Need same length for Y and dY axis and both greater than 0" 1378 1378 msg += " to plot.\n" … … 1572 1572 """ 1573 1573 1574 if label !=None:1574 if label is not None: 1575 1575 tcrtl_label.SetValue(str(label)) 1576 if title !=None:1576 if title is not None: 1577 1577 tcrtl_title.SetValue(str(title)) 1578 1578 … … 1685 1685 # I Believe this is no longer used now that we have removed the 1686 1686 # edit menu from the menubar - PDB July 12, 2015 1687 if event !=None:1687 if event is not None: 1688 1688 event.Skip() 1689 1689 pos = self.panel.notebook.GetSelection() … … 1697 1697 # I Believe this is no longer used now that we have removed the 1698 1698 # edit menu from the menubar - PDB July 12, 2015 1699 if event !=None:1699 if event is not None: 1700 1700 event.Skip() 1701 1701 pos = self.panel.notebook.GetSelection() … … 1739 1739 pos = self.panel.notebook.GetSelection() 1740 1740 grid = self.panel.notebook.GetPage(pos) 1741 has_data = (grid.data !=None and grid.data != {})1741 has_data = (grid.data is not None and grid.data != {}) 1742 1742 self.open_excel_menu.Enable(has_data) 1743 1743 self.save_menu.Enable(has_data) … … 1822 1822 path = dlg.GetPath() 1823 1823 dlg.Destroy() 1824 if path !=None:1824 if path is not None: 1825 1825 if self.parent is not None: 1826 1826 data = grid.get_grid_view() … … 2007 2007 path = dlg.GetPath() 2008 2008 dlg.Destroy() 2009 if path !=None:2009 if path is not None: 2010 2010 if self.parent is not None and self.data is not None: 2011 2011 self.parent.write_batch_tofile(data=self.data, -
src/sas/sasgui/guiframe/local_perspectives/plotting/AnnulusSlicer.py
r235f514 r7432acb 498 498 # Update locations 499 499 self.outer_circle.update() 500 # if self.is_inside !=None:500 # if self.is_inside is not None: 501 501 out = self._post_data() 502 502 return out -
src/sas/sasgui/guiframe/local_perspectives/plotting/Arc.py
r235f514 r7432acb 71 71 x = [] 72 72 y = [] 73 if theta1 !=None:73 if theta1 is not None: 74 74 self.theta1 = theta1 75 if theta2 !=None:75 if theta2 is not None: 76 76 self.theta2 = theta2 77 77 while self.theta2 < self.theta1: -
src/sas/sasgui/guiframe/local_perspectives/plotting/Edge.py
r959eb01 r7432acb 63 63 Draw the new roughness on the graph. 64 64 """ 65 if r1 !=None:65 if r1 is not None: 66 66 self.r1 = r1 67 if r2 !=None:67 if r2 is not None: 68 68 self.r2 = r2 69 if theta !=None:69 if theta is not None: 70 70 self.theta = theta 71 71 x1 = self.r1 * math.cos(self.theta) -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py
rac07a3a r7432acb 183 183 # So manually recode the size (=x_size) and compare here. 184 184 # Massy code to work around:< 185 if self.parent._mgr !=None:185 if self.parent._mgr is not None: 186 186 max_panel = self.parent._mgr.GetPane(self) 187 187 if max_panel.IsMaximized(): 188 188 self.parent._mgr.RestorePane(max_panel) 189 189 max_panel.Maximize() 190 if self.x_size !=None:190 if self.x_size is not None: 191 191 if self.x_size == self.GetSize(): 192 192 self.resizing = False … … 241 241 xval = float(active_ctrl.GetValue()) 242 242 position = self.get_data_xy_vals(xval) 243 if position !=None and not self.is_corfunc:243 if position is not None and not self.is_corfunc: 244 244 wx.PostEvent(self.parent, StatusEvent(status=position)) 245 245 except: … … 342 342 self.q_ctrl = None 343 343 return 344 if self.ly != None and event.xdata !=None:344 if self.ly is not None and event.xdata is not None: 345 345 # Selecting a new line if cursor lines are displayed already 346 346 dqmin = math.fabs(event.xdata - self.ly[0].get_xdata()) … … 364 364 return 365 365 # release a q range vline 366 if self.ly !=None and not self.leftdown:366 if self.ly is not None and not self.leftdown: 367 367 for ly in self.ly: 368 368 ly.set_alpha(0.7) … … 372 372 if ax is None or not hasattr(event, 'action'): 373 373 return 374 end_drag = event.action != 'drag' and event.xdata !=None374 end_drag = event.action != 'drag' and event.xdata is not None 375 375 nop = len(self.plots) 376 376 pos_x, _ = float(event.xdata), float(event.ydata) … … 514 514 ax = event.inaxes 515 515 PlotPanel.onLeftDown(self, event) 516 if ax !=None:516 if ax is not None: 517 517 try: 518 518 pos_x = float(event.xdata) # / size_x … … 683 683 684 684 685 if self.position !=None:685 if self.position is not None: 686 686 wx_id = ids.next() 687 687 self._slicerpop.Append(wx_id, '&Add Text') … … 760 760 default_name = default_name.split('.')[0] 761 761 default_name += "_out" 762 if self.parent !=None:762 if self.parent is not None: 763 763 self.parent.save_data1d(data, default_name) 764 764 … … 778 778 default_name = default_name.split('.')[0] 779 779 # default_name += "_out" 780 if self.parent !=None:780 if self.parent is not None: 781 781 self.parent.show_data1d(data, default_name) 782 782 -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
rac07a3a r7432acb 156 156 PlotPanel.onLeftDown(self, event) 157 157 ax = event.inaxes 158 if ax !=None:158 if ax is not None: 159 159 # data coordinate position 160 160 pos_x = "%8.3g" % event.xdata … … 264 264 # control axis labels from the panel itself 265 265 yname, yunits = data.get_yaxis() 266 if self.yaxis_label !=None:266 if self.yaxis_label is not None: 267 267 yname = self.yaxis_label 268 268 yunits = self.yaxis_unit … … 271 271 self.yaxis_unit = yunits 272 272 xname, xunits = data.get_xaxis() 273 if self.xaxis_label !=None:273 if self.xaxis_label is not None: 274 274 xname = self.xaxis_label 275 275 xunits = self.xaxis_unit … … 355 355 slicerpop.Append(wx_id, '&Box Averaging in Qy') 356 356 wx.EVT_MENU(self, wx_id, self.onBoxavgY) 357 if self.slicer !=None:357 if self.slicer is not None: 358 358 wx_id = ids.next() 359 359 slicerpop.Append(wx_id, '&Clear Slicer') … … 435 435 msg = "Add Text: Error. Check your property values..." 436 436 logger.error(msg) 437 if self.parent !=None:437 if self.parent is not None: 438 438 wx.PostEvent(self.parent, StatusEvent(status=msg)) 439 439 dial.Destroy() … … 629 629 630 630 """ 631 if self.slicer !=None:631 if self.slicer is not None: 632 632 from SlicerParameters import SlicerParameterPanel 633 633 dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") … … 735 735 """ 736 736 event_id = str(evt.GetId()) 737 if self.parent !=None:737 if self.parent is not None: 738 738 self._default_save_location = self.parent._default_save_location 739 739 default_name = self.plots[self.graph.selected_plottable].label … … 759 759 default_name = default_name.split('.')[0] 760 760 #default_name += "_out" 761 if self.parent !=None:761 if self.parent is not None: 762 762 self.parent.show_data2d(data, default_name) 763 763 -
src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py
r235f514 r7432acb 362 362 self.left_moving = left 363 363 theta3 = 0 364 if phi !=None:364 if phi is not None: 365 365 self.phi = phi 366 366 if delta is None: … … 374 374 self.theta = mline.theta + self.phi 375 375 376 if mline !=None:376 if mline is not None: 377 377 if delta != 0: 378 378 self.theta2 = mline + delta … … 538 538 """ 539 539 540 if theta !=None:540 if theta is not None: 541 541 self.theta = theta 542 542 x1 = self.radius * math.cos(self.theta) -
src/sas/sasgui/guiframe/local_perspectives/plotting/SimplePlot.py
r959eb01 r7432acb 87 87 pos = (pos_x, pos_y + 5) 88 88 self.PopupMenu(slicerpop, pos) 89 if self.scale !=None:89 if self.scale is not None: 90 90 self.parent.scale2d = self.scale 91 91 … … 106 106 self.leftdown = True 107 107 ax = event.inaxes 108 if ax !=None:108 if ax is not None: 109 109 self.xInit, self.yInit = event.xdata, event.ydata 110 110 try: … … 123 123 """ 124 124 self.resizing = False 125 if self.x_size !=None:125 if self.x_size is not None: 126 126 if self.x_size == self.GetSize(): 127 127 self.canvas.set_resizing(self.resizing) … … 161 161 self.plots[plot.name] = plot 162 162 # Axis scales 163 if plot.xtransform !=None:163 if plot.xtransform is not None: 164 164 self.xLabel = plot.xtransform 165 if plot.ytransform !=None:165 if plot.ytransform is not None: 166 166 self.yLabel = plot.ytransform 167 167 # Init graph -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxMask.py
r959eb01 r7432acb 123 123 x2=self.vertical_lines.x2, 124 124 width=self.vertical_lines.half_width) 125 # if self.is_inside !=None:125 # if self.is_inside is not None: 126 126 out = self._post_data() 127 127 return out -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py
r235f514 r7432acb 147 147 y_max = math.fabs(self.horizontal_lines.y) 148 148 149 if nbins !=None:149 if nbins is not None: 150 150 self.nbins = nbins 151 151 if self.averager is None: … … 357 357 """ 358 358 # # Reset x, y- coordinates if send as parameters 359 if x !=None:359 if x is not None: 360 360 self.x = np.sign(self.x) * math.fabs(x) 361 if y !=None:361 if y is not None: 362 362 self.y = np.sign(self.y) * math.fabs(y) 363 363 # # Draw lines and markers … … 464 464 """ 465 465 # # reset x, y -coordinates if given as parameters 466 if x !=None:466 if x is not None: 467 467 self.x = np.sign(self.x) * math.fabs(x) 468 if y !=None:468 if y is not None: 469 469 self.y = np.sign(self.y) * math.fabs(y) 470 470 # # draw lines and markers -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py
rd85c194 r7432acb 353 353 Draw the new roughness on the graph. 354 354 """ 355 if center_x !=None:355 if center_x is not None: 356 356 self.x = center_x 357 if center_y !=None:357 if center_y is not None: 358 358 self.y = center_y 359 359 self.center_marker.set(xdata=[self.x], ydata=[self.y]) … … 490 490 """ 491 491 # # save the new height, witdh of the rectangle if given as a param 492 if width !=None:492 if width is not None: 493 493 self.half_width = width 494 if height !=None:494 if height is not None: 495 495 self.half_height = height 496 496 # # If new center coordinates are given draw the rectangle 497 497 # #given these value 498 if center !=None:498 if center is not None: 499 499 self.center_x = center.x 500 500 self.center_y = center.y … … 511 511 return 512 512 # # if x1, y1, y2, y3 are given draw the rectangle with this value 513 if x1 !=None:513 if x1 is not None: 514 514 self.x1 = x1 515 if x2 !=None:515 if x2 is not None: 516 516 self.x2 = x2 517 if y1 !=None:517 if y1 is not None: 518 518 self.y1 = y1 519 if y2 !=None:519 if y2 is not None: 520 520 self.y2 = y2 521 521 # # Draw 2 vertical lines and a marker … … 657 657 """ 658 658 # # save the new height, witdh of the rectangle if given as a param 659 if width !=None:659 if width is not None: 660 660 self.half_width = width 661 if height !=None:661 if height is not None: 662 662 self.half_height = height 663 663 # # If new center coordinates are given draw the rectangle 664 664 # #given these value 665 if center !=None:665 if center is not None: 666 666 self.center_x = center.x 667 667 self.center_y = center.y … … 679 679 return 680 680 # # if x1, y1, y2, y3 are given draw the rectangle with this value 681 if x1 !=None:681 if x1 is not None: 682 682 self.x1 = x1 683 if x2 !=None:683 if x2 is not None: 684 684 self.x2 = x2 685 if y1 !=None:685 if y1 is not None: 686 686 self.y1 = y1 687 if y2 !=None:687 if y2 is not None: 688 688 self.y2 = y2 689 689 # # Draw 2 vertical lines and a marker -
src/sas/sasgui/guiframe/local_perspectives/plotting/detector_dialog.py
r235f514 r7432acb 155 155 self.qmax_ctl.SetLabel(str(format_number(qmax))) 156 156 self.beam_ctl.SetLabel(str(format_number(beam))) 157 if zmin !=None:157 if zmin is not None: 158 158 self.zmin_ctl.SetValue(str(format_number(zmin))) 159 if zmax !=None:159 if zmax is not None: 160 160 self.zmax_ctl.SetValue(str(format_number(zmax))) 161 161 -
src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py
rac07a3a r7432acb 100 100 wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 101 101 102 if data !=None:102 if data is not None: 103 103 # Font size 104 104 kwds = [] … … 235 235 event.Skip() 236 236 # from boxMask import BoxMask 237 if event !=None:237 if event is not None: 238 238 self._on_clear_slicer(event) 239 239 self.slicer_z += 1 … … 336 336 """ 337 337 # the case of liitle numbers of True points 338 if len(mask[mask]) < 10 and self.data !=None:338 if len(mask[mask]) < 10 and self.data is not None: 339 339 self.ShowMessage() 340 340 mask = copy.deepcopy(self.mask) … … 355 355 temp_data.data[mask == False] = temp_mask[mask == False] 356 356 self.plotpanel.clear() 357 if self.slicer !=None:357 if self.slicer is not None: 358 358 self.slicer.clear() 359 359 self.slicer = None … … 460 460 wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 461 461 462 if data !=None:462 if data is not None: 463 463 # Font size 464 464 kwds = [] … … 710 710 Status msg 711 711 """ 712 if self.parent.parent.parent !=None:712 if self.parent.parent.parent is not None: 713 713 wx.PostEvent(self.parent.parent.parent, 714 714 StatusEvent(status=msg, type=type)) -
src/sas/sasgui/guiframe/local_perspectives/plotting/profile_dialog.py
r959eb01 r7432acb 44 44 wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 45 45 46 if data !=None:46 if data is not None: 47 47 #Font size 48 48 kwds = [] … … 284 284 default_name = default_name.split('.')[0] 285 285 default_name += "_out" 286 if self.parent !=None:286 if self.parent is not None: 287 287 # What an ancestor! 288 288 fit_panel = self.parent.parent.parent -
src/sas/sasgui/guiframe/local_perspectives/plotting/sector_mask.py
r235f514 r7432acb 96 96 self.left_line.update(phi=self.right_line.phi, delta=None, 97 97 mline=self.main_line, side=True, left=False) 98 #if self.is_inside !=None:98 #if self.is_inside is not None: 99 99 out = self._post_data() 100 100 return out -
src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py
r235f514 r7432acb 114 114 self.Layout() 115 115 psizer = self.parent.GetSizer() 116 if psizer !=None:116 if psizer is not None: 117 117 psizer.Layout() 118 118 -
src/sas/sasgui/guiframe/plugin_base.py
rd85c194 r7432acb 161 161 Sets default frame config 162 162 """ 163 if self.frame !=None:163 if self.frame is not None: 164 164 self.frame.EnableCloseButton(False) 165 165 self.frame.Show(False) … … 230 230 old_frame = None 231 231 old_persp = self.parent.get_current_perspective() 232 if old_persp !=None:232 if old_persp is not None: 233 233 old_frame = old_persp.get_frame() 234 234 self.parent.check_multimode(self) … … 236 236 self.parent.set_perspective(self.perspective) 237 237 238 if self.frame !=None:239 if old_frame !=None:238 if self.frame is not None: 239 if old_frame is not None: 240 240 pos_x, pos_y = old_frame.GetPositionTuple() 241 241 self.frame.SetPosition((pos_x, pos_y)) -
src/sas/sasgui/guiframe/startup_configuration.py
r235f514 r7432acb 208 208 for key, item in strings.iteritems(): 209 209 if (key == 'DEFAULT_PERSPECTIVE') or \ 210 (key == 'DEFAULT_OPEN_FOLDER' and item !=None):210 (key == 'DEFAULT_OPEN_FOLDER' and item is not None): 211 211 out_f.write("%s = \"%s\"\n" % (key,str(item))) 212 212 else: -
src/sas/sasgui/guiframe/utils.py
r959eb01 r7432acb 89 89 list = [] 90 90 for item in mylist: 91 if re.search(separator,item) !=None:91 if re.search(separator,item)is not None: 92 92 if n > 0: 93 93 word = re.split(separator, item, int(n)) -
src/sas/sasgui/perspectives/calculator/data_operator.py
r235f514 r7432acb 182 182 On data name typing 183 183 """ 184 if event !=None:184 if event is not None: 185 185 event.Skip() 186 186 item = event.GetEventObject() … … 264 264 self.put_text_pic(self.data2_pic, content=str(val)) 265 265 self.check_data_inputs() 266 if self.output !=None:266 if self.output is not None: 267 267 self.output.name = str(self.data_namectr.GetValue()) 268 268 self.draw_output(self.output) … … 284 284 self.data1_pic.add_image(data) 285 285 self.check_data_inputs() 286 if self.output !=None:286 if self.output is not None: 287 287 self.output.name = str(self.data_namectr.GetValue()) 288 288 self.draw_output(self.output) … … 297 297 self.put_text_pic(self.operator_pic, content=text) 298 298 self.check_data_inputs() 299 if self.output !=None:299 if self.output is not None: 300 300 self.output.name = str(self.data_namectr.GetValue()) 301 301 self.draw_output(self.output) … … 329 329 data = None 330 330 item.SetClientData(pos, data) 331 if data !=None:331 if data is not None: 332 332 self.check_data_inputs() 333 333 334 334 self.put_text_pic(self.data2_pic, content) 335 335 336 if self.output !=None:336 if self.output is not None: 337 337 self.output.name = str(self.data_namectr.GetValue()) 338 338 self.draw_output(self.output) … … 472 472 On Focus at this window 473 473 """ 474 if event !=None:474 if event is not None: 475 475 event.Skip() 476 476 self._data = self.get_datalist() … … 534 534 ids = self._data.keys() 535 535 for id in ids: 536 if id !=None:537 if self._data[id].data !=None:536 if id is not None: 537 if self._data[id].data is not None: 538 538 dnames.append(self._data[id].data.name) 539 539 else: … … 546 546 for datastate in val_list: 547 547 data = datastate.data 548 if data !=None:548 if data is not None: 549 549 name = data.name 550 550 pos1 = self.data1_cbox.Append(str(name)) … … 577 577 """ 578 578 data_manager = self.parent.parent.get_data_manager() 579 if data_manager !=None:579 if data_manager is not None: 580 580 return data_manager.get_all_data() 581 581 else: … … 983 983 On close event 984 984 """ 985 if self.manager !=None:985 if self.manager is not None: 986 986 self.manager.data_operator_frame = None 987 987 self.panel.disconnect_panels() -
src/sas/sasgui/perspectives/calculator/density_panel.py
r235f514 r7432acb 438 438 On close event 439 439 """ 440 if self.manager !=None:440 if self.manager is not None: 441 441 self.manager.cal_md_frame = None 442 442 self.Destroy() -
src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
rac07a3a r7432acb 61 61 Add icon in the frame 62 62 """ 63 if parent !=None:63 if parent is not None: 64 64 if hasattr(frame, "IsIconized"): 65 65 if not frame.IsIconized(): … … 74 74 Set_error dialog 75 75 """ 76 if item !=None:76 if item is not None: 77 77 item.SetBackgroundColour("pink") 78 78 item.Refresh() 79 79 if show_msg: 80 80 msg = "Error: wrong (or out of range) value entered." 81 if panel.parent.parent !=None:81 if panel.parent.parent is not None: 82 82 wx.PostEvent(panel.parent.parent, 83 83 StatusEvent(status=msg, info='Error')) … … 425 425 """ 426 426 unit = 'sec' 427 if self.time_text !=None:427 if self.time_text is not None: 428 428 self.time_text.SetForegroundColour('black') 429 429 etime = self.estimate_ctime() … … 633 633 self.model.set_sld_data(self.sld_data) 634 634 635 self.draw_button.Enable(self.sld_data !=None)635 self.draw_button.Enable(self.sld_data is not None) 636 636 wx.CallAfter(self.parent.set_sld_data, self.sld_data) 637 637 self._update_model_params() … … 855 855 """ 856 856 flag = self.parent.check_omfpanel_inputs() 857 if not flag and self.parent.parent !=None:857 if not flag and self.parent.parent is not None: 858 858 infor = 'Error' 859 859 msg = 'Error: Wrong inputs in the SLD info panel.' … … 865 865 self.sld_data = self.parent.get_sld_from_omf() 866 866 if self.sld_data is None: 867 if self.parent.parent !=None:867 if self.parent.parent is not None: 868 868 infor = 'Error' 869 869 msg = 'Error: No data has been selected.' … … 971 971 self.bt_compute.SetLabel(label) 972 972 self.bt_compute.SetToolTipString(label) 973 if self.parent.parent !=None:973 if self.parent.parent is not None: 974 974 wx.PostEvent(self.parent.parent, 975 975 StatusEvent(status=msg, type=type)) … … 995 995 for ind in range(len(input[0])): 996 996 if self.is_avg: 997 if ind % 1 == 0 and update !=None:997 if ind % 1 == 0 and update is not None: 998 998 update() 999 999 time.sleep(0.1) … … 1002 1002 out = np.append(out, outi) 1003 1003 else: 1004 if ind % 50 == 0 and update !=None:1004 if ind % 50 == 0 and update is not None: 1005 1005 update() 1006 1006 time.sleep(0.001) … … 1151 1151 new_plot.label = new_plot.id 1152 1152 #theory_data = deepcopy(new_plot) 1153 if self.parent.parent !=None:1153 if self.parent.parent is not None: 1154 1154 self.parent.parent.update_theory(data_id=new_plot.id, 1155 1155 theory=new_plot, … … 1210 1210 new_plot.label = new_plot.id 1211 1211 #theory_data = deepcopy(new_plot) 1212 if self.parent.parent !=None:1212 if self.parent.parent is not None: 1213 1213 self.parent.parent.update_theory(data_id=data.id, 1214 1214 theory=new_plot, … … 1299 1299 mz = sld_sets[key] 1300 1300 else: 1301 if sld_sets[key] !=None:1301 if sld_sets[key] is not None: 1302 1302 self.sld_data.set_sldn(sld_sets[key]) 1303 1303 self.sld_data.set_sldms(mx, my, mz) … … 1347 1347 infor = 'Error' 1348 1348 #logger.error(msg) 1349 if self.parent.parent !=None:1349 if self.parent.parent is not None: 1350 1350 # inform msg to wx 1351 1351 wx.PostEvent(self.parent.parent, … … 1690 1690 data = self.parent.get_sld_data() 1691 1691 fName = os.path.splitext(path)[0] + '.' + extension.split('.')[-1] 1692 if data !=None:1692 if data is not None: 1693 1693 try: 1694 1694 reader.write(fName, data) … … 1699 1699 infor = 'Error' 1700 1700 #logger.error(msg) 1701 if self.parent.parent !=None:1701 if self.parent.parent is not None: 1702 1702 # inform msg to wx 1703 1703 wx.PostEvent(self.parent.parent, … … 1708 1708 msg = "Error occurred while saving. " 1709 1709 infor = 'Error' 1710 if self.parent.parent !=None:1710 if self.parent.parent is not None: 1711 1711 # inform msg to wx 1712 1712 wx.PostEvent(self.parent.parent, … … 1718 1718 """ 1719 1719 flag = True 1720 if event !=None:1720 if event is not None: 1721 1721 event.Skip() 1722 1722 ctl = event.GetEventObject() … … 1758 1758 """ 1759 1759 flag = True 1760 if event !=None:1760 if event is not None: 1761 1761 event.Skip() 1762 1762 ctl = event.GetEventObject() … … 1974 1974 Send full draw to gui frame 1975 1975 """ 1976 if self.parent !=None:1976 if self.parent is not None: 1977 1977 self.parent.set_schedule_full_draw(panel, func) 1978 1978 … … 2050 2050 Close 2051 2051 """ 2052 if self.base !=None:2052 if self.base is not None: 2053 2053 self.base.gen_frame = None 2054 2054 self.Destroy() -
src/sas/sasgui/perspectives/calculator/image_viewer.py
r235f514 r7432acb 70 70 plot_frame.SetTitle('Picture -- %s --' % basename) 71 71 plot_frame.Show(True) 72 if parent !=None:72 if parent is not None: 73 73 parent.put_icon(plot_frame) 74 74 except: … … 403 403 output.is_data = True 404 404 output = reader2D_converter(output) 405 if self.base !=None:405 if self.base is not None: 406 406 data = self.base.create_gui_data(output, self.title) 407 407 self.base.add_data({data.id:data}) -
src/sas/sasgui/perspectives/calculator/kiessig_calculator_panel.py
r959eb01 r7432acb 190 190 """ 191 191 # skip for another event 192 if event !=None:192 if event is not None: 193 193 event.Skip() 194 194 dq = self.dq_name_tcl.GetValue() … … 237 237 Close event 238 238 """ 239 if self.manager !=None:239 if self.manager is not None: 240 240 self.manager.kiessig_frame = None 241 241 self.Destroy() -
src/sas/sasgui/perspectives/calculator/model_editor.py
r235f514 r7432acb 387 387 self._msg_box.SetLabel(msg) 388 388 self._msg_box.SetForegroundColour(color) 389 if self.parent.parent !=None:389 if self.parent.parent is not None: 390 390 from sas.sasgui.guiframe.events import StatusEvent 391 391 wx.PostEvent(self.parent.parent, StatusEvent(status=msg, … … 478 478 """ 479 479 # For Mac 480 if event !=None:480 if event is not None: 481 481 event.Skip() 482 482 item = event.GetEventObject() … … 979 979 980 980 # Prepare the messagebox 981 if self.base !=None and not msg:981 if self.base is not None and not msg: 982 982 self.base.update_custom_combo() 983 983 # Passed exception in import test as it will fail for sasmodels.sasview_model class … … 1002 1002 self._msg_box.SetForegroundColour(color) 1003 1003 # Send msg to the top window 1004 if self.base !=None:1004 if self.base is not None: 1005 1005 from sas.sasgui.guiframe.events import StatusEvent 1006 1006 wx.PostEvent(self.base.parent, … … 1190 1190 """ 1191 1191 self.Show(False) 1192 #if self.parent !=None:1192 #if self.parent is not None: 1193 1193 # self.parent.new_model_frame = None 1194 1194 #self.Destroy() -
src/sas/sasgui/perspectives/calculator/pyconsole.py
rddbac66 r7432acb 118 118 self.panel = panel 119 119 self._add_menu() 120 if filename !=None:120 if filename is not None: 121 121 dataDir = os.path.dirname(filename) 122 elif self.parent !=None:122 elif self.parent is not None: 123 123 dataDir = self.parent._default_save_location 124 124 else: … … 128 128 129 129 # See if there is a corresponding C file 130 if filename !=None:130 if filename is not None: 131 131 c_filename = os.path.splitext(filename)[0] + ".c" 132 132 if os.path.isfile(c_filename): … … 244 244 245 245 # See if there is a corresponding C file 246 if result.path !=None:246 if result.path is not None: 247 247 c_filename = os.path.splitext(result.path)[0] + ".c" 248 248 if os.path.isfile(c_filename): … … 303 303 304 304 # Update plugin model list in fitpage combobox 305 if success and self._manager != None and self.panel !=None:305 if success and self._manager is not None and self.panel is not None: 306 306 self._manager.set_edit_menu_helper(self.parent) 307 307 wx.CallAfter(self._manager.update_custom_combo) … … 337 337 Close event 338 338 """ 339 if self.base !=None:339 if self.base is not None: 340 340 self.base.py_frame = None 341 341 self.Destroy() -
src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
r235f514 r7432acb 656 656 event.Skip() 657 657 # Clear the plot 658 if self.image !=None:658 if self.image is not None: 659 659 self.image.clf() 660 660 # reset image … … 674 674 """ 675 675 # Skip event for next event 676 if event !=None:676 if event is not None: 677 677 event.Skip() 678 678 msg = "Please Check your input values " … … 708 708 # Validate the wave inputs 709 709 wave_input = self._validate_q_input(wavelength, wavelength_spread) 710 if wave_input !=None:710 if wave_input is not None: 711 711 wavelength, wavelength_spread = wave_input 712 712 … … 757 757 # Validate the q inputs 758 758 q_input = self._validate_q_input(self.qx, self.qy) 759 if q_input !=None:759 if q_input is not None: 760 760 self.qx, self.qy = q_input 761 761 … … 769 769 770 770 # Compute the resolution 771 if self.image !=None:771 if self.image is not None: 772 772 #_pylab_helpers.Gcf.set_active(self.fm) 773 773 _pylab_helpers.Gcf.figs = {} … … 982 982 """ 983 983 # skip for another event 984 if event !=None:984 if event is not None: 985 985 event.Skip() 986 986 # init resolution_calculator … … 1148 1148 Set the detector coordinate for sigmas to x-y coordinate 1149 1149 """ 1150 if event !=None:1150 if event is not None: 1151 1151 event.Skip() 1152 1152 # Set the coordinate in Cartesian … … 1160 1160 Set the detector coordinate for sigmas to polar coordinate 1161 1161 """ 1162 if event !=None:1162 if event is not None: 1163 1163 event.Skip() 1164 1164 # Set the coordinate in polar … … 1181 1181 self.compute_button.SetLabel(label) 1182 1182 self.compute_button.SetToolTipString(label) 1183 if self.parent.parent !=None:1183 if self.parent.parent is not None: 1184 1184 wx.PostEvent(self.parent.parent, 1185 1185 StatusEvent(status=msg, type=type)) … … 1196 1196 On source combobox selection 1197 1197 """ 1198 if event !=None:1198 if event is not None: 1199 1199 combo = event.GetEventObject() 1200 1200 event.Skip() … … 1215 1215 On source color combobox selection 1216 1216 """ 1217 if event !=None:1217 if event is not None: 1218 1218 #combo = event.GetEventObject() 1219 1219 event.Skip() … … 1253 1253 On spectrum ComboBox event 1254 1254 """ 1255 if event !=None:1255 if event is not None: 1256 1256 #combo = event.GetEventObject() 1257 1257 event.Skip() … … 1348 1348 """ 1349 1349 _pylab_helpers.Gcf.figs = {} 1350 if self.manager !=None:1350 if self.manager is not None: 1351 1351 self.manager.cal_res_frame = None 1352 1352 self.Destroy() -
src/sas/sasgui/perspectives/calculator/sld_panel.py
r959eb01 r7432acb 504 504 On close event 505 505 """ 506 if self.manager !=None:506 if self.manager is not None: 507 507 self.manager.sld_frame = None 508 508 self.Destroy() -
src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py
r235f514 r7432acb 303 303 Close event 304 304 """ 305 if self.manager !=None:305 if self.manager is not None: 306 306 self.manager.cal_slit_frame = None 307 307 self.Destroy() -
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
r1dc8ec9 r7432acb 320 320 path = None 321 321 default_save_location = os.getcwd() 322 if self._manager.parent !=None:322 if self._manager.parent is not None: 323 323 default_save_location = self._manager.parent.get_save_location() 324 324 … … 329 329 path = dlg.GetPath() 330 330 default_save_location = os.path.dirname(path) 331 if self._manager.parent !=None:331 if self._manager.parent is not None: 332 332 self._manager.parent._default_save_location = default_save_location 333 333 else: -
src/sas/sasgui/perspectives/corfunc/corfunc_state.py
r235f514 r7432acb 293 293 corstate = self._parse_state(entry) 294 294 295 if corstate !=None:295 if corstate is not None: 296 296 sas_entry.meta_data['corstate'] = corstate 297 297 sas_entry.filename = corstate.file -
src/sas/sasgui/perspectives/fitting/batchfitpage.py
ree4b3cb r7432acb 200 200 # self.state.formfactorcombobox = self.formfactorbox.GetCurrentSelection() 201 201 # 202 # if self.model !=None:202 # if self.model is not None: 203 203 # self._set_copy_flag(True) 204 204 # self._set_paste_flag(True) 205 # if self.data !=None:205 # if self.data is not None: 206 206 # self._set_bookmark_flag(False) 207 207 # self._keep.Enable(False) … … 225 225 # 226 226 # 227 # if event !=None:227 # if event is not None: 228 228 # ## post state to fit panel 229 229 # new_event = PageInfoEvent(page = self) … … 254 254 # is_modified = False 255 255 # 256 # if self.model != None:256 # if self.model is not None: 257 257 # ##Check the values 258 258 # self._check_value_enter( self.fittable_param) … … 291 291 # else: 292 292 # #self.btFit.Enable(True) 293 # if self._is_2D() and self.data !=None:293 # if self._is_2D() and self.data is not None: 294 294 # self.btEditMask.Enable(True) 295 295 # … … 335 335 # self._set_save_flag(False) 336 336 # else: 337 # if self.model !=None:337 # if self.model is not None: 338 338 # self._set_bookmark_flag(False) 339 339 # self._keep.Enable(False) -
src/sas/sasgui/perspectives/fitting/fitting.py
r235f514 r7432acb 302 302 Make new model 303 303 """ 304 if self.new_model_frame !=None:304 if self.new_model_frame is not None: 305 305 self.new_model_frame.Show(False) 306 306 self.new_model_frame.Show(True) … … 441 441 wx.PostEvent(self.parent, StatusEvent(status=msg)) 442 442 443 if page !=None:443 if page is not None: 444 444 return set_focus_page(page) 445 445 if caption == "Const & Simul Fit": … … 634 634 state = self.temp_state[self.state_index] 635 635 #panel state should have model selection to set_state 636 if state.formfactorcombobox !=None:636 if state.formfactorcombobox is not None: 637 637 #set state 638 638 data = self.parent.create_gui_data(state.data) … … 1016 1016 return False 1017 1017 ## If a thread is already started, stop it 1018 #if self.calc_fit !=None and self.calc_fit.isrunning():1018 #if self.calc_fitis not None and self.calc_fit.isrunning(): 1019 1019 # self.calc_fit.stop() 1020 1020 msg = "Fitting is in progress..." … … 1106 1106 page = self.fit_panel.add_empty_page() 1107 1107 # add data associated to the page created 1108 if page !=None:1108 if page is not None: 1109 1109 evt = StatusEvent(status="Page Created", info="info") 1110 1110 wx.PostEvent(self.parent, evt) … … 1216 1216 for item in param: 1217 1217 ## check if constraint 1218 if item[0] != None and item[1] !=None:1218 if item[0] is not None and item[1] is not None: 1219 1219 listOfConstraint.append((item[0], item[1])) 1220 1220 new_model = model … … 1457 1457 cell.value = index 1458 1458 1459 if theory_data !=None:1459 if theory_data is not None: 1460 1460 #Suucessful fit 1461 1461 theory_data.id = wx.NewId() … … 1544 1544 #(CallAfter is important to MAC) 1545 1545 try: 1546 #if res !=None:1546 #if res is not None: 1547 1547 wx.CallAfter(cpage.onsetValues, res.fitness, 1548 1548 res.param_list, … … 2010 2010 if index is None: 2011 2011 index = np.ones(len(data_copy.data), dtype=bool) 2012 if weight !=None:2012 if weight is not None: 2013 2013 data_copy.err_data = weight 2014 2014 # get rid of zero error points … … 2025 2025 if index is None: 2026 2026 index = np.ones(len(data_copy.y), dtype=bool) 2027 if weight !=None:2027 if weight is not None: 2028 2028 data_copy.dy = weight 2029 2029 if data_copy.dy is None or data_copy.dy == []: -
src/sas/sasgui/perspectives/fitting/model_thread.py
r235f514 r7432acb 56 56 self.qmin = 0 57 57 if self.qmax is None: 58 if self.data !=None:58 if self.data is not None: 59 59 newx = math.pow(max(math.fabs(self.data.xmax), 60 60 math.fabs(self.data.xmin)), 2) -
src/sas/sasgui/perspectives/fitting/report_dialog.py
r959eb01 r7432acb 39 39 self.nimages = len(self.report_list[2]) 40 40 41 if self.report_list[2] !=None:41 if self.report_list[2] is not None: 42 42 # put image path in the report string 43 43 if len(self.report_list[2]) == 1: -
src/sas/sasgui/perspectives/invariant/invariant.py
r959eb01 r7432acb 331 331 new_plot.title = self.__data.title 332 332 # Save theory_data in a state 333 if data !=None:333 if data is not None: 334 334 name_head = name.split('-') 335 335 if name_head[0] == 'Low': … … 353 353 354 354 # Save data in a state: but seems to never happen 355 if new_plot !=None:355 if new_plot is not None: 356 356 self.invariant_panel.state.data = copy.deepcopy(new_plot) 357 357 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, -
src/sas/sasgui/perspectives/invariant/invariant_panel.py
r235f514 r7432acb 609 609 wx.PostEvent(self.parent, StatusEvent(status=msg)) 610 610 # set a state for this computation for saving 611 elif event !=None:611 elif event is not None: 612 612 self._set_compute_state(state='compute') 613 613 self._set_bookmark_flag(True) … … 718 718 self._set_preview_flag(True) 719 719 720 if event !=None:720 if event is not None: 721 721 self._set_preview_flag(True) 722 722 self._set_save_flag(True) … … 1022 1022 self.state.saved_state['state_num'] = 0 1023 1023 self.state.saved_state['compute_num'] = 0 1024 if self._data !=None:1024 if self._data is not None: 1025 1025 self.state.saved_state['file'] = str(self._data.name) 1026 1026 else: … … 1244 1244 # Ask the user the location of the file to write to. 1245 1245 path = None 1246 if self.parent !=None:1246 if self.parent is not None: 1247 1247 self._default_save_location = self.parent.get_save_location() 1248 1248 if self._default_save_location is None: … … 1254 1254 path = dlg.GetPath() 1255 1255 self._default_save_location = os.path.dirname(path) 1256 if self.parent !=None:1256 if self.parent is not None: 1257 1257 self.parent._default_save_location = \ 1258 1258 self._default_save_location … … 1393 1393 Enable and disable the power value editing 1394 1394 """ 1395 if event !=None:1395 if event is not None: 1396 1396 self._set_bookmark_flag(True) 1397 1397 self._set_preview_flag(False) … … 1411 1411 Disable or enable some button if the user enable low q extrapolation 1412 1412 """ 1413 if event !=None:1413 if event is not None: 1414 1414 self._set_bookmark_flag(True) 1415 1415 self._set_preview_flag(False) … … 1438 1438 Enable editing power law section at low q range 1439 1439 """ 1440 if event !=None:1440 if event is not None: 1441 1441 self._set_bookmark_flag(True) 1442 1442 self._set_preview_flag(False) … … 1537 1537 Enable and disable the power value editing 1538 1538 """ 1539 if event !=None:1539 if event is not None: 1540 1540 self._set_bookmark_flag(True) 1541 1541 … … 1554 1554 Disable or enable some button if the user enable high q extrapolation 1555 1555 """ 1556 if event !=None:1556 if event is not None: 1557 1557 self._set_bookmark_flag(True) 1558 1558 self._set_preview_flag(False) -
src/sas/sasgui/perspectives/invariant/invariant_state.py
r235f514 r7432acb 281 281 # File name 282 282 element = newdoc.createElement("filename") 283 if self.file !=None and self.file != '':283 if self.file is not None and self.file != '': 284 284 element.appendChild(newdoc.createTextNode(str(self.file))) 285 285 else: … … 734 734 # invstate could be None when .svs file is loaded 735 735 # in this case, skip appending to output 736 if invstate !=None:736 if invstate is not None: 737 737 sas_entry.meta_data['invstate'] = invstate 738 738 sas_entry.filename = invstate.file -
src/sas/sasgui/perspectives/pr/inversion_panel.py
r235f514 r7432acb 271 271 # Ask the user the location of the file to write to. 272 272 path = None 273 if self.parent !=None:273 if self.parent is not None: 274 274 self._default_save_location = self.parent._default_save_location 275 275 dlg = wx.FileDialog(self, "Choose a file", … … 279 279 path = dlg.GetPath() 280 280 self._default_save_location = os.path.dirname(path) 281 if self.parent !=None:281 if self.parent is not None: 282 282 self.parent._default_save_location = self._default_save_location 283 283 else: -
src/sas/sasgui/perspectives/pr/inversion_state.py
r959eb01 r7432acb 473 473 #prstate could be None when .svs file is loaded 474 474 #in this case, skip appending to output 475 if prstate !=None:475 if prstate is not None: 476 476 sas_entry.meta_data['prstate'] = prstate 477 477 sas_entry.filename = prstate.file -
src/sas/sasgui/perspectives/pr/pr.py
rac07a3a r7432acb 721 721 722 722 # If a thread is already started, stop it 723 if self.calc_thread !=None and self.calc_thread.isrunning():723 if self.calc_thread is not None and self.calc_thread.isrunning(): 724 724 self.calc_thread.stop() 725 725 ## stop just raises the flag -- the thread is supposed to … … 1129 1129 1130 1130 # If a thread is already started, stop it 1131 if self.estimation_thread !=None and \1131 if self.estimation_thread is not None and \ 1132 1132 self.estimation_thread.isrunning(): 1133 1133 self.estimation_thread.stop() … … 1159 1159 1160 1160 # If a thread is already started, stop it 1161 if self.estimation_thread !=None and self.estimation_thread.isrunning():1161 if self.estimation_thread is not None and self.estimation_thread.isrunning(): 1162 1162 self.estimation_thread.stop() 1163 1163 ## stop just raises the flag -- the thread is supposed to -
src/sas/sasgui/perspectives/simulation/simulation.py
r959eb01 r7432acb 213 213 214 214 # If a computation thread is running, stop it 215 if self.calc_thread_1D !=None and self.calc_thread_1D.isrunning():215 if self.calc_thread_1D is not None and self.calc_thread_1D.isrunning(): 216 216 self.calc_thread_1D.stop() 217 217 ## stop just raises the flag -- the thread is supposed to -
src/sas/sasgui/plottools/PlotPanel.py
r235f514 r7432acb 154 154 self.selectedText = None 155 155 #User scale 156 if xtransform !=None:156 if xtransform is not None: 157 157 self.xLabel = xtransform 158 158 else: 159 159 self.xLabel = "log10(x)" 160 if ytransform !=None:160 if ytransform is not None: 161 161 self.yLabel = ytransform 162 162 else: … … 360 360 return 361 361 362 if ax !=None:362 if ax is not None: 363 363 self.xInit, self.yInit = event.xdata, event.ydata 364 364 try: … … 392 392 Set legend alpha 393 393 """ 394 if self.legend !=None:394 if self.legend is not None: 395 395 self.legend.legendPatch.set_alpha(alpha) 396 396 … … 461 461 # User has clicked on text and is dragging 462 462 ax = event.inaxes 463 if ax !=None:463 if ax is not None: 464 464 # Only move text if mouse is within axes 465 465 self.selectedText.set_position((event.xdata, event.ydata)) … … 476 476 if self.leftdown == True and self.mousemotion == True: 477 477 ax = event.inaxes 478 if ax !=None: # the dragging is perform inside the figure478 if ax is not None: # the dragging is perform inside the figure 479 479 self.xFinal, self.yFinal = event.xdata, event.ydata 480 480 # Check whether this is the first point … … 576 576 step = event.step 577 577 578 if ax !=None:578 if ax is not None: 579 579 # Event occurred inside a plotting area 580 580 lo, hi = ax.get_xlim() … … 935 935 # reset postion 936 936 self.position = None 937 if self.graph.selected_plottable !=None:937 if self.graph.selected_plottable is not None: 938 938 self.graph.selected_plottable = None 939 939 … … 959 959 prop=FontProperties(size=10), 960 960 loc=self.legendLoc) 961 if self.legend !=None:961 if self.legend is not None: 962 962 self.legend.set_picker(self.legend_picker) 963 963 self.legend.set_axes(self.subplot) … … 989 989 prop=FontProperties(size=10), 990 990 loc=self.legendLoc) 991 if self.legend !=None:991 if self.legend is not None: 992 992 self.legend.set_picker(self.legend_picker) 993 993 self.legend.set_axes(self.subplot) … … 1010 1010 pos_x = 0 1011 1011 pos_y = 0 1012 if self.position !=None:1012 if self.position is not None: 1013 1013 pos_x, pos_y = self.position 1014 1014 else: … … 1035 1035 self.subplot.figure.canvas.draw_idle() 1036 1036 except: 1037 if self.parent !=None:1037 if self.parent is not None: 1038 1038 msg = "Add Text: Error. Check your property values..." 1039 1039 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1069 1069 self.xaxis_tick = xaxis_font 1070 1070 1071 if self.data !=None:1071 if self.data is not None: 1072 1072 # 2D 1073 1073 self.xaxis(self.xaxis_label, self.xaxis_unit, \ … … 1116 1116 self.yaxis_tick = yaxis_font 1117 1117 1118 if self.data !=None:1118 if self.data is not None: 1119 1119 # 2D 1120 1120 self.yaxis(self.yaxis_label, self.yaxis_unit, \ … … 1155 1155 label_temp = textdial.getText() 1156 1156 if label_temp.count("\%s" % "\\") > 0: 1157 if self.parent !=None:1157 if self.parent is not None: 1158 1158 msg = "Add Label: Error. Can not use double '\\' " 1159 1159 msg += "characters..." … … 1162 1162 label = label_temp 1163 1163 except: 1164 if self.parent !=None:1164 if self.parent is not None: 1165 1165 msg = "Add Label: Error. Check your property values..." 1166 1166 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1180 1180 num_text = len(self.textList) 1181 1181 if num_text < 1: 1182 if self.parent !=None:1182 if self.parent is not None: 1183 1183 msg = "Remove Text: Nothing to remove. " 1184 1184 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1190 1190 text_remove = txt.get_text() 1191 1191 txt.remove() 1192 if self.parent !=None:1192 if self.parent is not None: 1193 1193 msg = "Removed Text: '%s'. " % text_remove 1194 1194 wx.PostEvent(self.parent, StatusEvent(status=msg)) 1195 1195 except: 1196 if self.parent !=None:1196 if self.parent is not None: 1197 1197 msg = "Remove Text: Error occurred. " 1198 1198 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1250 1250 prop=FontProperties(size=10), 1251 1251 loc=self.legendLoc) 1252 if self.legend !=None:1252 if self.legend is not None: 1253 1253 self.legend.set_picker(self.legend_picker) 1254 1254 self.legend.set_axes(self.subplot) … … 1279 1279 if font: 1280 1280 self.subplot.set_xlabel(label, fontproperties=font, color=color) 1281 if t_font !=None:1281 if t_font is not None: 1282 1282 for tick in self.subplot.xaxis.get_major_ticks(): 1283 1283 tick.label.set_fontproperties(t_font) … … 1300 1300 if font: 1301 1301 self.subplot.set_ylabel(label, fontproperties=font, color=color) 1302 if t_font !=None:1302 if t_font is not None: 1303 1303 for tick_label in self.subplot.get_yticklabels(): 1304 1304 tick_label.set_fontproperties(t_font) … … 1327 1327 from plottable_interactor import PointInteractor 1328 1328 p = PointInteractor(self, self.subplot, zorder=zorder, id=id) 1329 if p.markersize !=None:1329 if p.markersize is not None: 1330 1330 markersize = p.markersize 1331 1331 p.points(x, y, dx=dx, dy=dy, color=color, symbol=symbol, zorder=zorder, … … 1363 1363 1364 1364 # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 1365 if dx !=None and type(dx) == type(()):1365 if dx is not None and type(dx) == type(()): 1366 1366 dx = nx.vstack((x - dx[0], dx[1] - x)).transpose() 1367 if dy !=None and type(dy) == type(()):1367 if dy is not None and type(dy) == type(()): 1368 1368 dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 1369 1369 if dx is None and dy is None: … … 1772 1772 # control axis labels from the panel itself 1773 1773 yname, yunits = item.get_yaxis() 1774 if self.yaxis_label !=None:1774 if self.yaxis_label is not None: 1775 1775 yname = self.yaxis_label 1776 1776 yunits = self.yaxis_unit … … 1779 1779 self.yaxis_unit = yunits 1780 1780 xname, xunits = item.get_xaxis() 1781 if self.xaxis_label !=None:1781 if self.xaxis_label is not None: 1782 1782 xname = self.xaxis_label 1783 1783 xunits = self.xaxis_unit -
src/sas/sasgui/plottools/TextDialog.py
r959eb01 r7432acb 41 41 style_box = wx.BoxSizer(wx.HORIZONTAL) 42 42 # tcA 43 if unit !=None:43 if unit is not None: 44 44 styles = wx.TAB_TRAVERSAL 45 45 height = -1 … … 130 130 0, wx.TOP, 5) 131 131 family_box.Add(self.font_size, 0, 0) 132 if unit_box !=None:132 if unit_box is not None: 133 133 family_box.Add((_BOX_WIDTH / 2, -1)) 134 134 family_box.Add(tick_label_text, 0, 0) … … 159 159 text_box.Add(self.text_string) 160 160 vbox.Add(text_box, 0, wx.EXPAND, 15) 161 if unit_box !=None:161 if unit_box is not None: 162 162 unit_box.Add(unit_text, 0, 0) 163 163 unit_box.Add(self.unit_ctrl, 0, 0) -
src/sas/sasgui/plottools/arrow3d.py
r959eb01 r7432acb 29 29 self.base = base 30 30 31 if base !=None:31 if base is not None: 32 32 # To turn the updating off during dragging 33 33 base.canvas.mpl_connect('button_press_event', self.on_left_down) -
src/sas/sasgui/plottools/canvas.py
r463e7ffc r7432acb 153 153 """ 154 154 self.panel.subplot.grid(self.panel.grid_on) 155 if self.panel.legend !=None and self.panel.legend_pos_loc:155 if self.panel.legend is not None and self.panel.legend_pos_loc: 156 156 self.panel.legend._loc = self.panel.legend_pos_loc 157 157 self.idletimer.Restart(5, *args, **kwargs) # Delay by 5 ms -
src/sas/sasgui/plottools/fitDialog.py
r235f514 r7432acb 579 579 self.I0_tctr.SetValue(format_number(val)) 580 580 if self.Rgerr_tctr.IsShown(): 581 if rg !=None and rg != 0:581 if rg is not None and rg != 0: 582 582 value = format_number(3 * float(errA) / (2 * rg)) 583 583 else: … … 593 593 self.Diameter_tctr.SetValue(value) 594 594 if self.Diametererr_tctr.IsShown(): 595 if rg !=None and rg != 0:595 if rg is not None and rg != 0: 596 596 value = format_number(8 * float(errA) / _diam) 597 597 else: -
src/sas/sasgui/plottools/plottable_interactor.py
rac07a3a r7432acb 56 56 markersize = self.markersize 57 57 # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 58 if dx !=None and type(dx) == type(()):58 if dx is not None and type(dx) == type(()): 59 59 dx = nx.vstack((x - dx[0], dx[1] - x)).transpose() 60 if dy !=None and type(dy) == type(()):60 if dy is not None and type(dy) == type(()): 61 61 dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 62 62 -
src/sas/sasgui/plottools/plottables.py
rac07a3a r7432acb 682 682 has_err_y = not (dy is None or len(dy) == 0) 683 683 684 if(x != None) and (y !=None):684 if(x is not None) and (y is not None): 685 685 if not dx is None and not len(dx) == 0 and not len(x) == len(dx): 686 686 msg = "Plottable.View: Given x and dx are not" … … 864 864 if self.dy is None: 865 865 self.dy = np.zeros(len(self.y)) 866 if xmin != None and xmax !=None:866 if xmin is not None and xmax is not None: 867 867 for i in range(len(self.x)): 868 868 if self.x[i] >= xmin and self.x[i] <= xmax: -
src/sas/sasgui/plottools/transform.py
r235f514 r7432acb 188 188 189 189 """ 190 if dx !=None:190 if dx is not None: 191 191 err = 2 * x * dx 192 192 return math.fabs(err) … … 204 204 """ 205 205 if x > 0: 206 if dx !=None:206 if dx is not None: 207 207 err = dx / (2 * math.sqrt(x)) 208 208 else: … … 222 222 223 223 """ 224 if dx !=None:224 if dx is not None: 225 225 err = 4 * math.pow(x, 3) * dx 226 226 return math.fabs(err) … … 238 238 """ 239 239 if x > 0: 240 if dx !=None:240 if dx is not None: 241 241 err = dx / (4 * math.pow(x, 3 / 4)) 242 242 else:
Note: See TracChangeset
for help on using the changeset viewer.