Skip to content

Commit

Permalink
Added github issue creation
Browse files Browse the repository at this point in the history
  • Loading branch information
instance-id committed Apr 1, 2020
1 parent bb489e2 commit 3b55521
Show file tree
Hide file tree
Showing 17 changed files with 1,562 additions and 297 deletions.
1,079 changes: 1,079 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion .idea/Searcher.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"python.pythonPath": "C:\\Python27\\python.exe",
"python.pythonPath": "e:\\GitHub\\Searcher\\venv1\\Scripts\\python.exe",
"python.formatting.provider": "autopep8",
"python.linting.pylintEnabled": false,
"python.linting.enabled": false,
Expand Down
41 changes: 35 additions & 6 deletions python2.7libs/searcher/bugreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from searcher import util
import os
import sys
import codecs

import hou
hver = 0
Expand All @@ -12,12 +13,21 @@
from hutil.Qt import QtGui
from hutil.Qt import QtCore
from hutil.Qt import QtWidgets
if hver >= 395:
from hutil.Qt import QtUiTools
elif hver <= 394 and hver >= 391:
from hutil.Qt import _QtUiTools
elif hver < 391 and hver >= 348:
from hutil.Qt import QtUiTools
from hutil.Qt import QtUiTools

try:
pyside = os.environ['HOUDINI_QT_PREFERRED_BINDING']
parent = hou.qt.mainWindow()
except KeyError:
parent = hou.ui.mainQtWindow()
pyside = 'PySide'

if pyside == 'PySide2':
from PySide2 import QtWebEngineWidgets

elif pyside == 'PySide':
from PySide.QtWebKit import QWebView


scriptpath = os.path.dirname(os.path.realpath(__file__))

Expand All @@ -32,9 +42,28 @@ def __init__(self, parent=None):
self.ui = bugreport_ui.Ui_BugReport()
self.ui.setupUi(self)
self.ui.retranslateUi(self)
self.issuetitle = ""

self.ui.pushButton.pressed.connect(self.doweb)

self.installEventFilter(self)

def doweb(self):
issue = "Issue2"
self._webview = QtWebEngineWidgets.QWebEngineView(self)
self._webview.setGeometry(QtCore.QRect(0, 0, self.width(), self.height()))
self.issuetitle = issue
#set html content
html_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "bugsubmit.html"))
base_url = QtCore.QUrl(html_path)


html = codecs.open(html_path, 'r')
html_str = html.read()
html_out = html_str.replace('ISSUE_TITLE', self.issuetitle)
self._webview.setHtml(html_out, base_url)
self._webview.show()

