[PATCH] Remove some unused isys methods.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 isys/isys.c  |   82 ----------------------------------------------------------
 isys/isys.py |   60 ------------------------------------------
 2 files changed, 0 insertions(+), 142 deletions(-)

diff --git a/isys/isys.c b/isys/isys.c
index fc4b817..8f8a22c 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -95,13 +95,11 @@ static PyObject * doSwapoff(PyObject * s, PyObject * args);
 static PyObject * doLoSetup(PyObject * s, PyObject * args);
 static PyObject * doUnLoSetup(PyObject * s, PyObject * args);
 static PyObject * doLoChangeFd(PyObject * s, PyObject * args);
-static PyObject * doDdFile(PyObject * s, PyObject * args);
 static PyObject * doWipeRaidSuperblock(PyObject * s, PyObject * args);
 static PyObject * doGetRaidChunkSize(PyObject * s, PyObject * args);
 static PyObject * doDevSpaceFree(PyObject * s, PyObject * args);
 static PyObject * doResetResolv(PyObject * s, PyObject * args);
 static PyObject * doLoadKeymap(PyObject * s, PyObject * args);
-static PyObject * doClobberExt2 (PyObject * s, PyObject * args);
 static PyObject * doExt2Dirty(PyObject * s, PyObject * args);
 static PyObject * doExt2HasJournal(PyObject * s, PyObject * args);
 static PyObject * doEjectCdrom(PyObject * s, PyObject * args);
@@ -110,7 +108,6 @@ static PyObject * doisPseudoTTY(PyObject * s, PyObject * args);
 static PyObject * doisVioConsole(PyObject * s);
 static PyObject * doSync(PyObject * s, PyObject * args);
 static PyObject * doisIsoImage(PyObject * s, PyObject * args);
-static PyObject * getFramebufferInfo(PyObject * s, PyObject * args);
 static PyObject * printObject(PyObject * s, PyObject * args);
 static PyObject * py_bind_textdomain_codeset(PyObject * o, PyObject * args);
 static PyObject * py_getDasdPorts(PyObject * s, PyObject * args);
