Skip to content

Commit

Permalink
Moved things around
Browse files Browse the repository at this point in the history
  • Loading branch information
instance-id committed Mar 15, 2020
1 parent 777ac99 commit 915c5f6
Show file tree
Hide file tree
Showing 86 changed files with 2,672 additions and 1,612 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
scripts/python/searcher/db
scripts/python/searcher/.history
python2.7libs/*
!python2.7libs/searcher/
python2.7libs/searcher/searcher/db
python2.7libs/searcher/searcher/.history
**.history*
scripts/python/searcher/go/houdini


python2.7libs/searcher/searcher/go/houdini
python2.7libs/searcher/searcher/_conversion
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
File renamed without changes.
116 changes: 116 additions & 0 deletions out/linecounter.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
===============================================================================
EXTENSION NAME : linecounter
EXTENSION VERSION : 0.2.7
-------------------------------------------------------------------------------
count time : 2020-03-13 02:25:02
count workspace : e:\GitHub\Searcher
total files : 35
total code lines : 4969
total comment lines : 607
total blank lines : 741

statistics
| extension| total code| total comment| total blank|percent|
-------------------------------------------------------------------------
| | 158| 0| 27| 3.2|
| .md| 2| 0| 0| 0.040|
| .py| 4107| 607| 714| 83|
| .ui| 702| 0| 0| 14|
-------------------------------------------------------------------------
.gitignore, code is 97, comment is 0, blank is 20.
README.md, code is 2, comment is 0, blank is 0.
scripts\456.py, code is 299, comment is 30, blank is 55.
scripts\python\__init__py, code is 0, comment is 0, blank is 0.
scripts\python\searcher\__init__.py, code is 0, comment is 6, blank is 0.
scripts\python\searcher\about.py, code is 27, comment is 0, blank is 7.
scripts\python\searcher\about_ui.py, code is 68, comment is 8, blank is 13.
scripts\python\searcher\animator.py, code is 46, comment is 1, blank is 11.
scripts\python\searcher\bugreport.py, code is 27, comment is 0, blank is 7.
scripts\python\searcher\bugreport_ui.py, code is 68, comment is 8, blank is 13.
scripts\python\searcher\database.py, code is 324, comment is 61, blank is 52.
scripts\python\searcher\datahandler.py, code is 64, comment is 6, blank is 23.
scripts\python\searcher\enum.py, code is 29, comment is 6, blank is 3.
scripts\python\searcher\HelpButton.py, code is 34, comment is 5, blank is 13.
scripts\python\searcher\images\logo.png, it is a binary file.
scripts\python\searcher\inspect.py, code is 637, comment is 66, blank is 138.
scripts\python\searcher\language_en.py, code is 31, comment is 4, blank is 4.
scripts\python\searcher\linklabel, code is 0, comment is 0, blank is 0.
scripts\python\searcher\platformselect.py, code is 25, comment is 0, blank is 6.
scripts\python\searcher\ptime.py, code is 19, comment is 3, blank is 11.
scripts\python\searcher\scratch, code is 61, comment is 0, blank is 7.
scripts\python\searcher\searcher.py, code is 940, comment is 137, blank is 139.
scripts\python\searcher\searcher_data.py, code is 57, comment is 1, blank is 13.
scripts\python\searcher\searcher_settings.py, code is 419, comment is 66, blank is 55.
scripts\python\searcher\searchersettings_ui.py, code is 165, comment is 23, blank is 51.
scripts\python\searcher\session.py, code is 64, comment is 16, blank is 31.
scripts\python\searcher\ui_files\about.ui, code is 120, comment is 0, blank is 0.
scripts\python\searcher\ui_files\searcher_ui.py, code is 111, comment is 6, blank is 8.
scripts\python\searcher\ui_files\searcher_ui.ui, code is 248, comment is 0, blank is 0.
scripts\python\searcher\ui_files\SearcherSettings.py, code is 168, comment is 6, blank is 7.
scripts\python\searcher\ui_files\SearcherSettings.ui, code is 334, comment is 0, blank is 0.
scripts\python\searcher\util.py, code is 381, comment is 148, blank is 37.
scripts\python\searcher\version.py, code is 7, comment is 0, blank is 2.
scripts\python\searcher\widgets\__init__py, code is 0, comment is 0, blank is 0.
scripts\python\searcher\widgets\collapsedock.py, code is 97, comment is 0, blank is 15.
===============================================================================
===============================================================================
EXTENSION NAME : linecounter
EXTENSION VERSION : 0.2.7
-------------------------------------------------------------------------------
count time : 2020-03-13 02:28:04
count workspace : e:\GitHub\Searcher
total files : 39
total code lines : 5092
total comment lines : 607
total blank lines : 790

statistics
| extension| total code| total comment| total blank|percent|
-------------------------------------------------------------------------
| .md| 2| 0| 0| 0.039|
| | 158| 0| 27| 3.1|
| .shelf| 23| 0| 3| 0.45|
| .py| 4107| 607| 714| 81|
| .txt| 100| 0| 46| 2.0|
| .ui| 702| 0| 0| 14|
-------------------------------------------------------------------------
.gitignore, code is 97, comment is 0, blank is 20.
Help\searcher\index.txt, code is 50, comment is 0, blank is 23.
Help\searcher\main.txt, code is 50, comment is 0, blank is 23.
README.md, code is 2, comment is 0, blank is 0.
scripts\456.py, code is 299, comment is 30, blank is 55.
scripts\python\__init__py, code is 0, comment is 0, blank is 0.
scripts\python\searcher\__init__.py, code is 0, comment is 6, blank is 0.
scripts\python\searcher\about.py, code is 27, comment is 0, blank is 7.
scripts\python\searcher\about_ui.py, code is 68, comment is 8, blank is 13.
scripts\python\searcher\animator.py, code is 46, comment is 1, blank is 11.
scripts\python\searcher\bugreport.py, code is 27, comment is 0, blank is 7.
scripts\python\searcher\bugreport_ui.py, code is 68, comment is 8, blank is 13.
scripts\python\searcher\database.py, code is 324, comment is 61, blank is 52.
scripts\python\searcher\datahandler.py, code is 64, comment is 6, blank is 23.
scripts\python\searcher\enum.py, code is 29, comment is 6, blank is 3.
scripts\python\searcher\HelpButton.py, code is 34, comment is 5, blank is 13.
scripts\python\searcher\images\logo.png, it is a binary file.
scripts\python\searcher\inspect.py, code is 637, comment is 66, blank is 138.
scripts\python\searcher\language_en.py, code is 31, comment is 4, blank is 4.
scripts\python\searcher\linklabel, code is 0, comment is 0, blank is 0.
scripts\python\searcher\platformselect.py, code is 25, comment is 0, blank is 6.
scripts\python\searcher\ptime.py, code is 19, comment is 3, blank is 11.
scripts\python\searcher\scratch, code is 61, comment is 0, blank is 7.
scripts\python\searcher\searcher.py, code is 940, comment is 137, blank is 139.
scripts\python\searcher\searcher_data.py, code is 57, comment is 1, blank is 13.
scripts\python\searcher\searcher_settings.py, code is 419, comment is 66, blank is 55.
scripts\python\searcher\searchersettings_ui.py, code is 165, comment is 23, blank is 51.
scripts\python\searcher\session.py, code is 64, comment is 16, blank is 31.
scripts\python\searcher\ui_files\about.ui, code is 120, comment is 0, blank is 0.
scripts\python\searcher\ui_files\searcher_ui.py, code is 111, comment is 6, blank is 8.
scripts\python\searcher\ui_files\searcher_ui.ui, code is 248, comment is 0, blank is 0.
scripts\python\searcher\ui_files\SearcherSettings.py, code is 168, comment is 6, blank is 7.
scripts\python\searcher\ui_files\SearcherSettings.ui, code is 334, comment is 0, blank is 0.
scripts\python\searcher\util.py, code is 381, comment is 148, blank is 37.
scripts\python\searcher\version.py, code is 7, comment is 0, blank is 2.
scripts\python\searcher\widgets\__init__py, code is 0, comment is 0, blank is 0.
scripts\python\searcher\widgets\collapsedock.py, code is 97, comment is 0, blank is 15.
toolbar\searcher.shelf, code is 12, comment is 0, blank is 2.
toolbar\searchertool.shelf, code is 11, comment is 0, blank is 1.
===============================================================================
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
121 changes: 121 additions & 0 deletions python2.7libs/searcher/colorfieldselector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import hou

from hutil.Qt import QtCore
from hutil.Qt import QtGui
from hutil.Qt import QtWidgets

_MIN_RGB_VALUE = 0
_MAX_RGB_VALUE = 255

class ColorFieldSelector(QtWidgets.QWidget):
"""
hou.qt.ColorField
A widget for color input.
The widget contains a color swatch button and an input field for RGBA
values.
This class inherits from Qt's QtWidgets.QWidget class.
"""
def __init__(self, label="", include_alpha=False):
"""
__init__(self, label=\"\", include_alpha=False)
Create and return a new ColorField object.
label
If set to a non-empty string then a label is added to the color
field.
include_alpha
If True, then an alpha component is added to the color field.
"""
QtWidgets.QWidget.__init__(self)

layout = QtWidgets.QHBoxLayout()
layout.setSpacing(hou.ui.scaledSize(2))
layout.setContentsMargins(0, 0, 0, 0)

self.colorSwatchButton = hou.qt.ColorSwatchButton(include_alpha)

# Use the color swatch button's colorChanged signal as our own.
self.colorChanged = self.colorSwatchButton.colorChanged

self.inputField = hou.qt.InputField(
hou.qt.InputField.FloatType,
4 if include_alpha else 3)

if label is not None and label != "":
layout.addWidget(hou.qt.FieldLabel(label))

layout.addWidget(self.colorSwatchButton)
layout.addSpacing(hou.ui.scaledSize(5))
layout.addWidget(self.inputField)

# Connect color swatch button to field so their values
# are always in-sync.
self.colorSwatchButton.colorChanged.connect(
self._updateFieldFromColorSwatch)
self.inputField.valueChanged.connect(
self._updateColorSwatchFromField)

# Sync input field with color swatch.
self._updateFieldFromColorSwatch(self.colorSwatchButton.color())

self.setLayout(layout)

def color(self):
"""
color() -> QtGui.QColor
Return the field's current color.
"""
return self.colorSwatchButton.color()

def setColor(self, color):
"""
setColor(color)
Set the field's current color. color must be a QtGui.QColor object.
"""
self.colorSwatchButton.setColor(color)

# Update the input field with the new color.
self._updateFieldFromColorSwatch(color)

def _updateFieldFromColorSwatch(self, color):
if self.colorSwatchButton.hasAlpha():
self.inputField.setValues([
color.redF(), color.greenF(), color.blueF(), color.alphaF()])
else:
self.inputField.setValues([
color.redF(), color.greenF(), color.blueF()])

def _updateColorSwatchFromField(self):
values = list(self.inputField.values())

color = QtGui.QColor()
color.setRedF(self._clampRGBValue(values[0]))
color.setGreenF(self._clampRGBValue(values[1]))
color.setBlueF(self._clampRGBValue(values[2]))

if self.colorSwatchButton.hasAlpha():
color.setAlphaF(self._clampRGBValue(values[3]))

self.colorSwatchButton.setColor(color)

def _clampRGBValue(self, val):
if val > 1.0:
return 1.0

if val < 0.0:
return 0.0

return val

Loading

0 comments on commit 915c5f6

Please sign in to comment.