bug_report_url.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # ##### BEGIN GPL LICENSE BLOCK #####
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License
  5. # as published by the Free Software Foundation; either version 2
  6. # of the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software Foundation,
  15. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. #
  17. # ##### END GPL LICENSE BLOCK #####
  18. # <pep8-80 compliant>
  19. def url_prefill_from_blender():
  20. import bpy
  21. import bgl
  22. import struct
  23. import platform
  24. import urllib.parse
  25. import io
  26. fh = io.StringIO()
  27. fh.write("**System Information**\n")
  28. fh.write(
  29. "Operating system: {!s} {!s} Bits\n".format(
  30. platform.platform(),
  31. struct.calcsize("P") * 8,
  32. )
  33. )
  34. fh.write(
  35. "Graphics card: {!s} {!s} {!s}\n".format(
  36. bgl.glGetString(bgl.GL_RENDERER),
  37. bgl.glGetString(bgl.GL_VENDOR),
  38. bgl.glGetString(bgl.GL_VERSION),
  39. )
  40. )
  41. fh.write(
  42. "\n"
  43. "\n**Blender Version**\n"
  44. )
  45. fh.write(
  46. "Broken: version: {!s}, branch: {!s}, commit date: {!s} {!s}, hash: `rB{!s}`\n".format(
  47. bpy.app.version_string,
  48. bpy.app.build_branch.decode('utf-8', 'replace'),
  49. bpy.app.build_commit_date.decode('utf-8', 'replace'),
  50. bpy.app.build_commit_time.decode('utf-8', 'replace'),
  51. bpy.app.build_hash.decode('ascii'),
  52. )
  53. )
  54. fh.write(
  55. "Worked: (optional)\n"
  56. "\n"
  57. "\n"
  58. "**Short description of error**\n"
  59. "[Please fill out a short description of the error here]\n"
  60. "\n"
  61. "**Exact steps for others to reproduce the error**\n"
  62. "[Please describe the exact steps needed to reproduce the issue]\n"
  63. "[Based on the default startup or an attached .blend file (as simple as possible)]\n"
  64. "\n"
  65. )
  66. fh.seek(0)
  67. return (
  68. "https://developer.blender.org/maniphest/task/edit/form/1?description=" +
  69. urllib.parse.quote(fh.read())
  70. )