-
Notifications
You must be signed in to change notification settings - Fork 6
Fix Bug and add Feature to Group also for footprint #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: issue20
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,6 +213,7 @@ def group(self): | |
| self.logger.error(designator) | ||
| sys.exit(1) | ||
|
|
||
|
|
||
| def table_grouped(self): | ||
| return self.grouped_items | ||
|
|
||
|
|
@@ -357,30 +358,47 @@ def statistics(self): | |
| def merge(self): | ||
| self.group() | ||
| self.count() | ||
| d = {} | ||
| listApp = [] | ||
|
||
| for category in self.categories: | ||
| listApp = [] | ||
| if category in self.table: | ||
| for n, item in enumerate(self.table[category]): | ||
| self.table[category][n][self.TABLE_DESIGNATOR] = \ | ||
| lib.order_designator(item[self.TABLE_DESIGNATOR], self.logger) | ||
|
|
||
| # Convert all designator in a number to be ordered | ||
| if category in ["R", "C", "L", "Y"]: | ||
| for m in self.table[category]: | ||
| m[self.TABLE_COMMENT] = lib.value_toFloat( | ||
| m[self.TABLE_COMMENT], category, self.logger) | ||
| # print m[COMMENT], key | ||
|
|
||
| self.table[category] = sorted( | ||
| self.table[category], key=lambda x: x[ | ||
| self.TABLE_COMMENT]) | ||
|
|
||
| # Convert all ORDERED designator in a numeric format | ||
| if category in ["R", "C", "L", "Y"]: | ||
| for m in self.table[category]: | ||
| m[self.TABLE_COMMENT] = lib.value_toStr( | ||
| m[self.TABLE_COMMENT], self.logger) | ||
| # print m[self.TABLE_COMMENT], category | ||
|
|
||
| d = {} | ||
| i = 0 | ||
| e = 0 | ||
|
||
| stringa = "" | ||
| for item in self.table[category]: | ||
| if item[self.TABLE_FOOTPRINT] in d: | ||
| d[item[self.TABLE_FOOTPRINT]].append(item) | ||
| else: | ||
| d[item[self.TABLE_FOOTPRINT]] = [item] | ||
|
|
||
| listApp.append(d.values()) | ||
| for x in listApp[0]: | ||
|
||
| self.table[category] = x | ||
| for m in self.table[category]: | ||
| m[self.TABLE_COMMENT] = lib.value_toFloat( | ||
| m[self.TABLE_COMMENT], category, self.logger) | ||
|
|
||
| self.table[category] = sorted( | ||
| self.table[category], key=lambda x: x[ | ||
| self.TABLE_COMMENT]) | ||
| # Convert all ORDERED designator in a numeric format | ||
| if category in ["R", "C", "L", "Y"]: | ||
|
||
| for m in self.table[category]: | ||
| m[self.TABLE_COMMENT] = lib.value_toStr( | ||
| m[self.TABLE_COMMENT], self.logger) | ||
| x = self.table[category] | ||
| self.table[category] = [] | ||
| for x in listApp[0]: | ||
| for y in x: | ||
| self.table[category].append(y) | ||
| return self.table | ||
|
|
||
| def diff(self): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non si poteva usare lo stesso if? c'è differenza a fare lo stesso controllo?