Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Changes made to run files of not-working folder as well as working folder #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Prateekgidolia
Copy link

No description provided.

@@ -28,62 +28,62 @@

hints = [
Hint(layer='top',
ext=['gtl', 'cmp', 'top', ],
name=['art01', 'top', 'GTL', 'layer1', 'soldcom', 'comp', 'F.Cu', ],
ext=['gtl', 'cmp', 'top', 'gbr', ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'gbr' should not be added as an extension hint to any of these layer types because it is not unique to any specific layer type.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's true that 'gbr' is not the unique extension, in practice, I should not add it as hint extension.

Comment on lines +143 to +151
if ext[1:] == 'gbr': #Prateek
patterns = [r'(\w*[.-])*{}([.-]\w*)?$'.format(x) for x in hint.name] #Prateek
if any(re.findall(p, name, re.IGNORECASE) for p in patterns): #Prateek
return hint.layer #Prateek
else : #Prateek
patterns = [r'^(\w*[.-])*{}([.-]\w*)?$'.format(x) for x in hint.name]
if ext[1:] in hint.ext or any(re.findall(p, name, re.IGNORECASE) for p in patterns):
return hint.layer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these changes are necessary if you remove 'gbr' from the extension hints above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes if I remove 'gbr' from the extension hints these changes are not required, but one change is required and that is in defining patterns :
patterns = [r'(\w*[.-]){}([.-]\w)?$'.format(x) for x in hint.name]
instead of
patterns = [r'^(\w*[.-]){}([.-]\w)?$'.format(x) for x in hint.name]
according to my changes to name attribute in hints.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is * before {} in defining patterns, i.e.;
patterns = [r'(\w*[.-]){}([.-]\w)?$'.format(x) for x in hint.name]

@@ -35,6 +35,7 @@ def from_directory(cls, directory, board_name=None, verbose=False):
if not os.path.isdir(directory):
raise TypeError('{} is not a directory.'.format(directory))


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unecessary

@@ -125,13 +125,13 @@ def load_layer_data(data, filename=None):


def guess_layer_class(filename):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unecessary whitespace change

@Prateekgidolia
Copy link
Author

Prateekgidolia commented May 30, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants