Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'subject:ANN': 0.02; 'typing': 0.04; 'subject:Python': 0.06; 'supported.': 0.07; 'url:pypi': 0.08; 'executed': 0.09; 'recipe': 0.09; 'release,': 0.09; 'ssh': 0.09; 'configure': 0.10; 'subject:] ': 0.15; '10022': 0.16; 'bugfix': 0.16; 'recipes': 0.16; 'subject: \n ': 0.16; 'subject:similar': 0.16; 'sudo': 0.16; '\xa0def': 0.16; '\xa0this': 0.16; '\xa0you': 0.16; 'wrote:': 0.18; 'converted': 0.18; 'instance': 0.18; 'received:209.85.212.46': 0.23; 'received:mail-vw0-f46.google.com': 0.23; 'enhancements': 0.23; 'gcc': 0.23; 'changed': 0.24; 'command': 0.24; 'removed.': 0.24; 'sender:addr:gmail.com': 0.25; 'skip:[ 10': 0.27; 'remote': 0.27; 'sat,': 0.28; 'import': 0.28; 'fixed': 0.28; 'message- id:@mail.gmail.com': 0.29; 'class': 0.29; "'build'": 0.30; '22,': 0.30; 'none,': 0.30; 'object.': 0.30; 'servers.': 0.30; "skip:' 10": 0.30; 'nov': 0.31; 'pm,': 0.31; 'skip:( 20': 0.31; 'hi,': 0.31; 'changes': 0.32; 'subject:[': 0.32; 'to:addr:python-list': 0.32; 'rule': 0.34; 'received:209.85.212': 0.34; 'automation': 0.34; 'deploy': 0.34; 'similar': 0.35; 'object': 0.35; 'url:python': 0.35; 'file': 0.36; '...': 0.36; 'useful': 0.36; '(not': 0.37; 'using': 0.37; 'necessary.': 0.38; 'overview': 0.38; 'run': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'url:org': 0.38; 'skip:\xa0 10': 0.38; 'tool': 0.39; 'to:addr:python.org': 0.39; 'release': 0.40; 'files': 0.40; 'received:209': 0.40; 'your': 0.61; '2011': 0.62; 'share': 0.66; 'fun!': 0.67; 'details.': 0.69; 'confirm': 0.69; 'url:http': 0.72; '***': 0.73; 'login,': 0.84; 'subject:tool': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=7WO1jGSbM79uLBlu45iRuv7bJVdZo3BeBxkGiRFlvuU=; b=rHXhockfeDJfZn+R6W+LJiLKUqqs398G3SdaQYO1iDb8c1GgKWmj9Fkfs1fWpx0Kcv 8TB8YlyVxoMQAGCaOC1Tkmfw1ICRYbDTSklMsvLLV0yx9017MtEOc9d5dYRQZuX19Ox6 HegMSrxi4Htke5y6KRvQAiw/dkC041lp+SikQ= MIME-Version: 1.0 Sender: kwatch@gmail.com Date: Fri, 11 Nov 2011 06:54:02 +0900 X-Google-Sender-Auth: Hrz6xehzZPwmlXT4RuMnTbN6Pwg Subject: [ANN] pyKook 0.7.1 - task automation tool for Python, similar to Rake or Ant From: Makoto Kuwata To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 224 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320962045 news.xs4all.nl 6886 [2001:888:2000:d::a6]:47226 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15563 I have released pyKook 0.7.1.http://pypi.python.org/pypi/Kook/http://www.kuwata-lab.com/kook/http:= //www.kuwata-lab.com/kook/pykook-users-guide.html pyKook is a task automation tool for Python, similar to Rake or Ant. Bugfix in this release---------------------- * Fixed to include 'kook/books/*.py' into .egg file --regads,makoto kuwata On Sat, Nov 5, 2011 at 3:06 PM, Makoto Kuwata wrote: > Hi, > > I have released pyKook 0.7.0. > http://pypi.python.org/pypi/Kook/ > http://www.kuwata-lab.com/kook/ > http://www.kuwata-lab.com/kook/pykook-users-guide.html > > In this release, you can run commands on remote machines using ssh. > This is very useful to deploy your application. > > > pyKook Overview > --------------- > > pyKook is a task automation tool for Python, similar to Rake or Ant. > > (Kookbook.py): > > =A0 =A0kookbook.default =3D 'build' > > =A0 =A0## task > =A0 =A0@recipe(None, ['hello']) > =A0 =A0def build(c): > =A0 =A0 =A0 =A0"""build all""" > =A0 =A0 =A0 =A0pass > > =A0 =A0## file > =A0 =A0@recipe('hello', ['hello.o']) > =A0 =A0def file_hello(c): > =A0 =A0 =A0 =A0"""build 'hello' from 'hello.o'""" > =A0 =A0 =A0 =A0system(c%'gcc -o $(product) $(ingred)') > > =A0 =A0## rule > =A0 =A0@recipe('*.o', ['$(1).c', '$(1).h']) > =A0 =A0def file_o(c): > =A0 =A0 =A0 =A0system(c%'gcc -c $(ingred)') > > > Command-line: > > =A0 =A0bash> kk =A0 =A0 # or pykook > =A0 =A0$ gcc -c hello.c > =A0 =A0### *** hello.o (recipe=3Dfile_o) > =A0 =A0$ gcc -c hello.c > =A0 =A0### ** hello (recipe=3Dfile_hello) > =A0 =A0$ gcc -o hello hello.o > =A0 =A0### * build (recipe=3Dbuild) > > See http://www.kuwata-lab.com/kook/pykook-users-guide.html for details. > > > Enhancements in this release > ---------------------------- > > * (EXPERIMENTAL!!) Remote command execution (ssh and sftp) is available. > =A0This is very useful to deploy your application into servers. > > =A0Ex (Kookbook.py):: > > =A0 =A0 =A0 =A0from kook.remote import Remote > =A0 =A0 =A0 =A0remote =3D Remote( > =A0 =A0 =A0 =A0 =A0 =A0hosts =A0 =A0=3D ['www1', 'www2', 'user3@www3:1002= 2'], > =A0 =A0 =A0 =A0 =A0 =A0port =A0 =A0 =3D 22, > =A0 =A0 =A0 =A0 =A0 =A0user =A0 =A0 =3D 'user1', > =A0 =A0 =A0 =A0 =A0 =A0#password =3D None, =A0 =A0 =A0# for login, '~/.ss= h/id_rsa' and sudo > =A0 =A0 =A0 =A0 =A0 =A0passphrase =3D None, =A0 =A0 # only for '~/.ssh/id= _rsa' > =A0 =A0 =A0 =A0 =A0 =A0sudo_password =3D 'xxx', # only for sudo command > =A0 =A0 =A0 =A0) > > =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0@remotes(remote) > =A0 =A0 =A0 =A0def hostinfo(c): > =A0 =A0 =A0 =A0 =A0 =A0"""show hostname""" > =A0 =A0 =A0 =A0 =A0 =A0ssh =3D c.ssh > =A0 =A0 =A0 =A0 =A0 =A0ssh('hostname') =A0 =A0 =A0 =A0# run command with = ssh > =A0 =A0 =A0 =A0 =A0 =A0ssh('whomai') =A0 =A0 =A0 =A0 =A0# run command wit= h ssh > =A0 =A0 =A0 =A0 =A0 =A0ssh.sudo('whoami') =A0 =A0 # run command with sudo > > =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0@remotes(remote) > =A0 =A0 =A0 =A0def exchange(c): > =A0 =A0 =A0 =A0 =A0 =A0"""upload and download files""" > =A0 =A0 =A0 =A0 =A0 =A0ssh =3D c.ssh > =A0 =A0 =A0 =A0 =A0 =A0with ssh.pushd('work/apps'): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ssh.get('file.remote') =A0 =A0# download a= file > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ssh.put('file.local') =A0 =A0 # upload a f= ile > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ssh.mget('remote.*') =A0 =A0 =A0# download= files > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ssh.mput('local.*') =A0 =A0 =A0 # upload f= iles > > =A0Notice that you must configure ssh at first and confirm that > =A0you can log into servers without typing password:: > > =A0 =A0 =A0 =A0bash> ssh user1@www1 > =A0 =A0 =A0 =A0bash> ssh user1@www2 > =A0 =A0 =A0 =A0bash> ssh -p 10022 user3@www3 > =A0 =A0 =A0 =A0bash> kk hostinfo > =A0 =A0 =A0 =A0### * showinfo (recipe=3Dshowinfo) > =A0 =A0 =A0 =A0[user1@www1]$ hostame > =A0 =A0 =A0 =A0www1 > =A0 =A0 =A0 =A0[user1@www1]$ whoami > =A0 =A0 =A0 =A0user1 > =A0 =A0 =A0 =A0[user1@www1]$ sudo whoami > =A0 =A0 =A0 =A0root > =A0 =A0 =A0 =A0[user2@www2]$ hostame > =A0 =A0 =A0 =A0www2 > =A0 =A0 =A0 =A0[user2@www2]$ whoami > =A0 =A0 =A0 =A0user2 > =A0 =A0 =A0 =A0[user2@www2]$ sudo whoami > =A0 =A0 =A0 =A0root > =A0 =A0 =A0 =A0[user3@www3]$ hostame > =A0 =A0 =A0 =A0www3 > =A0 =A0 =A0 =A0[user3@www3]$ whami > =A0 =A0 =A0 =A0user3 > =A0 =A0 =A0 =A0[user3@www3]$ sudo whoami > =A0 =A0 =A0 =A0root > > =A0Currently commands are executed sequencially (not in parallel). > > * (EXPERIMENTAL!!) Password object supported. > =A0Password object asks you to enter password in prompt when necessary. > > =A0Ex (Kookbook.py):: > > =A0 =A0 =A0 =A0from kook.remote import Remote, Password > =A0 =A0 =A0 =A0remote =3D Remote( > =A0 =A0 =A0 =A0 =A0 =A0hosts =A0 =A0 =A0 =A0 =3D ['user1@www1:22'], > =A0 =A0 =A0 =A0 =A0 =A0#password =A0 =A0 =3D Password('login'), > =A0 =A0 =A0 =A0 =A0 =A0passphrase =A0 =A0=3D Password('~/.ssh/id_rsa'), > =A0 =A0 =A0 =A0 =A0 =A0sudo_password =3D Password('sudo command') > =A0 =A0 =A0 =A0) > =A0 =A0 =A0 =A0# > =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0@remotes(remote) > =A0 =A0 =A0 =A0def remote_test(c): > =A0 =A0 =A0 =A0 =A0 =A0ssh =3D c.ssh > =A0 =A0 =A0 =A0 =A0 =A0ssh.sudo('whoami') > > =A0Output example:: > > =A0 =A0 =A0 =A0bash> kk remote_test > =A0 =A0 =A0 =A0### * remote_test (recipe=3Dremote_test) > =A0 =A0 =A0 =A0Password for ~/.ssh/id_rsa: > =A0 =A0 =A0 =A0Password for sudo command: > =A0 =A0 =A0 =A0[user1@www1]$ sudo whoami > =A0 =A0 =A0 =A0root > > =A0It is easy to share password object. > > =A0Ex (Kookbook.py):: > > =A0 =A0 =A0 =A0from kook.remote import Remote, Password > =A0 =A0 =A0 =A0passwd =3D Password() > =A0 =A0 =A0 =A0remote =3D Remote( > =A0 =A0 =A0 =A0 =A0 =A0hosts =A0 =A0 =A0 =A0 =3D ['user1@www1:22'], > =A0 =A0 =A0 =A0 =A0 =A0password =A0 =A0 =A0=3D passwd, > =A0 =A0 =A0 =A0 =A0 =A0passphrase =A0 =A0=3D passwd, > =A0 =A0 =A0 =A0 =A0 =A0sudo_password =3D passwd, > =A0 =A0 =A0 =A0) > > > Changes in this release > ----------------------- > > * Category class is changed to convers all instance methods into staticme= thods. > > =A0Ex (Kookbook.py): > > =A0 =A0 =A0 =A0class apache(Category): > =A0 =A0 =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0 =A0 =A0def start(c): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 system('apachectl start') > > =A0 =A0 =A0 =A0## start() is converted into staticmethod > =A0 =A0 =A0 =A0assert type(apache.__dict__['start']) =3D=3D staticmethod > =A0 =A0 =A0 =A0from types import FunctionType > =A0 =A0 =A0 =A0assert type(apache.start) =3D=3D FuntionType > > =A0This makes execution of other recipes in category easier:: > > =A0 =A0 =A0 =A0class apache(Category): > =A0 =A0 =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0 =A0 =A0def start(c): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 ... > =A0 =A0 =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0 =A0 =A0def stop(c): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 ... > =A0 =A0 =A0 =A0 =A0 =A0@recipe > =A0 =A0 =A0 =A0 =A0 =A0def restart(c): > =A0 =A0 =A0 =A0 =A0 =A0 =A0 apache.start(c) =A0 =A0# execute other recipe > =A0 =A0 =A0 =A0 =A0 =A0 =A0 apache.stop(c) =A0 =A0 # execute other recipe > > * (internal) kook.config.stdout and kook.config.stderr are removed. > > > > See http://www.kuwata-lab.com/kook/pykook-CHANGES.txt for details. > > > Have fun! > > -- > regards, > makoto kuwata >