Closed TanGentleman closed 9 months ago
I've experimented with both techniques, and honestly, really starting to prefer using a format like:
config = Config()
config.logfile = 'descriptive_name'
config.allow_newlines = False
listener = Collect(config)
simulator = Generate(config)
keys = listener.start_listener()
simulator.simulate_keystrokes(keys)
Compared to:
config = Config(logfile='name', allow_newlines=False)
...
or
```python
config = Config()
config.set(logfile='name', allow_newlines=False)
However, granular control without the need for a config object makes sense for many workflows.
logger = Collect()
logger.set_filename('name')
gen = Generate()
keys = gen.keystrokes_from_string("I can often perform most tasks without the need to declare a custom config object, but for something like allowing newlines, it might be the best practice for consistency.
Though the attributes can be better organized and possibly renamed, the implementation is clean and functional now. Closing issue.
I think the set method should have good error handling and typechecking, be the exposed client function. This would eliminate the need for client-exposed attributes, which can be unpredictable with arbitrary types (Python!)