Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Oskar Roesler
ros-aur-helpers
Commits
690500df
Verified
Commit
690500df
authored
Dec 06, 2020
by
Oskar Roesler
Browse files
Handle retry with rosdistro name prefix better in parser.py
parent
08f6978c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
aurci/general.py
aurci/general.py
+3
-2
aurci/parser.py
aurci/parser.py
+13
-7
No files found.
aurci/general.py
View file @
690500df
...
...
@@ -13,14 +13,15 @@ class Routines:
CACHE_ROOT
=
os
.
environ
.
get
(
"XDG_CACHE_HOME"
,
os
.
path
.
join
(
Path
.
home
(),
".cache/"
))
def
__init__
(
self
,
package
=
None
,
verbosity
=
False
,
output
=
True
):
self
.
package
=
package
self
.
verbosity
=
verbosity
self
.
output
=
output
self
.
config_path
=
os
.
path
.
join
(
Routines
.
CONFIG_ROOT
,
'ros-aur-helper'
)
self
.
cache_path
=
os
.
path
.
join
(
Routines
.
CACHE_ROOT
,
'ros-aur-helper'
)
self
.
check_and_create_path
(
self
.
config_path
)
self
.
check_and_create_path
(
self
.
cache_path
)
self
.
repos_path
=
os
.
path
.
join
(
self
.
cache_path
,
"packages"
,
self
.
package
)
if
package
:
self
.
package
=
package
self
.
repos_path
=
os
.
path
.
join
(
self
.
cache_path
,
"packages"
,
self
.
package
)
config
=
self
.
get_config
()
self
.
gh
=
Github
(
config
[
'CI'
][
'GH_OAUTH_TOKEN'
])
self
.
gh_organization_name
=
config
[
'CI'
][
'GH_ORGANIZATION'
]
...
...
aurci/parser.py
View file @
690500df
...
...
@@ -30,16 +30,22 @@ def main(argv):
args
=
parser
.
parse_args
(
argv
)
try
:
commands
(
args
.
command
,
args
.
package
,
args
.
verbose
,
args
.
quiet
)
except
BaseException
as
e
:
name
=
"{0}{1}"
.
format
(
Routines
.
get_ros_distro
(),
args
.
package
)
if
os
.
path
.
exists
(
os
.
path
.
join
(
"packages/"
,
name
)):
def
retry_with_rosdistro_name
():
name
=
"{0}{1}"
.
format
(
Routines
().
get_ros_distro
(),
args
.
package
)
if
os
.
path
.
exists
(
os
.
path
.
join
(
Routines
.
CACHE_ROOT
,
"packages/"
,
name
)):
try
:
commands
(
args
.
command
,
name
,
args
.
verbose
,
args
.
quiet
)
except
BaseException
as
e
:
print
(
f
"Error:
{
args
.
package
}
could not be found while running
{
args
.
command
}
"
)
except
KeyError
:
print
(
f
"Error:
{
args
.
package
}
could not be found in ROS Metainfo dict while running
{
args
.
command
}
"
)
except
FileNotFoundError
:
print
(
f
"Error:
{
args
.
package
}
folder could not be found while running
{
args
.
command
}
"
)
try
:
commands
(
args
.
command
,
args
.
package
,
args
.
verbose
,
args
.
quiet
)
except
KeyError
:
retry_with_rosdistro_name
()
except
FileNotFoundError
:
retry_with_rosdistro_name
()
if
__name__
==
'__main__'
:
main
(
sys
.
argv
)
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