Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nanopb
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
le
nanopb
Commits
7f97ad54
Commit
7f97ad54
authored
10 years ago
by
Petteri Aimonen
Browse files
Options
Downloads
Patches
Plain Diff
Give better messages about the .options file path.
Update issue 124 Status: FixedInGit
parent
f2f9f8a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generator/nanopb_generator.py
+10
-1
10 additions, 1 deletion
generator/nanopb_generator.py
with
10 additions
and
1 deletion
generator/nanopb_generator.py
+
10
−
1
View file @
7f97ad54
...
...
@@ -1000,19 +1000,28 @@ def process_file(filename, fdesc, options):
fdesc
=
descriptor
.
FileDescriptorSet
.
FromString
(
data
).
file
[
0
]
# Check if there is a separate .options file
had_abspath
=
False
try
:
optfilename
=
options
.
options_file
%
os
.
path
.
splitext
(
filename
)[
0
]
except
TypeError
:
# No %s specified, use the filename as-is
optfilename
=
options
.
options_file
had_abspath
=
True
if
os
.
path
.
isfile
(
optfilename
):
if
options
.
verbose
:
sys
.
stderr
.
write
(
'
Reading options from
'
+
optfilename
+
'
\n
'
)
Globals
.
separate_options
=
read_options_file
(
open
(
optfilename
,
"
rU
"
))
else
:
# If we are given a full filename and it does not exist, give an error.
# However, don't give error when we automatically look for .options file
# with the same name as .proto.
if
options
.
verbose
or
had_abspath
:
sys
.
stderr
.
write
(
'
Options file not found:
'
+
optfilename
)
Globals
.
separate_options
=
[]
Globals
.
matched_namemasks
=
set
()
# Parse the file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment