Kaydet (Commit) eb57aaea authored tarafından Ali Rıza KESKİN's avatar Ali Rıza KESKİN

translation merge and microcode detection

üst 8e32419b
......@@ -5,6 +5,16 @@ clean:
`find | grep pycache | sed 's/^/rm -rf /g'`
rm -rf build
rm -f po/*.mo
pot:
xgettext --language=Python --keyword=_ --output=inary.pot \
`find inary -type f -iname "*.py"` inary-cli
for file in `ls po/*.po`; do \
msgmerge $$file inary.pot -o $$file.new ; \
rm -f $$file ; \
mv $$file.new $$file ; \
done \
build:
python3 setup.py build
install:
......
......@@ -94,7 +94,7 @@ def handle_exception(exception, value, tb):
def blc_wsl():
"""Dont allow fucking WSL"""
f = str(os.uname()).lower()
if (("microsoft" in f) or ("wsl" in f)):
if (("microsoft" in f) or ("wsl" in f) or inary.util.get_cpuinfo("microcode") == "0xffffffff"):
ui.error(_("Using inary in WSL environment is not allowed."))
exit(1)
......
......@@ -29,7 +29,7 @@ from inary.util.process import *
# Inary Modules
from inary.util.strings import *
from inary.util.terminal import *
from inary.util.terminal import *
from inary.util.cpuinfo import *
# Gettext Library
import gettext
......
import os
def get_cpuinfo(section=""):
if os.path.exists("/proc/cpuinfo"):
cpuinfo = open("/proc/cpuinfo","r").read()
for line in cpuinfo.split("\n"):
if section in line:
return line.split(":")[1].strip()
return ""
cpupath="/sys/devices/system/cpu/cpu"
def get_cpu_governor(core=0):
if os.path.exists(cpupath+str(core)+"/cpufreq/scaling_governor"):
return open(cpupath+str(core)+"/cpufreq/scaling_governor","r").read().strip()
else:
return ""
def change_cpu_governor(core,governor):
if os.path.exists(cpupath+str(core)+"/cpufreq/scaling_governor"):
open(cpupath+str(core)+"/cpufreq/scaling_governor","w").write(governor)
else:
return
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment