| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from niprov.dependencies import Dependencies |
||
| 5 | class LocationFactory(object): |
||
| 6 | """Creates Location objects.""" |
||
| 7 | |||
| 8 | def __init__(self, dependencies=Dependencies()): |
||
| 9 | self.dependencies = dependencies |
||
| 10 | |||
| 11 | def fromString(self, locationString): |
||
| 12 | """Creates a Location object. |
||
| 13 | |||
| 14 | Args: |
||
| 15 | locationString (str): String with path and optionally computer id. |
||
| 16 | """ |
||
| 17 | return Location(locationString) |
||
| 18 | |||
| 19 | def completeString(self, locationString): |
||
| 20 | """Validates a location string. |
||
| 21 | |||
| 22 | If locationString only contains a filesystem path, computer info will |
||
| 23 | be added. |
||
| 24 | """ |
||
| 25 | return str(self.fromString(locationString)) |
||
| 26 |