@@ -134,14 +131,12 @@ static PyMethodDef isysModuleMethods[] = {
     { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL },
     { "e2dirty", (PyCFunction) doExt2Dirty, METH_VARARGS, NULL },
     { "e2hasjournal", (PyCFunction) doExt2HasJournal, METH_VARARGS, NULL },
-    { "e2fsclobber", (PyCFunction) doClobberExt2, METH_VARARGS, NULL },
     { "devSpaceFree", (PyCFunction) doDevSpaceFree, METH_VARARGS, NULL },
     { "wiperaidsb", (PyCFunction) doWipeRaidSuperblock, METH_VARARGS, NULL },
     { "getraidchunk", (PyCFunction) doGetRaidChunkSize, METH_VARARGS, NULL },
     { "lochangefd", (PyCFunction) doLoChangeFd, METH_VARARGS, NULL },
     { "losetup", (PyCFunction) doLoSetup, METH_VARARGS, NULL },
     { "unlosetup", (PyCFunction) doUnLoSetup, METH_VARARGS, NULL },
-    { "ddfile", (PyCFunction) doDdFile, METH_VARARGS, NULL },
     { "mount", (PyCFunction) doMount, METH_VARARGS, NULL },
     { "smpavailable", (PyCFunction) smpAvailable, METH_VARARGS, NULL },
     { "htavailable", (PyCFunction) htAvailable, METH_VARARGS, NULL },
@@ -155,7 +150,6 @@ static PyMethodDef isysModuleMethods[] = {
     { "isVioConsole", (PyCFunction) doisVioConsole, METH_NOARGS, NULL},
     { "sync", (PyCFunction) doSync, METH_VARARGS, NULL},
     { "isisoimage", (PyCFunction) doisIsoImage, METH_VARARGS, NULL},
-    { "fbinfo", (PyCFunction) getFramebufferInfo, METH_VARARGS, NULL},
     { "printObject", (PyCFunction) printObject, METH_VARARGS, NULL},
     { "bind_textdomain_codeset", (PyCFunction) py_bind_textdomain_codeset, METH_VARARGS, NULL},
     { "getDasdPorts", (PyCFunction) py_getDasdPorts, METH_VARARGS, NULL},
@@ -177,33 +171,6 @@ static PyMethodDef isysModuleMethods[] = {
     { NULL, NULL, 0, NULL }
 } ;
 
-static PyObject * doDdFile(PyObject * s, PyObject * args) {
-    int fd;
-    int megs;
-    char * ptr;
-    int i;
-
-    if (!PyArg_ParseTuple(args, "ii", &fd, &megs)) return NULL;
-
-    ptr = calloc(1024 * 256, 1);
-
-    while (megs--) {
-	for (i = 0; i < 4; i++) {
-	    if (write(fd, ptr, 1024 * 256) != 1024 * 256) {
-		PyErr_SetFromErrno(PyExc_SystemError);
-		free(ptr);
-		return NULL;
-	    }
-	    sync();
-	}
-    }
-
-    free(ptr);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
 static PyObject * doUnLoSetup(PyObject * s, PyObject * args) {
     int loopfd;
 
@@ -528,34 +495,6 @@ static PyObject * doLoadKeymap (PyObject * s, PyObject * args) {
     return Py_None;
 }
 
-static PyObject * doClobberExt2 (PyObject * s, PyObject * args) {
-    char * device;
-    ext2_filsys fsys;
-    struct ext2_super_block sb;
-    int rc;
-
-    if (!PyArg_ParseTuple(args, "s", &device)) return NULL;
-
-    rc = ext2fs_open(device, EXT2_FLAG_FORCE, 0, 0, unix_io_manager, &fsys);
-
-    if (rc) {
-	Py_INCREF(Py_None);
-	return Py_None;
-    }
-
-    memset(&sb, 0, sizeof(struct ext2_super_block));
-    rc = ext2fs_initialize (device, 0, &sb, unix_io_manager, &fsys);
-    if (rc) {
-	Py_INCREF(Py_None);
-	return Py_None;
-    }
-
-    ext2fs_close(fsys);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
 static PyObject * doExt2Dirty(PyObject * s, PyObject * args) {
     char * device;
     ext2_filsys fsys;
@@ -664,27 +603,6 @@ static PyObject * doisIsoImage(PyObject * s, PyObject * args) {
     return Py_BuildValue("i", rc);
 }
 
-static PyObject * getFramebufferInfo(PyObject * s, PyObject * args) {
-    int fd;
-    struct fb_var_screeninfo fb;
-
-    fd = open("/dev/fb0", O_RDONLY);
-    if (fd == -1) {
-	Py_INCREF(Py_None);
-	return Py_None;
-    }
-
-    if (ioctl(fd, FBIOGET_VSCREENINFO, &fb)) {
-	close(fd);
-	PyErr_SetFromErrno(PyExc_SystemError);
-	return NULL;
-    }
-
-    close(fd);
-
-    return Py_BuildValue("(iii)", fb.xres, fb.yres, fb.bits_per_pixel);
-}
-
 #ifdef USESELINUX
 static PyObject * doMatchPathContext(PyObject * s, PyObject * args) {
     char *fn, *buf = NULL;
diff --git a/isys/isys.py b/isys/isys.py
index 721aca0..ebc27a7 100755
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -107,27 +107,6 @@ def unlosetup(device):
     finally:
         os.close(loop)
 
-def ddfile(file, megs, pw = None):
-    buf = '\x00' * (1024 * 256)
-
-    fd = os.open(file, os.O_RDWR | os.O_CREAT)
-
-    total = megs * 4	    # we write out 1/4 of a meg each time through
-
-    if pw:
-	(fn, title, text) = pw
-	win = fn(title, text, total - 1)
-
-    for n in range(total):
-	os.write(fd, buf)
-	if pw:
-	    win.set(n)
-
-    if pw:
-	win.pop()
-
-    os.close(fd)
-
 ## Mount a filesystem, similar to the mount system call.
 # @param device The device to mount.  If bindMount is True, this should be an
 #               already mounted directory.  Otherwise, it should be a device
@@ -279,25 +258,6 @@ def getDasdState(dev):
 
     return 0
 
-## Calculate the broadcast address of a network.
-# @param ip An IPv4 address as a string.
-# @param nm A corresponding netmask as a string.
-# @return A tuple of network address and broadcast address strings.
-def inet_calcNetBroad (ip, nm):
-    (ipaddr,) = struct.unpack('I', socket.inet_pton(socket.AF_INET, ip))
-    ipaddr = socket.ntohl(ipaddr)
-
-    (nmaddr,) = struct.unpack('I', socket.inet_pton(socket.AF_INET, nm))
-    nmaddr = socket.ntohl(nmaddr)
-
-    netaddr = ipaddr & nmaddr
-    bcaddr = netaddr | (~nmaddr)
-
-    nw = socket.inet_ntop(socket.AF_INET, struct.pack('!I', netaddr))
-    bc = socket.inet_ntop(socket.AF_INET, struct.pack('!I', bcaddr))
-
-    return (nw, bc)
-
 def doProbeBiosDisks():
     if not iutil.isX86():
         return None
@@ -377,20 +337,6 @@ def compareDrives(first, second):
 
     return 0
 
-def compareNetDevices(first, second):
-    try:
-        trimmed_first = float(first.lstrip(string.letters))
-        trimmed_second = float(second.lstrip(string.letters))
-    except:
-        return 0
-
-    if trimmed_first < trimmed_second:
-        return -1
-    elif trimmed_first > trimmed_second:
-        return 1
-    else:
-        return 0
-
 def resetResolv():
     return _isys.resetresolv()
 
@@ -439,9 +385,6 @@ def readFSType(device):
         return "physical volume (LVM)"
     return fstype
 
-def ext2Clobber(device):
-    _isys.e2fsclobber(device)
-
 def ext2IsDirty(device):
     label = _isys.e2dirty(device)
     return label
@@ -496,9 +439,6 @@ def sync ():
 def isIsoImage(file):
     return _isys.isisoimage(file)
 
-def fbinfo():
-    return _isys.fbinfo()
-
 # Return number of network devices
 def getNetworkDeviceCount():
     bus = dbus.SystemBus()
-- 
1.6.4.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux