| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c6174e5 commit e7ba350
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,9 +8,9 @@ A CLI tool is also provided (called **gitlab**). | |||
| 8 | 8 | ||
| 9 | 9 | ## Requirements | |
| 10 | 10 | ||
| 11 | - Only Python 2 is supported for the moment. | ||
| 11 | + python-gitlab depends on: | ||
| 12 | 12 | ||
| 13 | - python-gitlab depends on [python-requests](http://docs.python-requests.org/en/latest/). | ||
| 13 | + * [python-requests](http://docs.python-requests.org/en/latest/). | ||
| 14 | 14 | ||
| 15 | 15 | ## State | |
| 16 | 16 | ||
@@ -20,7 +20,6 @@ python-gitlab is a work in progress, although already usable. Changes in the API | |||
| 20 | 20 | ||
| 21 | 21 | * Improve documentation | |
| 22 | 22 | * Write unit tests | |
| 23 | - * Improve the command line tool | ||
| 24 | 23 | ||
| 25 | 24 | ## Code snippet | |
| 26 | 25 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - #!/usr/bin/python | ||
| 1 | + #!/usr/bin/env python | ||
| 2 | 2 | # -*- coding: utf-8 -*- | |
| 3 | 3 | # | |
| 4 | 4 | # Copyright (C) 2013 Gauvain Pocentek <gauvain@pocentek.net> | |
@@ -19,7 +19,10 @@ | |||
| 19 | 19 | import os | |
| 20 | 20 | import sys | |
| 21 | 21 | ||
| 22 | - from ConfigParser import ConfigParser | ||
| 22 | + try: | ||
| 23 | + from ConfigParser import ConfigParser | ||
| 24 | + except: | ||
| 25 | + from configparser import ConfigParser | ||
| 23 | 26 | ||
| 24 | 27 | from inspect import getmro | |
| 25 | 28 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -486,21 +486,21 @@ def __str__(self): | |||
| 486 | 486 | return '%s => %s' % (type(self), str(self.__dict__)) | |
| 487 | 487 | ||
| 488 | 488 | def pretty_print(self, depth=0): | |
| 489 | - print "%sid: %s" % (" " * depth * 2, self.id) | ||
| 489 | + print("%sid: %s" % (" " * depth * 2, self.id)) | ||
| 490 | 490 | for k in sorted(self.__dict__.keys()): | |
| 491 | 491 | if k == "id": | |
| 492 | 492 | continue | |
| 493 | 493 | v = self.__dict__[k] | |
| 494 | 494 | if isinstance(v, GitlabObject): | |
| 495 | 495 | if depth == 0: | |
| 496 | - print "%s:" % k | ||
| 496 | + print("%s:" % k) | ||
| 497 | 497 | v.pretty_print(1) | |
| 498 | 498 | else: | |
| 499 | - print "%s: %s" % (k, v.id) | ||
| 499 | + print("%s: %s" % (k, v.id)) | ||
| 500 | 500 | else: | |
| 501 | 501 | if isinstance(v, Gitlab): | |
| 502 | 502 | continue | |
| 503 | - print "%s%s: %s" % (" " * depth * 2, k, v) | ||
| 503 | + print("%s%s: %s" % (" " * depth * 2, k, v)) | ||
| 504 | 504 | ||
| 505 | 505 | def json(self): | |
| 506 | 506 | return json.dumps(self.__dict__, cls=jsonEncoder) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments