MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / createSupportMessage

Function createSupportMessage

src/bitmessageqt/support.py:78–140  ·  view source on GitHub ↗
(myapp)

Source from the content-addressed store, hash-verified

76 return checkHasNormalAddress()
77
78def createSupportMessage(myapp):
79 checkAddressBook(myapp)
80 address = createAddressIfNeeded(myapp)
81 if state.shutdown:
82 return
83
84 myapp.ui.lineEditSubject.setText(str(QtGui.QApplication.translate("Support", SUPPORT_SUBJECT)))
85 addrIndex = myapp.ui.comboBoxSendFrom.findData(address, QtCore.Qt.UserRole, QtCore.Qt.MatchFixedString | QtCore.Qt.MatchCaseSensitive)
86 if addrIndex == -1: # something is very wrong
87 return
88 myapp.ui.comboBoxSendFrom.setCurrentIndex(addrIndex)
89 myapp.ui.lineEditTo.setText(SUPPORT_ADDRESS)
90
91 version = softwareVersion
92 commit = paths.lastCommit().get('commit')
93 if commit:
94 version += " GIT " + commit
95
96 os = sys.platform
97 if os == "win32":
98 windowsversion = sys.getwindowsversion()
99 os = "Windows " + str(windowsversion[0]) + "." + str(windowsversion[1])
100 else:
101 try:
102 from os import uname
103 unixversion = uname()
104 os = unixversion[0] + " " + unixversion[2]
105 except:
106 pass
107 architecture = "32" if ctypes.sizeof(ctypes.c_voidp) == 4 else "64"
108 pythonversion = sys.version
109
110 opensslversion = "%s (Python internal), %s (external for PyElliptic)" % (ssl.OPENSSL_VERSION, OpenSSL._version)
111
112 frozen = "N/A"
113 if paths.frozen:
114 frozen = paths.frozen
115 portablemode = "True" if state.appdata == paths.lookupExeFolder() else "False"
116 cpow = "True" if proofofwork.bmpow else "False"
117 #cpow = QtGui.QApplication.translate("Support", cpow)
118 openclpow = str(BMConfigParser().safeGet('bitmessagesettings', 'opencl')) if openclEnabled() else "None"
119 #openclpow = QtGui.QApplication.translate("Support", openclpow)
120 locale = getTranslationLanguage()
121 try:
122 socks = BMConfigParser().get('bitmessagesettings', 'socksproxytype')
123 except:
124 socks = "N/A"
125 try:
126 upnp = BMConfigParser().get('bitmessagesettings', 'upnp')
127 except:
128 upnp = "N/A"
129 connectedhosts = len(network.stats.connectedHostsList())
130
131 myapp.ui.textEditMessage.setText(str(QtGui.QApplication.translate("Support", SUPPORT_MESSAGE)).format(version, os, architecture, pythonversion, opensslversion, frozen, portablemode, cpow, openclpow, locale, socks, upnp, connectedhosts))
132
133 # single msg tab
134 myapp.ui.tabWidgetSend.setCurrentIndex(
135 myapp.ui.tabWidgetSend.indexOf(myapp.ui.sendDirect)

Callers

nothing calls this directly

Calls 7

BMConfigParserClass · 0.90
openclEnabledFunction · 0.90
getTranslationLanguageFunction · 0.90
checkAddressBookFunction · 0.85
createAddressIfNeededFunction · 0.85
safeGetMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected