This repository has been archived by the owner on Oct 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into SolderPaste_EP
- Loading branch information
Showing
20 changed files
with
408 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import re | ||
|
||
class LibTable: | ||
|
||
def __init__(self, filename): | ||
|
||
RE_NAME = r'\(name "?([^\)"]*)"?\)' | ||
RE_TYPE = r'\(type "?([^\)"]*)"?\)' | ||
RE_URI = r'\(uri "?([^\)"]*)"?\)' | ||
RE_OPT = r'\(options "?([^\)"]*)"?\)' | ||
RE_DESC = r'\(descr "?([^\)"]*)"?' | ||
|
||
self.entries = [] | ||
self.errors = [] | ||
|
||
with open(filename, 'r') as lib_table_file: | ||
|
||
for line in lib_table_file: | ||
|
||
# Skip lines that do not define a library | ||
if not '(lib ' in line: | ||
continue | ||
|
||
re_name = re.search(RE_NAME, line) | ||
re_type = re.search(RE_TYPE, line) | ||
re_uri = re.search(RE_URI, line) | ||
re_opt = re.search(RE_OPT, line) | ||
re_desc = re.search(RE_DESC, line) | ||
|
||
if re_name and re_type and re_uri and re_opt and re_desc: | ||
entry = {} | ||
entry['name'] = re_name.groups()[0] | ||
entry['type'] = re_type.groups()[0] | ||
entry['uri'] = re_uri.groups()[0] | ||
entry['opt'] = re_opt.groups()[0] | ||
entry['desc'] = re_desc.groups()[0] | ||
|
||
self.entries.append(entry) | ||
|
||
else: | ||
self.errors.append(line) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
|
||
from __future__ import print_function | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.