Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11722686
resolve-hash
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
867 B
Referenced Files
None
Subscribers
None
resolve-hash
View Options
#!/usr/bin/env python3
# -------------------------------------------------------------
# Resolve hash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Query various sources with a known hash
# like Phabricator, Gerrit or GitHub to offer
# hash information URL from a VCS hash.
# License: BSD-2-Clause
# -------------------------------------------------------------
import
sys
from
resolvehash.resolvehash
import
find_hash
,
parse_config
def
run
(
needle_hash
):
result
=
find_hash
(
parse_config
(),
needle_hash
)
if
not
result
:
sys
.
exit
(
1
)
print
(
result
)
if
__name__
==
"__main__"
:
argc
=
len
(
sys
.
argv
)
if
argc
<
2
:
print
(
f
"Usage:
{
sys
.
argv
[
0
]
}
<hash>"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
run
(
sys
.
argv
[
1
])
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Thu, Sep 18, 04:34 (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2989560
Default Alt Text
resolve-hash (867 B)
Attached To
Mode
rRESOLVEHASH Resolve hash
Attached
Detach File
Event Timeline
Log In to Comment