Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
recurls
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Łukasz Nowak
recurls
Commits
340c944d
Commit
340c944d
authored
Apr 06, 2023
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recurls: Simplfy from recurlests
parent
2ed59df0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
setup.py
setup.py
+4
-4
src/recurls/__init__.py
src/recurls/__init__.py
+0
-0
src/recurls/cli.py
src/recurls/cli.py
+2
-2
src/recurls/recurls.py
src/recurls/recurls.py
+3
-3
No files found.
setup.py
View file @
340c944d
...
@@ -23,11 +23,11 @@ from setuptools import setup, find_packages
...
@@ -23,11 +23,11 @@ from setuptools import setup, find_packages
setup
(
setup
(
name
=
'recurl
est
s'
,
name
=
'recurls'
,
version
=
'0.0.0'
,
version
=
'0.0.0'
,
author
=
'Lukasz Nowak'
,
author
=
'Lukasz Nowak'
,
author_email
=
'luke@nexedi.com'
,
author_email
=
'luke@nexedi.com'
,
description
=
"Recurl
est
s - requests like curl wrapper"
,
description
=
"Recurls - requests like curl wrapper"
,
long_description
=
__doc__
,
long_description
=
__doc__
,
classifiers
=
[
classifiers
=
[
'Environment :: Console'
,
'Environment :: Console'
,
...
@@ -38,7 +38,7 @@ setup(
...
@@ -38,7 +38,7 @@ setup(
'later (GPLv3+)'
,
'later (GPLv3+)'
,
],
],
keywords
=
'requests url curl'
,
keywords
=
'requests url curl'
,
url
=
'https://lab.nexedi.com/luke/recurl
est
s'
,
url
=
'https://lab.nexedi.com/luke/recurls'
,
license
=
'GPLv3+ with wide exception for FOSS'
,
license
=
'GPLv3+ with wide exception for FOSS'
,
install_requires
=
[
install_requires
=
[
'requests'
,
# for the great CaseInsensitiveDict
'requests'
,
# for the great CaseInsensitiveDict
...
@@ -50,7 +50,7 @@ setup(
...
@@ -50,7 +50,7 @@ setup(
package_dir
=
{
""
:
"src"
},
package_dir
=
{
""
:
"src"
},
entry_points
=
{
entry_points
=
{
'console_scripts'
:
[
'console_scripts'
:
[
'recurl = recurl
est
s.cli:runRecurl'
,
'recurl = recurls.cli:runRecurl'
,
]
]
},
},
)
)
src/recurl
est
s/__init__.py
→
src/recurls/__init__.py
View file @
340c944d
File moved
src/recurl
est
s/cli.py
→
src/recurls/cli.py
View file @
340c944d
import
click
import
click
from
pprint
import
pprint
from
pprint
import
pprint
from
.
import
recurl
est
s
from
.
import
recurls
@
click
.
command
(
short_help
=
"Runs curl's wrapper recurl"
)
@
click
.
command
(
short_help
=
"Runs curl's wrapper recurl"
)
@
click
.
option
(
'--headers/--no-headers'
,
help
=
"Shows response headers"
,
default
=
False
,
show_default
=
True
)
@
click
.
option
(
'--headers/--no-headers'
,
help
=
"Shows response headers"
,
default
=
False
,
show_default
=
True
)
...
@@ -10,7 +10,7 @@ from . import recurlests
...
@@ -10,7 +10,7 @@ from . import recurlests
@
click
.
option
(
'--ip'
,
help
=
"IP to resolve to"
)
@
click
.
option
(
'--ip'
,
help
=
"IP to resolve to"
)
@
click
.
argument
(
"url"
)
@
click
.
argument
(
"url"
)
def
runRecurl
(
headers
,
output
,
curl
,
follow
,
ip
,
url
):
def
runRecurl
(
headers
,
output
,
curl
,
follow
,
ip
,
url
):
mimikra
=
recurl
ests
.
Recurlest
s
(
curl
)
mimikra
=
recurl
s
.
Recurl
s
(
curl
)
response
=
mimikra
.
get
(
url
,
ip
=
ip
,
allow_redirects
=
follow
)
response
=
mimikra
.
get
(
url
,
ip
=
ip
,
allow_redirects
=
follow
)
print
(
'Effective HTTP version:'
,
response
.
effective_http_version
)
print
(
'Effective HTTP version:'
,
response
.
effective_http_version
)
print
(
'Response status code:'
,
response
.
status_code
)
print
(
'Response status code:'
,
response
.
status_code
)
...
...
src/recurl
ests/recurlest
s.py
→
src/recurl
s/recurl
s.py
View file @
340c944d
...
@@ -7,7 +7,7 @@ import gzip
...
@@ -7,7 +7,7 @@ import gzip
import
os
import
os
class
Recurl
est
sResponse
(
object
):
class
RecurlsResponse
(
object
):
# properties:
# properties:
# content Content of the response, in bytes.
# content Content of the response, in bytes.
# cookies A CookieJar of Cookies the server sent back.
# cookies A CookieJar of Cookies the server sent back.
...
@@ -27,7 +27,7 @@ class RecurlestsResponse(object):
...
@@ -27,7 +27,7 @@ class RecurlestsResponse(object):
return
json
.
loads
(
self
.
text
,
*
args
,
**
kwargs
)
return
json
.
loads
(
self
.
text
,
*
args
,
**
kwargs
)
class
Recurl
est
s
(
object
):
class
Recurls
(
object
):
"""curl command wrapper, mimicing requests"""
"""curl command wrapper, mimicing requests"""
def
__init__
(
self
,
curl
=
'curl'
):
def
__init__
(
self
,
curl
=
'curl'
):
self
.
curl
=
curl
self
.
curl
=
curl
...
@@ -120,7 +120,7 @@ class Recurlests(object):
...
@@ -120,7 +120,7 @@ class Recurlests(object):
prc
=
subprocess
.
Popen
(
prc
=
subprocess
.
Popen
(
command_list
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
command_list
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
)
response
=
Recurl
est
sResponse
()
response
=
RecurlsResponse
()
response
.
command_output
,
response
.
command_error
=
[
response
.
command_output
,
response
.
command_error
=
[
q
.
decode
()
for
q
in
prc
.
communicate
()]
q
.
decode
()
for
q
in
prc
.
communicate
()]
response
.
command_returncode
=
prc
.
returncode
response
.
command_returncode
=
prc
.
returncode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment