~benji/charms/oneiric/buildbot-master/tests-with-config-up-front

« back to all changes in this revision

Viewing changes to encode

  • Committer: Benji York
  • Date: 2012-02-09 14:33:51 UTC
  • Revision ID: benji@benjiyork.com-20120209143351-0wzcltdprtgr68zl
remove encode script

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
# Copyright 2012 Canonical Ltd.  This software is licensed under the
4
 
# GNU Affero General Public License version 3 (see the file LICENSE).
5
 
 
6
 
# encode examples/master.cfg  | python -c 'import sys, base64; base64.decode(sys.stdin, sys.stdout)'
7
 
 
8
 
import base64
9
 
import StringIO
10
 
import sys
11
 
 
12
 
filename = sys.argv[1]
13
 
tmp = StringIO.StringIO()
14
 
with open(filename) as f:
15
 
     base64.encode(f, tmp)
16
 
tmp.flush()
17
 
tmp.seek(0)
18
 
sys.stdout.write(''.join(l.strip() for l in tmp.readlines()))