Skip to content

Commit

Permalink
Merge pull request ahmetb#2 from cclauss/patch-1
Browse files Browse the repository at this point in the history
Py3: from __future__ import print_function, xrange()
  • Loading branch information
ahmetb authored Nov 8, 2017
2 parents f5a6ee7 + 3a02da7 commit 95c994a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions generate_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function
import itertools
import sys
import os.path
import sys

try:
xrange # Python 2
except NameError:
xrange = range # Python 3


def main():
# (alias, full, allow_when_oneof, incompatible_with)
Expand Down Expand Up @@ -86,12 +93,12 @@ def main():
# prepare output
if not sys.stdout.isatty():
header_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'license_header')
with open(header_path, 'r') as f: print f.read()
with open(header_path, 'r') as f: print(f.read())
for cmd in out:
print "alias {}='{}'".format(
print("alias {}='{}'".format(
''.join([a[0] for a in cmd]),
' '.join([a[1] for a in cmd])
)
))

def gen(parts):
out = [()]
Expand Down

0 comments on commit 95c994a

Please sign in to comment.