Merge branch 'master' of https://gitlab.com/rastersoft/devedeng
This commit is contained in:
commit
4c84939ef9
1 changed files with 6 additions and 6 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
import platform
|
||||||
|
|
||||||
|
|
||||||
class configuration(GObject.GObject):
|
class configuration(GObject.GObject):
|
||||||
|
|
@ -49,12 +50,11 @@ class configuration(GObject.GObject):
|
||||||
return config_folder
|
return config_folder
|
||||||
|
|
||||||
def _fill_config(self):
|
def _fill_config(self):
|
||||||
self.cores = 0
|
self.cores = os.cpu_count()
|
||||||
proc_file = open("/proc/cpuinfo", "r")
|
if 'sched_getaffinity' in dir(os):
|
||||||
for line in proc_file:
|
self.cores = len(os.sched_getaffinity(0))
|
||||||
if (line.startswith("processor")):
|
if platform.system() == 'FreeBSD':
|
||||||
self.cores += 1
|
self.cores = int(os.popen("sysctl -n kern.smp.cores").read().split('\n')[0])
|
||||||
proc_file.close()
|
|
||||||
|
|
||||||
is_local = None
|
is_local = None
|
||||||
self.log = ""
|
self.log = ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue