FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pre-commit/pre_commit/prefix.py at wip_progress_dots · pre-commit/pre-commit · GitHub
pre-commit
pre-commit
Repository navigation
Code
Issues
17
(17)
Pull requests
8
(8)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
pre-commit
/
pre_commit
/
prefix.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (12 loc) · 478 Bytes
Breadcrumbs
pre-commit
/
pre_commit
/
prefix.py
Copy path
File metadata and controls
18 lines (12 loc) · 478 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from
__future__
import
unicode_literals
import
collections
import
os
.
path
class
Prefix
(
collections
.
namedtuple
(
'Prefix'
, (
'prefix_dir'
,))):
__slots__
=
()
def
path
(
self
,
*
parts
):
return
os
.
path
.
normpath
(
os
.
path
.
join
(
self
.
prefix_dir
,
*
parts
))
def
exists
(
self
,
*
parts
):
return
os
.
path
.
exists
(
self
.
path
(
*
parts
))
def
star
(
self
,
end
):
paths
=
os
.
listdir
(
self
.
prefix_dir
)
return
tuple
(
path
for
path
in
paths
if
path
.
endswith
(
end
))
Back
|
FazBrowse Home
|
New Git URL