From 954374dcc2e93e13e140c077081a084bf730d115 Mon Sep 17 00:00:00 2001 From: Suleyman Poyraz Date: Tue, 26 Sep 2017 04:57:42 +0000 Subject: [PATCH] burya da baktim --- scomd/bin/adduser.py | 8 ++++---- scomd/bin/scomd.py | 33 ++++++++++++++++----------------- scomd/bin/service.py | 4 ++-- scomd/bin/update-environment.py | 2 +- scomd/bin/update-fstab.py | 4 ++-- 5 files changed, 25 insertions(+), 26 deletions(-) diff --git a/scomd/bin/adduser.py b/scomd/bin/adduser.py index 8d701fa..df63f33 100644 --- a/scomd/bin/adduser.py +++ b/scomd/bin/adduser.py @@ -15,11 +15,11 @@ from optparse import OptionParser # first group in the groups list is the main group user = {"uid": -1, - "username": "kaplan", - "realname": "Pisi", - "home": "/home/pisi", + "username": "Fox", + "realname": "Inari", + "home": "/home/inari", "shell": "/bin/bash", - "password": "pisi", + "password": "inari", "defaultgroup": "users", "groups": [], "admingroups": ["wheel"], diff --git a/scomd/bin/scomd.py b/scomd/bin/scomd.py index a0e89b7..f06f2fb 100644 --- a/scomd/bin/scomd.py +++ b/scomd/bin/scomd.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Pardus boot and initialization system +# Sulin boot and initialization system # Copyright (C) 2017, Suleyman POYRAZ (AquilaNipalensis) # # This program is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ from scomd_cgroupfs import Cgroupfs ######## __trans = gettext.translation('scomd', fallback=True) -_ = __trans.ugettext +_ = __trans.gettext ############## # Decorators # @@ -370,7 +370,7 @@ class Config: # Fill in the options self.options["live"] = "thin" in options or \ - os.path.exists("/run/pisilinux/livemedia") + os.path.exists("/run/sulin/livemedia") for k in [_k for _k in list(options.keys()) if _k not in ("thin")]: self.options[k] = options[k] if options[k] else True @@ -492,13 +492,13 @@ class Ui: def greet(self): """Dump release information, sets unicode mode.""" print(self.UNICODE_MAGIC) - if os.path.exists("/etc/pisilinux-release"): - release = load_file("/etc/pisilinux-release").rstrip("\n") - print("\x1b[1m %s \x1b[0;36mhttp://www.pisilinux.org\x1b[0m" \ + if os.path.exists("/etc/sulin-release"): + release = load_file("/etc/sulin-release").rstrip("\n") + sys.stdout.write("\x1b[1m %s \x1b[0;36mhttp://www.sulin.org\x1b[0m" \ % release) else: - self.error(_("Cannot find /etc/pisilinux-release")) - print() + self.error(_("Cannot find /etc/sulin-release")) + sys.stdout.write("\n") def info(self, msg): """Print the given message and log if debug enabled.""" @@ -601,7 +601,7 @@ def load_translations(): global _ lang = CONFIG.get("language") __trans = gettext.translation('scomd', languages=[lang], fallback=True) - _ = __trans.ugettext + _ = __trans.gettext def set_unicode_mode(): """Makes TTYs unicode compatible.""" @@ -751,8 +751,8 @@ def stop_services(): def prune_needs_action_package_list(): """Clears the lists to hold needsServiceRestart and needsReboot updates.""" - for _file in ("/var/lib/pisi/info/needsrestart", - "/var/lib/pisi/info/needsreboot"): + for _file in ("/var/lib/spam/info/needsrestart", + "/var/lib/spam/info/needsreboot"): if os.path.exists(_file): os.unlink(_file) @@ -920,7 +920,7 @@ def check_root_filesystem(): UI.warn(_("Filesystem repaired, but reboot needed!")) i = 0 while i < 4: - print("\07") + sys.stdout.write("\07") time.sleep(1) i += 1 UI.warn(_("Rebooting in 10 seconds...")) @@ -1308,13 +1308,12 @@ def stop_system(): def except_hook(e_type, e_value, e_trace): """Hook that intercepts and handles exceptions.""" import traceback - print() - print(_("An internal error occured. Please report to the bugs.pisilinux.org" + sys.stdout.write("\n") + sys.stdout.write(_("An internal error occured. Please report to the bugs.pisilinux.org" "with following information:").encode("utf-8")) - print() - print(e_type, e_value) + sys.stdout.write(e_type); sys.stdout.write(e_value) traceback.print_tb(e_trace) - print() + sys.stdout.write("\n") run_full("/sbin/sulogin") diff --git a/scomd/bin/service.py b/scomd/bin/service.py index f070da4..845f8c1 100644 --- a/scomd/bin/service.py +++ b/scomd/bin/service.py @@ -23,13 +23,13 @@ import subprocess import gettext __trans = gettext.translation('scomd', fallback=True) -_ = __trans.ugettext +_ = __trans.gettext # Utilities def loadConfig(path): d = {} - for line in file(path): + for line in open(path): if line != "" and not line.startswith("#") and "=" in line: key, value = line.split("=", 1) key = key.strip() diff --git a/scomd/bin/update-environment.py b/scomd/bin/update-environment.py index dd75c51..cb5cdc0 100644 --- a/scomd/bin/update-environment.py +++ b/scomd/bin/update-environment.py @@ -101,7 +101,7 @@ def generate_profile_env(envdict, format='export %s="%s"\n'): return header + header_note + profile def update_file(path, content): - f = file(path, "w") + f = open(path, "w") f.write(content) f.close() diff --git a/scomd/bin/update-fstab.py b/scomd/bin/update-fstab.py index 629fe8e..63fa0de 100644 --- a/scomd/bin/update-fstab.py +++ b/scomd/bin/update-fstab.py @@ -31,7 +31,7 @@ default_mount_dir = "/mnt" excluded_file_systems = ("proc", "tmpfs", "sysfs", "linux-swap", "swap", "nfs", "nfs4", "cifs") -sulin_labels = ("PARDUS_ROOT", "PARDUS_HOME", "PARDUS_SWAP") +sulin_labels = ("SULIN_ROOT", "SULIN_HOME", "SULIN_SWAP") # Utility functions @@ -160,7 +160,7 @@ class Fstab: if entry.mount_point != "none" and not os.path.exists(entry.mount_point): os.makedirs(entry.mount_point) - f = file(path, "w") + f = open(path, "w") f.write(self.comment) f.write(str(self)) f.write("\n") -- 2.18.1