Kaydet (Commit) 954374dc authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

burya da baktim

üst f62dbb85
...@@ -15,11 +15,11 @@ from optparse import OptionParser ...@@ -15,11 +15,11 @@ from optparse import OptionParser
# first group in the groups list is the main group # first group in the groups list is the main group
user = {"uid": -1, user = {"uid": -1,
"username": "kaplan", "username": "Fox",
"realname": "Pisi", "realname": "Inari",
"home": "/home/pisi", "home": "/home/inari",
"shell": "/bin/bash", "shell": "/bin/bash",
"password": "pisi", "password": "inari",
"defaultgroup": "users", "defaultgroup": "users",
"groups": [], "groups": [],
"admingroups": ["wheel"], "admingroups": ["wheel"],
......
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Pardus boot and initialization system # Sulin boot and initialization system
# Copyright (C) 2017, Suleyman POYRAZ (AquilaNipalensis) # Copyright (C) 2017, Suleyman POYRAZ (AquilaNipalensis)
# #
# This program is free software; you can redistribute it and/or modify it # This program is free software; you can redistribute it and/or modify it
...@@ -29,7 +29,7 @@ from scomd_cgroupfs import Cgroupfs ...@@ -29,7 +29,7 @@ from scomd_cgroupfs import Cgroupfs
######## ########
__trans = gettext.translation('scomd', fallback=True) __trans = gettext.translation('scomd', fallback=True)
_ = __trans.ugettext _ = __trans.gettext
############## ##############
# Decorators # # Decorators #
...@@ -370,7 +370,7 @@ class Config: ...@@ -370,7 +370,7 @@ class Config:
# Fill in the options # Fill in the options
self.options["live"] = "thin" in options or \ 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")]: 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 self.options[k] = options[k] if options[k] else True
...@@ -492,13 +492,13 @@ class Ui: ...@@ -492,13 +492,13 @@ class Ui:
def greet(self): def greet(self):
"""Dump release information, sets unicode mode.""" """Dump release information, sets unicode mode."""
print(self.UNICODE_MAGIC) print(self.UNICODE_MAGIC)
if os.path.exists("/etc/pisilinux-release"): if os.path.exists("/etc/sulin-release"):
release = load_file("/etc/pisilinux-release").rstrip("\n") release = load_file("/etc/sulin-release").rstrip("\n")
print("\x1b[1m %s \x1b[0;36mhttp://www.pisilinux.org\x1b[0m" \ sys.stdout.write("\x1b[1m %s \x1b[0;36mhttp://www.sulin.org\x1b[0m" \
% release) % release)
else: else:
self.error(_("Cannot find /etc/pisilinux-release")) self.error(_("Cannot find /etc/sulin-release"))
print() sys.stdout.write("\n")
def info(self, msg): def info(self, msg):
"""Print the given message and log if debug enabled.""" """Print the given message and log if debug enabled."""
...@@ -601,7 +601,7 @@ def load_translations(): ...@@ -601,7 +601,7 @@ def load_translations():
global _ global _
lang = CONFIG.get("language") lang = CONFIG.get("language")
__trans = gettext.translation('scomd', languages=[lang], fallback=True) __trans = gettext.translation('scomd', languages=[lang], fallback=True)
_ = __trans.ugettext _ = __trans.gettext
def set_unicode_mode(): def set_unicode_mode():
"""Makes TTYs unicode compatible.""" """Makes TTYs unicode compatible."""
...@@ -751,8 +751,8 @@ def stop_services(): ...@@ -751,8 +751,8 @@ def stop_services():
def prune_needs_action_package_list(): def prune_needs_action_package_list():
"""Clears the lists to hold needsServiceRestart and needsReboot updates.""" """Clears the lists to hold needsServiceRestart and needsReboot updates."""
for _file in ("/var/lib/pisi/info/needsrestart", for _file in ("/var/lib/spam/info/needsrestart",
"/var/lib/pisi/info/needsreboot"): "/var/lib/spam/info/needsreboot"):
if os.path.exists(_file): if os.path.exists(_file):
os.unlink(_file) os.unlink(_file)
...@@ -920,7 +920,7 @@ def check_root_filesystem(): ...@@ -920,7 +920,7 @@ def check_root_filesystem():
UI.warn(_("Filesystem repaired, but reboot needed!")) UI.warn(_("Filesystem repaired, but reboot needed!"))
i = 0 i = 0
while i < 4: while i < 4:
print("\07") sys.stdout.write("\07")
time.sleep(1) time.sleep(1)
i += 1 i += 1
UI.warn(_("Rebooting in 10 seconds...")) UI.warn(_("Rebooting in 10 seconds..."))
...@@ -1308,13 +1308,12 @@ def stop_system(): ...@@ -1308,13 +1308,12 @@ def stop_system():
def except_hook(e_type, e_value, e_trace): def except_hook(e_type, e_value, e_trace):
"""Hook that intercepts and handles exceptions.""" """Hook that intercepts and handles exceptions."""
import traceback import traceback
print() sys.stdout.write("\n")
print(_("An internal error occured. Please report to the bugs.pisilinux.org" sys.stdout.write(_("An internal error occured. Please report to the bugs.pisilinux.org"
"with following information:").encode("utf-8")) "with following information:").encode("utf-8"))
print() sys.stdout.write(e_type); sys.stdout.write(e_value)
print(e_type, e_value)
traceback.print_tb(e_trace) traceback.print_tb(e_trace)
print() sys.stdout.write("\n")
run_full("/sbin/sulogin") run_full("/sbin/sulogin")
......
...@@ -23,13 +23,13 @@ import subprocess ...@@ -23,13 +23,13 @@ import subprocess
import gettext import gettext
__trans = gettext.translation('scomd', fallback=True) __trans = gettext.translation('scomd', fallback=True)
_ = __trans.ugettext _ = __trans.gettext
# Utilities # Utilities
def loadConfig(path): def loadConfig(path):
d = {} d = {}
for line in file(path): for line in open(path):
if line != "" and not line.startswith("#") and "=" in line: if line != "" and not line.startswith("#") and "=" in line:
key, value = line.split("=", 1) key, value = line.split("=", 1)
key = key.strip() key = key.strip()
......
...@@ -101,7 +101,7 @@ def generate_profile_env(envdict, format='export %s="%s"\n'): ...@@ -101,7 +101,7 @@ def generate_profile_env(envdict, format='export %s="%s"\n'):
return header + header_note + profile return header + header_note + profile
def update_file(path, content): def update_file(path, content):
f = file(path, "w") f = open(path, "w")
f.write(content) f.write(content)
f.close() f.close()
......
...@@ -31,7 +31,7 @@ default_mount_dir = "/mnt" ...@@ -31,7 +31,7 @@ default_mount_dir = "/mnt"
excluded_file_systems = ("proc", "tmpfs", "sysfs", "linux-swap", "swap", "nfs", "nfs4", "cifs") 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 # Utility functions
...@@ -160,7 +160,7 @@ class Fstab: ...@@ -160,7 +160,7 @@ class Fstab:
if entry.mount_point != "none" and not os.path.exists(entry.mount_point): if entry.mount_point != "none" and not os.path.exists(entry.mount_point):
os.makedirs(entry.mount_point) os.makedirs(entry.mount_point)
f = file(path, "w") f = open(path, "w")
f.write(self.comment) f.write(self.comment)
f.write(str(self)) f.write(str(self))
f.write("\n") f.write("\n")
......
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