source: orange/orange/OrangeWidgets/OWTools.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 1.0 KB checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

Line 
1#
2# OWTools.py
3# tools for Visual Orange
4#
5
6TRUE=1
7FALSE=0
8
9from PyQt4.QtCore import *
10from PyQt4.QtGui import *
11from random import *
12
13try:
14    import win32api, win32con
15    t = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE, "SOFTWARE\\Python\\PythonCore\\%i.%i\\PythonPath\\Orange" % sys.version_info[:2], 0, win32con.KEY_READ)
16    t = win32api.RegQueryValueEx(t, "")[0]
17    orangedir = t[:t.find("orange")] + "orange"
18except:
19    import os
20    orangedir = os.getcwd()
21    if orangedir[-12:] == "OrangeCanvas":
22        orangedir = orangedir[:-13]
23
24if not os.path.exists(orangedir+"/orngStat.py"):
25    orangedir = None
26
27def getHtmlCompatibleString(strVal):
28    return strVal.replace("<=", "&#8804;").replace(">=","&#8805;").replace("<", "&#60;").replace(">","&#62;").replace("=\\=", "&#8800;")
29
30
31
32def domainPurger(examples, purgeClasses):
33    import orange
34    newDomain = orange.RemoveUnusedValues(removeOneValued=True)(examples, 0, True, purgeClasses)
35    if newDomain != examples.domain:
36        return orange.ExampleTable(newDomain, examples)
37    return examples
Note: See TracBrowser for help on using the repository browser.