# ------------------------------------------------------------- Events
# SECTION Events -----------------------------------------------------
def eventFilter(self, obj, event):
Expand Down
24 changes: 9 additions & 15 deletions python2.7libs/searcher/bugreport_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,19 @@ def setupUi(self, BugReport):
self.verticalLayout.setObjectName("verticalLayout")
self.secondrow = QtWidgets.QHBoxLayout()
self.secondrow.setObjectName("secondrow")
self.lineEdit = QtWidgets.QLineEdit(BugReport)
self.lineEdit.setMinimumSize(QtCore.QSize(175, 0))
self.lineEdit.setObjectName("lineEdit")
self.secondrow.addWidget(self.lineEdit)
self.title = QtWidgets.QLineEdit(BugReport)
self.title.setMinimumSize(QtCore.QSize(175, 0))
self.title.setObjectName("title")
self.secondrow.addWidget(self.title)
self.verticalLayout.addLayout(self.secondrow)
self.headerrow = QtWidgets.QHBoxLayout()
self.headerrow.setObjectName("headerrow")
self.lineEdit_2 = QtWidgets.QLineEdit(BugReport)
self.lineEdit_2.setMinimumSize(QtCore.QSize(175, 0))
self.lineEdit_2.setObjectName("lineEdit_2")
self.headerrow.addWidget(self.lineEdit_2)
self.webview = QtWidgets.QWidget(BugReport)
self.webview.setObjectName("webview")
self.headerrow.addWidget(self.webview)
self.verticalLayout.addLayout(self.headerrow)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.textEdit = QtWidgets.QTextEdit(BugReport)
self.textEdit.setObjectName("textEdit")
self.horizontalLayout_2.addWidget(self.textEdit)
spacerItem = QtWidgets.QSpacerItem(0, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.horizontalLayout_2.addItem(spacerItem)
self.verticalLayout.addLayout(self.horizontalLayout_2)
Expand All @@ -62,7 +58,7 @@ def setupUi(self, BugReport):
self.logo.setSizePolicy(sizePolicy)
self.logo.setMaximumSize(QtCore.QSize(120, 120))
self.logo.setText("")
self.logo.setPixmap(QtGui.QPixmap(scriptpath + "/images/logo.png"))
self.logo.setPixmap(QtGui.QPixmap("C:/Users/mosthated/Downloads/483688212.png"))
self.logo.setScaledContents(True)
self.logo.setObjectName("logo")
self.horizontalLayout_3.addWidget(self.logo)
Expand All @@ -83,7 +79,5 @@ def setupUi(self, BugReport):
def retranslateUi(self, BugReport):
_translate = QtCore.QCoreApplication.translate
BugReport.setWindowTitle(_translate("BugReport", "Form"))
self.lineEdit.setPlaceholderText(_translate("BugReport", "Name:"))
self.lineEdit_2.setPlaceholderText(_translate("BugReport", "Contact:"))
self.textEdit.setPlaceholderText(_translate("BugReport", "What was the issue?"))
self.title.setPlaceholderText(_translate("BugReport", "Issue Title:"))
self.pushButton.setText(_translate("BugReport", "Submit Bug"))
22 changes: 22 additions & 0 deletions python2.7libs/searcher/bugsubmit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title>ISSUE_TITLE</title>
<style type="text/css">code{white-space: pre;}</style>

</script>
</head>

<body bgcolor="#3A3A3A">
<script src="https://utteranc.es/client.js"
repo="instance-id/instance-id.github.io"
issue-term="title"
theme="github-dark"
crossorigin="anonymous"
async>
</script>
</body>
</html>
23 changes: 9 additions & 14 deletions python2.7libs/searcher/searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import weakref
import timeit

from searcher import util
from searcher import style
Expand All @@ -23,12 +21,9 @@
import re
import sys
import hou
import time
import platform
import threading
import hdefereval as hd
from canvaseventtypes import *
from string import ascii_letters
from collections import Iterable

hver = 0
Expand Down Expand Up @@ -103,11 +98,12 @@ class Searcher(QtWidgets.QWidget):
# SECTION Class init -------------------------------------------------
def __init__(self, settings, windowsettings, animated, kwargs):
super(Searcher, self).__init__(parent=hou.qt.mainWindow())
# self.timerprofile = None # ANCHOR hou perf timer
# self.loadhevent = None # ANCHOR hou perf timer
# self.timerprofile = None # ANCHOR hou perf timer
# self.loadhevent = None # ANCHOR hou perf timer

# -------------------------- Constructed
# NOTE Constructed ----------------------
self.goalnum = 7
self.kwargs = kwargs
self.animated = animated
self.settingdata = settings
Expand Down Expand Up @@ -169,7 +165,6 @@ def __init__(self, settings, windowsettings, animated, kwargs):

# --------------------------------- Performance Vars
# NOTE Performance Vars ----------------------------

self.endtime = 0
self.starttime = 0
self.treecatnum = 0
Expand Down Expand Up @@ -209,7 +204,7 @@ def getwidgets(self):
data += ("Tool name: %s \n" % tool.name())
data += ("Tool label: %s \n" % tool.label())
data += ("Tool keywords: %s \n" % tool.script())
# data += ("Tool toolMenuLocations: %s \n" % tool.toolMenuOpType())
# data += ("Tool toolMenuLocations: %s \n" % tool.toolMenuOpType())


outputpath = os.path.join(
Expand Down Expand Up @@ -1023,15 +1018,15 @@ def ctxsearcher(self, ctx=None):
pos = QtGui.QCursor.pos()
if self.isdebug and self.isdebug.level in {"ALL"}:
print("Position: X:%d Y: %d" % (pos.x(), pos.y()))

undermouse = util.widgets_at(QtWidgets.QApplication, pos)
if undermouse:
for w in undermouse:
if w.windowTitle() != "":
ctxresult = util.PANETYPES.get(w.windowTitle()) if w.windowTitle() in util.PANETYPES else None
if ctxresult is not None:
if self.isdebug and self.isdebug.level in {"ALL"}:
print("Title: %s HContext: %s" (ctxresult[0], ctxresult[1]))
print("Title: %s HContext: %s" % (ctxresult[0], ctxresult[1]))
results = self.handler.searchctx(ctxresult[0])
self.searchbox.blockSignals(True)
self.searchbox.setText(":c %s" % ctxresult[1])
Expand Down Expand Up @@ -1068,18 +1063,18 @@ def ctxsearcher(self, ctx=None):
self.searchresultstree.setCurrentItem(
self.searchresultstree.topLevelItem(0).child(0)
)
# endtime = ptime.time() -------------------------------------- # ANCHOR CTXHotkey Performance Timer
# endtime = ptime.time() -------------------------------------- # ANCHOR CTXHotkey Performance Timer
# timetotal = ((endtime - self.starttime) * 1000.0)
# print("CTX Timer: %0.4f" % timetotal)
else:
e = "Unable to locate usable context item"
self.setstatusmsg(str(e), "ImportantMessage")

# --------------------------------- searchtablepopulate
# NOTE searchtablepopulate ----------------------------
def searchtablepopulate(self, data):
if len(data) > 0:
# tabletimer = hou.perfMon.startEvent("Table_Populate") ------- # ANCHOR hou perf timer
self.goalnum = 7
self.treecatnum = 0
self.treeitemsnum = 0
self.searchresultstree.clear()
Expand All @@ -1098,7 +1093,7 @@ def searchtablepopulate(self, data):

result, hctimer = self.handler.gethcontextod(self.context_list)
self.hcontexttime = hctimer
treebuildtimer = ptime.time() # ------------------------------ # ANCHOR Tree builder Start
treebuildtimer = ptime.time() # ------------------------------ # ANCHOR Tree builder Start
# TODO Test Map ---------
for hc in range(len(result)):
self.hcontext_tli[result[hc][2]] = (QtWidgets.QTreeWidgetItem(
Expand Down
20 changes: 3 additions & 17 deletions python2.7libs/searcher/searcher_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@
from searcher import searcher_settings_ui

from builtins import range
from past.utils import old_div
import platform
import os

import sys
import hou
import hdefereval
from hutil import py23
hver = 0
if os.environ["HFS"] != "":
ver = os.environ["HFS"]
Expand All @@ -42,12 +37,6 @@
reload(bugreport_ui)
reload(searcher_settings_ui)

# -------------------------------------------------------------------- App Info
__package__ = "Searcher"
__version__ = "0.1b"
__author__ = "instance.id"
__copyright__ = "2020 All rights reserved. See LICENSE for more details."
__status__ = "Prototype"

# --------------------------------------------- hou.session
# NOTE hou.session ----------------------------------------
Expand Down Expand Up @@ -121,8 +110,6 @@ def __init__(self, handler, width, height, parent=None):
QtCore.Qt.Tool
| QtCore.Qt.FramelessWindowHint
| QtCore.Qt.CustomizeWindowHint
#| QtCore.Qt.NoDropShadowWindowHint
# | QtCore.Qt.X11BypassWindowManagerHint
)
self.about.resize(width, height - 180)

Expand All @@ -132,10 +119,8 @@ def __init__(self, handler, width, height, parent=None):
QtCore.Qt.Tool
| QtCore.Qt.FramelessWindowHint
| QtCore.Qt.CustomizeWindowHint
#| QtCore.Qt.NoDropShadowWindowHint
# | QtCore.Qt.X11BypassWindowManagerHint
)
self.bugreport.resize(width, height - 180)
self.bugreport.resize(width, height - 15)

self.theme = theme.Theme(self)
self.theme.setAttribute(QtCore.Qt.WA_StyledBackground, True)
Expand All @@ -144,7 +129,6 @@ def __init__(self, handler, width, height, parent=None):
| QtCore.Qt.FramelessWindowHint
| QtCore.Qt.CustomizeWindowHint
| QtCore.Qt.NoDropShadowWindowHint
# | QtCore.Qt.X11BypassWindowManagerHint
)
self.theme.resize(width, height - 90)

Expand Down Expand Up @@ -186,6 +170,7 @@ def __init__(self, handler, width, height, parent=None):

# fifthrow
self.metrics = self.ui.metrics_chk
self.metrics.setVisible(bc(self.settings[util.SETTINGS_KEYS[4]]))
self.metrics.setToolTip(la.TT_SETTINGS[self.metrics.objectName()])
self.cleardata = self.ui.cleardata_btn
self.cleardata.setToolTip(la.TT_SETTINGS[self.cleardata.objectName()])
Expand Down Expand Up @@ -310,6 +295,7 @@ def window_cb(self, toggled):
self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s)
elif s.objectName() == "bugreport":
self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s)
self.bugreport.doweb()
elif s.objectName() == "theme":
self.mapposition(0, 0, s) if self.animatedsettings.isChecked() else self.mapposition(0, 0, s)
else:
Expand Down
Loading

0 comments on commit 3b55521

Please sign in to comment.