Ignore:
Timestamp:
Nov 9, 2017 8:41:55 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
7fb471d
Parents:
b3e8629
git-author:
Piotr Rozyczko <rozyczko@…> (10/27/17 03:42:57)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 08:41:55)
Message:

Converted more syntax not covered by 2to3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/ConvertUnits.py

    • Property mode changed from 100755 to 100644
    rb3e8629 rcee5c78  
    44""" 
    55import re 
    6 import string 
    76 
    87def convertUnit(power, unit): 
     
    1110    """ 
    1211    if power != 0: 
    13         if string.find(unit, "^") != -1:  # if the unit contains a powerer ^ 
     12        if unit.find("^") != -1:  # if the unit contains a powerer ^ 
    1413            toks = re.split("\^", unit) 
    15             if string.find(toks[0], "/") != -1 or \ 
    16                 string.find(toks[0], "-") != -1: 
     14            if toks[0].find("/") != -1 or \ 
     15                toks[0].find("-") != -1: 
    1716                if power == 1: 
    1817                    unit = unit 
     
    2019                    unit = "(" + unit + ")" + "^{" + str(power) + "}" 
    2120            else: 
    22                 if string.find(toks[1], "{") != -1:  # if found a { 
     21                if toks[1].find("{") != -1:  # if found a { 
    2322                    find_power_toks = re.split("{", toks[1]) 
    24                     if string.find(find_power_toks[1], "}") != -1:  # found } 
     23                    if find_power_toks[1].find("}") != -1:  # found } 
    2524                        unit_toks = re.split("}", find_power_toks[1]) 
    26                         if string.find(unit_toks[0], ".") != -1: 
     25                        if unit_toks[0].find(".") != -1: 
    2726                            powerer = float(unit_toks[0]) * power 
    28                         elif string.find(unit_toks[0], "/") != -1: 
     27                        elif unit_toks[0].find("/") != -1: 
    2928                            power_toks = re.split("/", unit_toks[0]) 
    3029                            powerer = power * int(power_toks[0])\ 
Note: See TracChangeset for help on using the changeset viewer.