develop
asamoukin 16 years ago
parent 7d6b40fa75
commit 60613a1ed5

@ -1601,6 +1601,7 @@ class _file(_error):
fout, fin = popen2.popen2("file %s"%(nameFile))
fin.close()
textLine = fout.readline()
fout.readlines()
fout.close()
if textLine:
listTextLine = textLine.split(":")

@ -1,13 +1,13 @@
#-*- coding: utf-8 -*-
#Copyright 2008 Calculate Pack, http://www.calculate-linux.ru
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -76,7 +76,7 @@ def prettyColumnStr(*cols):
partstr = cols[q][:cols[q+1]]
# искать перевод строки с полученной части
brfind = wherenr.search(partstr)
# если перевод строки найден, то
# если перевод строки найден, то
if brfind != None:
# для текущего вывода в колонку
# берем часть строки до перевода
@ -227,7 +227,7 @@ def columnWrite(*cols):
def justify(s,width):
'''Выровнить текст по ширине
Параметры:
s выводимая строка
width ширина на которую надо выровнить строку
@ -265,7 +265,7 @@ def justify(s,width):
def runOsCommand(cmd, inStr=None, ret_first=None):
"""Выполняет внешнюю программу
Параметры:
cmdStrProg внешняя программа
inStr данные передаваемые программе на страндартный вход.
@ -279,6 +279,7 @@ def runOsCommand(cmd, inStr=None, ret_first=None):
fin.write(inStr)
fin.close()
res = fout.readlines()
fout.close()
if res:
if len(res) > 1:
if ret_first:
@ -291,10 +292,10 @@ def runOsCommand(cmd, inStr=None, ret_first=None):
def genpassword(passlen=9):
'''Вернуть случайный пассворд указанной длины
Параметры:
passlen длина пароля который нужно сгенерировать
Возвращаемые параметры:
Сгенерированный пароль указанной длины
'''

@ -70,7 +70,7 @@ class cl_params:
else:
longOption = par["longOption"]
numChapter = self.getChapterNumber(par['helpChapter'])
helpTxt = pcs(
helpTxt = pcs(
" -%s, --%s "%(par["shortOption"],longOption),
self.column_width, par['help'],
CONWIDTH-self.column_width)
@ -185,7 +185,7 @@ def colorstr(s, *attrs):
return "\033[%sm" % ";".join(attrs) + s
def colorwrite(s, *attrs):
print colorstr(s, *attrs)
print colorstr(s, *attrs)
class cl_smartconsole:
def printRight(self, offsetLeft, offsetRight):
@ -351,5 +351,11 @@ class cl_smartconsole:
(('',''),
)
)
def printSUCCESS(self, string):
"""Вывод на печать в случае успеха без [ok] справа"""
self.printLine((('greenBr',' * '),
('',string),
),
(('',''),
)
)

Loading…
Cancel
Save