本文整理汇总了Python中yali4.sysutils.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: commit
def commit(self):
import yali4.gui.context as ctx
attempt = 1
maxTries = 5
keepTrying = True
while keepTrying and (attempt <= maxTries):
try:
self._disk.commit()
keepTrying = False
sysutils.run("sync")
except Exception, msg:
attempt += 1
开发者ID:Tayyib,项目名称:uludag,代码行数:14,代码来源:storage.py
示例2: format
def format(self, partition):
self.preFormat(partition)
cmd_path = requires("mkfs.vfat")
cmd = "%s %s" %(cmd_path,partition.getPath())
res = sysutils.run(cmd)
if not res:
raise YaliException, "vfat format failed: %s" % partition.getPath()
开发者ID:Tayyib,项目名称:uludag,代码行数:7,代码来源:filesystem.py
示例3: setLabel
def setLabel(self, partition, label):
label = self.availableLabel(label)
cmd_path = requires("dosfslabel")
cmd = "%s %s %s" % (cmd_path, partition.getPath(), label)
if not sysutils.run(cmd):
return False
return label
开发者ID:Tayyib,项目名称:uludag,代码行数:7,代码来源:filesystem.py
示例4: tune2fs
def tune2fs(self, partition):
""" Runs tune2fs for given partition """
cmd_path = requires("tune2fs")
# Disable mount count and use 6 month interval to fsck'ing disks at boot
cmd = "%s -c 0 -i 6m %s" % (cmd_path, partition.getPath())
res = sysutils.run(cmd)
if not res:
raise YaliException, "tune2fs tuning failed: %s" % partition.getPath()
开发者ID:Tayyib,项目名称:uludag,代码行数:8,代码来源:filesystem.py
示例5: getLabel
def getLabel(self, partition):
""" Read file system label and return """
cmd_path = requires("e2label")
cmd = "%s %s" % (cmd_path, partition.getPath())
label = sysutils.run(cmd, capture=True)
if not label:
return False
return label.strip()
开发者ID:Tayyib,项目名称:uludag,代码行数:8,代码来源:filesystem.py
示例6: execute
def execute(self):
ctx.mainScreen.disableNext()
ctx.debugger.log("Show reboot dialog.")
InfoDialog(_("Press <b>Reboot</b> button to restart your system."), _("Reboot"))
ctx.yali.info.updateAndShow(_('<b>Rebooting system. Please wait!</b>'))
# remove cd...
if not ctx.yali.install_type == YALI_FIRSTBOOT:
ctx.debugger.log("Trying to eject the CD.")
sysutils.ejectCdrom()
ctx.debugger.log("Yali, reboot calling..")
ctx.mainScreen.processEvents()
sysutils.run("sync")
time.sleep(4)
sysutils.reboot()
开发者ID:Tayyib,项目名称:uludag,代码行数:19,代码来源:ScrRescueFinish.py
示例7: resize
def resize(self, size_mb, partition):
minsize = self.minResizeMB(partition)
if size_mb < minsize:
size_mb = minsize
if not self.preResize(partition):
raise FSCheckError, _("Partition is not ready for resizing. Check it before installation.")
cmd_path = requires("btrfsctl")
cmd = "%s -r %dm -A %s" % (cmd_path, size_mb, partition.getPath())
if not sysutils.run(cmd):
raise FSError, "Resize failed on %s " % (partition.getPath())
return True
开发者ID:Tayyib,项目名称:uludag,代码行数:14,代码来源:filesystem.py
示例8: resize
def resize(self, size_mb, partition):
minsize = self.minResizeMB(partition)
if size_mb < minsize:
size_mb = minsize
if not self.resizeSilent(size_mb, partition) or not self.preResize(partition):
raise FSCheckError, _("The filesystem of '%s' partition is NTFS, and this partition \nwas not closed properly.Please restart your system and close \nthis partition properly!After this operation, start Pardus \ninstallation again!") % partition.getPath()
cmd_path = requires("ntfsresize")
cmd = "%s -P -ff -s %dM %s" % (cmd_path, size_mb, partition.getPath())
if not sysutils.run(cmd):
raise FSError, _("Resize failed on %s " % partition.getPath())
return True
开发者ID:Tayyib,项目名称:uludag,代码行数:15,代码来源:filesystem.py
示例9: setOrderedDiskList
def setOrderedDiskList():
devices = detectAll()
devices.sort()
import yali4.gui.context as ctx
# Check EDD Module
if not os.path.exists("/sys/firmware/edd"):
cmd_path = sysutils.find_executable("modprobe")
cmd = "%s %s" % (cmd_path, "edd")
res = sysutils.run(cmd)
if not res:
ctx.installData.orderedDiskList = devices
ctx.debugger.log("ERROR : Inserting EDD Module failed !")
return
edd = EDD()
sortedList = []
edd_list = edd.list_edd_signatures()
mbr_list = edd.list_mbr_signatures()
edd_keys = edd_list.keys()
edd_keys.sort()
for bios_num in edd_keys:
edd_sig = edd_list[bios_num]
if mbr_list.has_key(edd_sig):
sortedList.append(mbr_list[edd_sig])
if len(devices) > 1:
a = ctx.installData.orderedDiskList = sortedList
b = devices
# check consistency of diskList
if not len(filter(None, map(lambda x: x in a,b))) == len(b):
ctx.installData.orderedDiskList = devices
ctx.isEddFailed = True
else:
ctx.installData.orderedDiskList = devices
开发者ID:Tayyib,项目名称:uludag,代码行数:36,代码来源:storage.py
示例10: _lvmclear
def _lvmclear(args):
try:
return sysutils.run("lvm",args)
except Exception:
#FIXME:log.error
raise LVMError, args[0]
开发者ID:Tayyib,项目名称:uludag,代码行数:6,代码来源:lvmutils.py
示例11: preResize
def preResize(self, partition):
""" Routine operations before resizing """
cmd_path = requires("ntfsresize")
cmd = "%s -c %s" % (cmd_path, partition.getPath())
return sysutils.run(cmd)
开发者ID:Tayyib,项目名称:uludag,代码行数:5,代码来源:filesystem.py
示例12: resizeSilent
def resizeSilent(self, size_mb, partition):
# don't do anything, just check
cmd_path = requires("ntfsresize")
cmd = "%s -n -ff -s %dM %s" % (cmd_path, size_mb, partition.getPath())
return sysutils.run(cmd)
开发者ID:Tayyib,项目名称:uludag,代码行数:5,代码来源:filesystem.py
示例13: _lvmcapture
def _lvmcapture(args):
try:
return sysutils.run("lvm", args, capture=True)
except RuntimeError, (errno, msg):
#FIXME:log.error
raise LVMError, msg
开发者ID:Tayyib,项目名称:uludag,代码行数:6,代码来源:lvmutils.py
注:本文中的yali4.sysutils.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论