patch-src_devedeng_configuration_data_py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. $OpenBSD: patch-src_devedeng_configuration_data_py,v 1.3 2016/04/12 15:54:26 ajacoutot Exp $
  2. --- src/devedeng/configuration_data.py.orig Mon Mar 14 16:08:41 2016
  3. +++ src/devedeng/configuration_data.py Tue Apr 12 17:49:47 2016
  4. @@ -42,11 +42,8 @@ class configuration(GObject.GObject):
  5. def fill_config(self):
  6. self.cores = 0
  7. - proc_file = open("/proc/cpuinfo","r")
  8. - for line in proc_file:
  9. - if (line.startswith("processor")):
  10. - self.cores += 1
  11. - proc_file.close()
  12. + if (os.name == "posix"):
  13. + self.cores = os.cpu_count()
  14. is_local = None
  15. self.log = ""
  16. @@ -61,7 +58,7 @@ class configuration(GObject.GObject):
  17. if is_local is None:
  18. try:
  19. - os.stat("/usr/local/share/devedeng/wselect_disk.ui")
  20. + os.stat("${PREFIX}/share/devedeng/wselect_disk.ui")
  21. is_local = True
  22. except:
  23. pass
  24. @@ -71,12 +68,12 @@ class configuration(GObject.GObject):
  25. else:
  26. if (is_local):
  27. # locales must be always at /usr/share/locale because Gtk.Builder always search there
  28. - self.share_locale="/usr/share/locale"
  29. - self.glade="/usr/local/share/devedeng"
  30. - self.font_path="/usr/local/share/devedeng"
  31. - self.pic_path="/usr/local/share/devedeng"
  32. - self.other_path="/usr/local/share/devedeng"
  33. - self.help_path="/usr/local/share/doc/devedeng"
  34. + self.share_locale="${PREFIX}/share/locale"
  35. + self.glade="${PREFIX}/share/devedeng"
  36. + self.font_path="${PREFIX}/share/devedeng"
  37. + self.pic_path="${PREFIX}/share/devedeng"
  38. + self.other_path="${PREFIX}/share/devedeng"
  39. + self.help_path="${PREFIX}/share/doc/devedeng"
  40. else:
  41. self.share_locale="/usr/share/locale"
  42. self.glade="/usr/share/devedeng"