Пример #1
0
def ls(path, options):
    if options == "":
        if files.isdir(path):
            if permissions.check(files.output(path), "r",
                                 files.readall("/proc/info/su")):
                list = files.list(path)
                list.sort()
                for i in list:
                    if files.isdir(path + "/" + i):
                        print(colors.get_path() + i + "/" +
                              colors.get_colors())
                    else:
                        print(i)
            else:
                colors.show("ls", "perm", "")
        else:
            colors.show("ls", "fail", path + ": directory not found.")
    elif options == "-p":
        if files.isdir(path):
            if permissions.check(files.output(path), "r",
                                 files.readall("/proc/info/su")):
                list = files.list(path)
                list.sort()
                for i in list:
                    if files.isdir(path + "/" + i):
                        perm = permissions.get_permissions(path + "/" + i)
                        print(perm + "\t" + colors.get_path() + i + "/" +
                              colors.get_colors())
                    else:
                        perm = permissions.get_permissions(path + "/" + i)
                        print(perm + "\t" + i)
            else:
                colors.show("ls", "perm", "")
        else:
            colors.show("ls", "fail", path + ": directory not found.")
    elif options == "-n":
        if files.isdir(path):
            if permissions.check(files.output(path), "r",
                                 files.readall("/proc/info/su")):
                list = files.list(path)
                list.sort()
                for i in list:
                    if files.isdir(path + "/" + i):
                        perm = permissions.get_permissions(path + "/" + i)
                        perm = str(permissions.show_number(perm))
                        print(perm + "\t" + colors.get_path() + i + "/" +
                              colors.get_colors())
                    else:
                        perm = permissions.get_permissions(path + "/" + i)
                        perm = str(permissions.show_number(perm))
                        print(perm + "\t" + i)
            else:
                colors.show("ls", "perm", "")
        else:
            colors.show("ls", "fail", path + ": directory not found.")
Пример #2
0
def endall():
    if files.isfile("/proc/info/sp"): files.remove("/proc/info/sp")
    list = files.list("/proc")
    list.remove("id")
    list.remove("info")
    for i in list:
        files.remove("/proc/" + str(i))
Пример #3
0
def list(name):
    su = files.readall("/proc/info/su")
    if permissions.check(files.output(name), "r", su):
        return files.list(name)
    else:
        colors.show("libabr.file.list", "perm", "")
        return []
Пример #4
0
def endall():
    files.remove('/proc/id/desktop')
    colors.show('desktop','ok-endid','')
    colors.show('kernel',"poweroff","")
    listid = files.list ("/proc/id")
    for i in listid:
        if files.isfile('/proc/id/'+i):
            files.remove('/proc/id/'+i)
Пример #5
0
def getv():
    select = files.readall("/proc/info/sel")
    if not select.startswith("/proc/"):
        if permissions.check(files.output(select), "w",
                             files.readall("/proc/info/su")):
            listinfo = files.list("/proc/info")
            for i in listinfo:
                control.write_record(i, files.readall("/proc/info/" + i),
                                     select)
        else:
            colors.show("getv", "perm", "")
    else:
        listinfo = files.list("/proc/info")
        for i in listinfo:
            control.write_record(i, files.readall("/proc/info/" + i), select)
    colors.show('', 'ok',
                'Insert informations into \'' + select + "\' controller.")
Пример #6
0
def processor():
    j = 0
    if not files.isfile("/proc/" + str(0)):
        files.create("/proc/" + str(0))
        j = j + 1
    else:
        list = files.list("/proc")
        list.remove('id')
        list.remove('info')

        for i in list:
            if files.isfile("/proc/" + i):

                files.create("/proc/" + str(int(i) + 1))
                j = j + 1
            else:
                files.create("/proc/" + i)

    if files.isfile("/proc/1"):
        files.write("/proc/info/sp", str(j))
        return j
    else:
        files.write("/proc/info/sp", str(j - 1))
        return j - 1