utilize the tuple form of starts/endswith
| | |
| | | |
| | | def _pkg_resources_style(self, value, package): |
| | | """ package.module:attr style """ |
| | | if value.startswith('.') or value.startswith(':'): |
| | | if value.startswith(('.', ':')): |
| | | if not package: |
| | | raise ValueError( |
| | | 'relative name %r irresolveable without package' % (value,) |
| | |
| | | """ |
| | | if name.startswith('.'): |
| | | return 'Skipping hidden file %(filename)s' |
| | | if name.endswith('~') or name.endswith('.bak'): |
| | | if name.endswith(('~', '.bak')): |
| | | return 'Skipping backup file %(filename)s' |
| | | if name.endswith('.pyc') or name.endswith('.pyo'): |
| | | if name.endswith(('.pyc', '.pyo')): |
| | | return 'Skipping %s file ' % os.path.splitext(name)[1] + '%(filename)s' |
| | | if name.endswith('$py.class'): |
| | | return 'Skipping $py.class file %(filename)s' |