~alecu/ubuntuone-client/show-main-exceptions

« back to all changes in this revision

Viewing changes to ubuntuone/platform/os_helper/darwin.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena, Diego Sarmentero, manuel.delapena at canonical
  • Date: 2012-07-11 17:06:31 UTC
  • mfrom: (1272.1.26 clean-fsevents)
  • Revision ID: tarmac-20120711170631-ttg2pugml5fr61mx
Refactor that simplifies the way the diff implementations per platform are done so that in future branches is simpler to add the daemon code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
 
128
128
 
129
129
def os_path(path_indexes=None):
 
130
    if path_indexes is None:
 
131
        path_indexes = [0]
 
132
 
130
133
    def decorator(func):
131
134
        def wrapped(*args, **kwargs):
 
135
            for i in path_indexes:
 
136
                assert isinstance(args[i], str), 'Path %r should be str.'
132
137
            return func(*args, **kwargs)
133
138
        return wrapped
134
139
    return decorator