| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,14 +15,14 @@ jobs: | |||
| 15 | 15 | runs-on: ubuntu-latest | |
| 16 | 16 | strategy: | |
| 17 | 17 | matrix: | |
| 18 | - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] | ||
| 18 | + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
| 19 | 19 | ||
| 20 | 20 | steps: | |
| 21 | - - uses: actions/checkout@v2 | ||
| 21 | + - uses: actions/checkout@v3 | ||
| 22 | 22 | with: | |
| 23 | 23 | fetch-depth: 1000 | |
| 24 | 24 | - name: Set up Python ${{ matrix.python-version }} | |
| 25 | - uses: actions/setup-python@v2 | ||
| 25 | + uses: actions/setup-python@v4 | ||
| 26 | 26 | with: | |
| 27 | 27 | python-version: ${{ matrix.python-version }} | |
| 28 | 28 | - name: Install dependencies | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,3 @@ | |||
| 1 | - # -*- coding: utf-8 -*- | ||
| 2 | 1 | # | |
| 3 | 2 | # GitDB documentation build configuration file, created by | |
| 4 | 3 | # sphinx-quickstart on Wed Jun 30 00:01:32 2010. | |
@@ -38,8 +37,8 @@ | |||
| 38 | 37 | master_doc = 'index' | |
| 39 | 38 | ||
| 40 | 39 | # General information about the project. | |
| 41 | - project = u'GitDB' | ||
| 42 | - copyright = u'2011, Sebastian Thiel' | ||
| 40 | + project = 'GitDB' | ||
| 41 | + copyright = '2011, Sebastian Thiel' | ||
| 43 | 42 | ||
| 44 | 43 | # The version info for the project you're documenting, acts as replacement for | |
| 45 | 44 | # |version| and |release|, also used in various other places throughout the | |
@@ -172,8 +171,8 @@ | |||
| 172 | 171 | # Grouping the document tree into LaTeX files. List of tuples | |
| 173 | 172 | # (source start file, target name, title, author, documentclass [howto/manual]). | |
| 174 | 173 | latex_documents = [ | |
| 175 | - ('index', 'GitDB.tex', u'GitDB Documentation', | ||
| 176 | - u'Sebastian Thiel', 'manual'), | ||
| 174 | + ('index', 'GitDB.tex', 'GitDB Documentation', | ||
| 175 | + 'Sebastian Thiel', 'manual'), | ||
| 177 | 176 | ] | |
| 178 | 177 | ||
| 179 | 178 | # The name of an image file (relative to this directory) to place at the top of | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ | |||
| 22 | 22 | __all__ = ('ObjectDBR', 'ObjectDBW', 'FileDBBase', 'CompoundDB', 'CachingDB') | |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | - class ObjectDBR(object): | ||
| 25 | + class ObjectDBR: | ||
| 26 | 26 | ||
| 27 | 27 | """Defines an interface for object database lookup. | |
| 28 | 28 | Objects are identified either by their 20 byte bin sha""" | |
@@ -63,7 +63,7 @@ def sha_iter(self): | |||
| 63 | 63 | #} END query interface | |
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | - class ObjectDBW(object): | ||
| 66 | + class ObjectDBW: | ||
| 67 | 67 | ||
| 68 | 68 | """Defines an interface to create objects in the database""" | |
| 69 | 69 | ||
@@ -105,7 +105,7 @@ def store(self, istream): | |||
| 105 | 105 | #} END edit interface | |
| 106 | 106 | ||
| 107 | 107 | ||
| 108 | - class FileDBBase(object): | ||
| 108 | + class FileDBBase: | ||
| 109 | 109 | ||
| 110 | 110 | """Provides basic facilities to retrieve files of interest, including | |
| 111 | 111 | caching facilities to help mapping hexsha's to objects""" | |
@@ -117,7 +117,7 @@ def __init__(self, root_path): | |||
| 117 | 117 | **Note:** The base will not perform any accessablity checking as the base | |
| 118 | 118 | might not yet be accessible, but become accessible before the first | |
| 119 | 119 | access.""" | |
| 120 | - super(FileDBBase, self).__init__() | ||
| 120 | + super().__init__() | ||
| 121 | 121 | self._root_path = root_path | |
| 122 | 122 | ||
| 123 | 123 | #{ Interface | |
@@ -133,7 +133,7 @@ def db_path(self, rela_path): | |||
| 133 | 133 | #} END interface | |
| 134 | 134 | ||
| 135 | 135 | ||
| 136 | - class CachingDB(object): | ||
| 136 | + class CachingDB: | ||
| 137 | 137 | ||
| 138 | 138 | """A database which uses caches to speed-up access""" | |
| 139 | 139 | ||
@@ -176,7 +176,7 @@ def _set_cache_(self, attr): | |||
| 176 | 176 | elif attr == '_db_cache': | |
| 177 | 177 | self._db_cache = dict() | |
| 178 | 178 | else: | |
| 179 | - super(CompoundDB, self)._set_cache_(attr) | ||
| 179 | + super()._set_cache_(attr) | ||
| 180 | 180 | ||
| 181 | 181 | def _db_query(self, sha): | |
| 182 | 182 | """:return: database containing the given 20 byte sha | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ class GitDB(FileDBBase, ObjectDBW, CompoundDB): | |||
| 39 | 39 | ||
| 40 | 40 | def __init__(self, root_path): | |
| 41 | 41 | """Initialize ourselves on a git objects directory""" | |
| 42 | - super(GitDB, self).__init__(root_path) | ||
| 42 | + super().__init__(root_path) | ||
| 43 | 43 | ||
| 44 | 44 | def _set_cache_(self, attr): | |
| 45 | 45 | if attr == '_dbs' or attr == '_loose_db': | |
@@ -68,7 +68,7 @@ def _set_cache_(self, attr): | |||
| 68 | 68 | # finally set the value | |
| 69 | 69 | self._loose_db = loose_db | |
| 70 | 70 | else: | |
| 71 | - super(GitDB, self)._set_cache_(attr) | ||
| 71 | + super()._set_cache_(attr) | ||
| 72 | 72 | # END handle attrs | |
| 73 | 73 | ||
| 74 | 74 | #{ ObjectDBW interface | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,7 +75,7 @@ class LooseObjectDB(FileDBBase, ObjectDBR, ObjectDBW): | |||
| 75 | 75 | new_objects_mode = int("644", 8) | |
| 76 | 76 | ||
| 77 | 77 | def __init__(self, root_path): | |
| 78 | - super(LooseObjectDB, self).__init__(root_path) | ||
| 78 | + super().__init__(root_path) | ||
| 79 | 79 | self._hexsha_to_file = dict() | |
| 80 | 80 | # Additional Flags - might be set to 0 after the first failure | |
| 81 | 81 | # Depending on the root, this might work for some mounts, for others not, which | |
@@ -151,7 +151,7 @@ def set_ostream(self, stream): | |||
| 151 | 151 | """:raise TypeError: if the stream does not support the Sha1Writer interface""" | |
| 152 | 152 | if stream is not None and not isinstance(stream, Sha1Writer): | |
| 153 | 153 | raise TypeError("Output stream musst support the %s interface" % Sha1Writer.__name__) | |
| 154 | - return super(LooseObjectDB, self).set_ostream(stream) | ||
| 154 | + return super().set_ostream(stream) | ||
| 155 | 155 | ||
| 156 | 156 | def info(self, sha): | |
| 157 | 157 | m = self._map_loose_object(sha) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ class MemoryDB(ObjectDBR, ObjectDBW): | |||
| 37 | 37 | exists in the target storage before introducing actual IO""" | |
| 38 | 38 | ||
| 39 | 39 | def __init__(self): | |
| 40 | - super(MemoryDB, self).__init__() | ||
| 40 | + super().__init__() | ||
| 41 | 41 | self._db = LooseObjectDB("path/doesnt/matter") | |
| 42 | 42 | ||
| 43 | 43 | # maps 20 byte shas to their OStream objects | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,7 +39,7 @@ class PackedDB(FileDBBase, ObjectDBR, CachingDB, LazyMixin): | |||
| 39 | 39 | _sort_interval = 500 | |
| 40 | 40 | ||
| 41 | 41 | def __init__(self, root_path): | |
| 42 | - super(PackedDB, self).__init__(root_path) | ||
| 42 | + super().__init__(root_path) | ||
| 43 | 43 | # list of lists with three items: | |
| 44 | 44 | # * hits - number of times the pack was hit with a request | |
| 45 | 45 | # * entity - Pack entity instance | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,15 +20,15 @@ class ReferenceDB(CompoundDB): | |||
| 20 | 20 | ObjectDBCls = None | |
| 21 | 21 | ||
| 22 | 22 | def __init__(self, ref_file): | |
| 23 | - super(ReferenceDB, self).__init__() | ||
| 23 | + super().__init__() | ||
| 24 | 24 | self._ref_file = ref_file | |
| 25 | 25 | ||
| 26 | 26 | def _set_cache_(self, attr): | |
| 27 | 27 | if attr == '_dbs': | |
| 28 | 28 | self._dbs = list() | |
| 29 | 29 | self._update_dbs_from_ref_file() | |
| 30 | 30 | else: | |
| 31 | - super(ReferenceDB, self)._set_cache_(attr) | ||
| 31 | + super()._set_cache_(attr) | ||
| 32 | 32 | # END handle attrs | |
| 33 | 33 | ||
| 34 | 34 | def _update_dbs_from_ref_file(self): | |
@@ -44,7 +44,7 @@ def _update_dbs_from_ref_file(self): | |||
| 44 | 44 | try: | |
| 45 | 45 | with codecs.open(self._ref_file, 'r', encoding="utf-8") as f: | |
| 46 | 46 | ref_paths = [l.strip() for l in f] | |
| 47 | - except (OSError, IOError): | ||
| 47 | + except OSError: | ||
| 48 | 48 | pass | |
| 49 | 49 | # END handle alternates | |
| 50 | 50 | ||
@@ -79,4 +79,4 @@ def _update_dbs_from_ref_file(self): | |||
| 79 | 79 | def update_cache(self, force=False): | |
| 80 | 80 | # re-read alternates and update databases | |
| 81 | 81 | self._update_dbs_from_ref_file() | |
| 82 | - return super(ReferenceDB, self).update_cache(force) | ||
| 82 | + return super().update_cache(force) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,7 +113,7 @@ def delta_chunk_apply(dc, bbuf, write): | |||
| 113 | 113 | # END handle chunk mode | |
| 114 | 114 | ||
| 115 | 115 | ||
| 116 | - class DeltaChunk(object): | ||
| 116 | + class DeltaChunk: | ||
| 117 | 117 | ||
| 118 | 118 | """Represents a piece of a delta, it can either add new data, or copy existing | |
| 119 | 119 | one from a source buffer""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments