本文整理汇总了Python中ubik_toolbelt.logger.stream_logger.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了info函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: build
def build(self):
stream_logger.info('Building...')
os.makedirs('%s/bin' % self.src_dir)
os.chdir('%s/bin' % self.src_dir)
os.system('curl -o spilleliste https://raw.github.com/Socketubs/Spilleliste/master/spilleliste')
os.system('chmod +x spilleliste')
开发者ID:toxinu,项目名称:ubik-repo,代码行数:8,代码来源:control.py
示例2: build
def build(self):
stream_logger.info('Building...')
if not os.path.exists(os.path.join(self.src_dir, self.archive_name)):
os.system('wget %s' % self.url)
else:
if get_md5(os.path.join(self.src_dir, self.archive_name)) != self.md5:
os.system('wget %s' % self.url)
rmtree(self.dir_name)
os.system('tar xvf %s' % self.archive_name)
开发者ID:toxinu,项目名称:ubik-repo,代码行数:9,代码来源:control.py
示例3: build
def build(self):
stream_logger.info('Building...')
os.chdir(self.src_dir)
os.system('wget http://ftp.gnu.org/gnu/wget/wget-%s.tar.gz' % self.version)
os.system('tar xvf wget-%s.tar.gz' % self.version)
os.system('rm wget-%s.tar.gz' % self.version)
os.chdir('wget-%s' % self.version)
os.system('./configure --prefix=%s' % conf.get('settings', 'packages'))
os.system('make')
开发者ID:toxinu,项目名称:ubik,代码行数:10,代码来源:control.py
示例4: pre_install
def pre_install(self):
if which('pip-2.7'):
os.system('pip-2.7 install jinja2 requests docopt appscript')
elif which('pip2'):
os.system('pip2 install jinja2 requests docopt appscript')
elif which('easy_install2'):
os.system('easy_install install jinja2 requests docopt appscript')
elif which('easy_install-2.7'):
os.system('easy_install-2.7 install jinja2 requests docopt appscript')
else:
stream_logger.info('Error: I cant find you Python package command (pip, easy_install).')
sys.exit(1)
开发者ID:toxinu,项目名称:ubik-repo,代码行数:12,代码来源:control.py
示例5: archive
def archive():
sys.path.append(os.getcwd())
control = __import__('control', globals(), locals(), [], 0)
sys.path.remove(os.getcwd())
control = control.Package()
if os.path.exists(control.name):
stream_logger.info('Package already archived')
sys.exit(1)
os.makedirs(control.name)
with open(os.path.join(control.name, 'files.lst'), 'w') as list_file:
_pwd = os.getcwd()
os.chdir('build')
for (p,d,f) in os.walk('.'):
for _f in f:
list_file.write(os.path.join(p, _f) + '\n')
os.chdir(_pwd)
create_tar('build', os.path.join(control.name, 'files.bz2'), change_dir=True, mode='w:bz2')
shutil.copyfile('control.py', os.path.join(control.name, 'control.py'))
create_tar(control.name, '%s.tar' % control.name)
开发者ID:toxinu,项目名称:ubik,代码行数:23,代码来源:package.py
示例6: create
def create(repo_name):
if os.path.exists(repo_name):
stream_logger.info(' :: Dir already exist')
sys.exit(1)
stream_logger.info(' :: Create repositorie structure')
os.makedirs(repo_name)
os.chdir(repo_name)
open('.repo_root', 'w').close
stream_logger.info(' :: Create default "stable" branch and two examples')
os.makedirs('stable')
os.makedirs('stable/noarch/nodist/novers')
os.makedirs('stable/x86_64/debian/6')
开发者ID:capensis,项目名称:ubik-toolbelt,代码行数:15,代码来源:repo.py
示例7: get_package_infos
def get_package_infos(prefix, path, name):
infos = {}
sys.path.append(os.path.join(path, name))
control_module = __import__('control')
sys.path.remove(os.path.join(path, name))
sys.modules.pop('control')
control = control_module.Package()
infos['name'] = control.name
infos['version'] = control.version
infos['release'] = control.release
infos['description'] = control.description
infos['requires'] = control.requires
infos['arch'] = path.split('/')[1]
infos['dist'] = path.split('/')[2]
infos['vers'] = path.split('/')[3]
if control.arch:
if control.arch != infos['arch']:
stream_logger.info('Bad arch (ignore it)')
return False
if control.dist:
if control.dist != infos['dist']:
stream_logger.info('Bad dist (ignore it)')
return False
if control.vers:
if control.vers != infos['vers']:
stream_logger.info('Bad vers (ignore it)')
return False
infos['md5'] = get_md5(path + '/' + name + '.tar')
return infos
开发者ID:toxinu,项目名称:ubik,代码行数:36,代码来源:repo.py
示例8: build
def build(self):
stream_logger.info('Building...')
开发者ID:toxinu,项目名称:ubik,代码行数:2,代码来源:package_13_control.py
示例9: package
def package(self):
stream_logger.info('Packaging...')
os.system('cp -p -R %s/* %s' % (self.src_dir, self.pkg_dir))
开发者ID:toxinu,项目名称:ubik,代码行数:3,代码来源:package_13_control.py
示例10: package
def package(self):
stream_logger.info("Packaging...")
if not os.path.exists(os.path.join(self.pkg_dir, "tmp", "ubik")):
os.makedirs(os.path.join(self.pkg_dir, "tmp", "ubik"))
copy(os.path.join(self.src_dir, self.archive_name), os.path.join(self.pkg_dir, "tmp", "ubik"))
开发者ID:toxinu,项目名称:ubik-repo,代码行数:5,代码来源:control.py
示例11: package
def package(self):
stream_logger.info('Packaging...')
os.chdir(self.src_dir)
os.chdir('wget-%s' % self.version)
os.system('make prefix=%s install' % self.pkg_dir)
开发者ID:toxinu,项目名称:ubik,代码行数:6,代码来源:control.py
示例12: create
#.........这里部分代码省略.........
# Never forget to user $SRC and $DST
true
}
#################################
if [ -z "$(ls -a | grep .libs.sh)" ]; then
echo "Need to be in package root"
exit 1
else
. .libs.sh
fi"""
libs_sh_skel = """#!/bin/bash
#
# This file contains libs to create package archive
# Be carefull
#
function files_listing(){
cd build
find ./ -type f > ../$NAME/files.lst
find ./ -type l >> ../$NAME/files.lst
cd ..
}
function files_blacklist(){
for line in $(cat ./blacklist); do
cat ./$NAME/files.lst | grep -v "$line" > ./$NAME/files.lst.tmp
mv ./$NAME/files.lst.tmp ./$NAME/files.lst
done
rm ./$NAMEfiles.lst.tmp > /dev/null 2>&1
}
function help(){
echo "Usage: make.sh (install|package|purge)"
echo ""
echo " install Build package"
echo " package Create package archive"
echo " clean Clean old archives"
echo ""
}
#################################
# Make Package
#################################
function package(){
touch ./control
chmod +x ./control
mkdir $NAME
files_listing
files_blacklist
cd build
tar cfj ../$NAME/files.bz2 -T ../$NAME/files.lst
cd ..
cp ./control $NAME
cp ./blacklist $NAME
tar cf $NAME.tar $NAME
}
#################################
#################################
# Clean
#################################
function clean(){
rm -rf $NAME > /dev/null 2>&1
rm $NAME.tar > /dev/null 2>&1
rm files.bz2 > /dev/null 2>&1
rm files.lst > /dev/null 2>&1
}
#################################
. control
if [ "$1" == "install" ]; then
install
elif [ "$1" == "package" ]; then
package
elif [ "$1" == "clean" ]; then
clean
else
help
fi"""
stream_logger.info(' :: Create %s package structure' % name)
os.makedirs(name)
os.chdir(name)
os.makedirs('build')
os.makedirs('src')
open('blacklist', 'w').close()
with open('control', 'w') as control:
control.write(control_skel)
with open('make.sh', 'w') as make_sh:
make_sh.write(make_sh_skel)
with open('.libs.sh', 'w') as libs_sh:
libs_sh.write(libs_sh_skel)
os.chmod('control', 0755)
os.chmod('make.sh', 0755)
stream_logger.info(' :: Done')
开发者ID:capensis,项目名称:ubik-toolbelt,代码行数:101,代码来源:package.py
示例13: package
def package(self):
stream_logger.info('=> Packaging...')
os.chdir(self.src_dir)
os.chdir(self.dir_name)
os.system('make prefix=%s install' % self.pkg_dir)
开发者ID:toxinu,项目名称:ubik-repo,代码行数:5,代码来源:control.py
示例14: build
def build(self):
stream_logger.info('=> Building...')
os.chdir(self.src_dir)
if not os.path.exists(self.archive_name):
stream_logger.info('=> Downloading %s' % self.archive_name)
os.system('wget http://www.python.org/ftp/python/%s/%s' % (self.version, self.archive_name))
elif get_md5(self.archive_name) != self.archive_md5:
stream_logger.info('!! Invalid archive md5')
os.remove(self.archive_name)
stream_logger.info('=> Downloading %s' % self.archive_name)
os.system('wget http://www.python.org/ftp/python/%s/%s' % (self.version, self.archive_name))
if os.path.exists(self.dir_name):
stream_logger.info('=> Clean old builds')
shutil.rmtree(self.dir_name)
stream_logger.info('=> Extract archive')
os.system('tar xvf %s' % self.archive_name)
os.chdir(self.dir_name)
os.system('./configure --prefix=/usr/local/ubik')
os.system('make')
开发者ID:toxinu,项目名称:ubik-repo,代码行数:20,代码来源:control.py
示例15: post_install
def post_install(self):
stream_logger.info(self.caveats)
开发者ID:toxinu,项目名称:ubik-repo,代码行数:2,代码来源:control.py
示例16: post_upgrade
def post_upgrade(self):
stream_logger.info(self.caveats)
开发者ID:toxinu,项目名称:ubik-repo,代码行数:2,代码来源:control.py
示例17: package
def package(self):
stream_logger.info('Packaging...')
开发者ID:toxinu,项目名称:ubik,代码行数:2,代码来源:control.py
示例18: generate
def generate(branches=False, old_format=False, tmp_dir=False):
if not os.path.exists('.repo_root'):
stream_logger.info(' :: Need to be at repository root')
sys.exit(1)
if not tmp_dir:
prefix = os.getcwd()
else:
prefix = tmp_dir
if not os.path.exists(prefix):
os.makedirs(prefix)
if not branches:
branches = filter(os.path.isdir, os.listdir('.'))
elif not isinstance(branches, list):
branches = [branches]
for branch in branches:
if branch[0] == ".":
continue
_json = []
for (path, dirs, files) in os.walk(branch):
if len(path.split('/')) == 1:
stream_logger.info(' + %s' % path.split('/')[0])
elif len(path.split('/')) == 2:
stream_logger.info(' |_ %s' % path.split('/')[1])
elif len(path.split('/')) == 3:
stream_logger.info(' |_ %s' % path.split('/')[2])
elif len(path.split('/')) == 4:
stream_logger.info(' |_ %s' % path.split('/')[3])
for package in files:
if package[-4:] != '.tar':
stream_logger.info(' |_ %s (ignored)' % package[:-4])
continue
package = package[:-4]
stream_logger.info(' |_ %s' % package)
unarchiver(prefix, path, package)
_json.append(get_package_infos(prefix, path, package))
clean("%s/%s" % (prefix, path), package)
write_packages_json(_json, branch)
if tmp_dir:
shutil.rmtree(prefix)
开发者ID:toxinu,项目名称:ubik,代码行数:44,代码来源:repo.py
示例19: create
def create(package_name):
name = package_name
control_py = """# coding: utf-8
import os
from ubik_toolbelt.logger import stream_logger
from ubik_toolbelt.control import Control
class Package(Control):
\"\"\"
Control object attributs ::
self.cur_dir Current directory
self.src_dir Source directory
self.pkg_dir Build directory
Help ::
http://ubik.socketubs.net/toolbelt/packager.html
\"\"\"
def __init__(self):
Control.__init__(self)
self.name = '%s'
self.version = ''
self.release = '0'
self.requires = []
self.arch = ''
self.dist = ''
self.vers = ''
self.description = ''
def build(self):
stream_logger.info('Building...')
def package(self):
stream_logger.info('Packaging...')
def pre_install(self):
pass
def post_install(self):
pass
def pre_upgrade(self):
pass
def post_upgrade(self):
pass
def pre_remove(self):
pass
def post_remove(self):
pass
""" % name
stream_logger.info(' :: Create %s package structure' % name)
os.makedirs(name)
os.chdir(name)
os.makedirs('build')
os.makedirs('source')
with open('control.py', 'w') as control:
control.write(control_py)
stream_logger.info(' :: Done')
开发者ID:toxinu,项目名称:ubik,代码行数:63,代码来源:package.py
注:本文中的ubik_toolbelt.logger.stream_logger.info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论