Code Duplication    Length = 23-23 lines in 2 locations

elodie/elodie.py 1 location

@@ 155-177 (lines=23) @@
152
    log.progress('', True)
153
    result.write()
154
155
@click.command('verify')
156
@click.option('--debug', default=False, is_flag=True,
157
              help='Override the value in constants.py with True.')
158
def _verify(debug):
159
    constants.debug = debug
160
    result = Result()
161
    db = Db()
162
    for checksum, file_path in db.all():
163
        if not os.path.isfile(file_path):
164
            result.append((file_path, False))
165
            log.progress('x')
166
            continue
167
168
        actual_checksum = db.checksum(file_path)
169
        if checksum == actual_checksum:
170
            result.append((file_path, True))
171
            log.progress()
172
        else:
173
            result.append((file_path, False))
174
            log.progress('x')
175
176
    log.progress('', True)
177
    result.write()
178
179
180
def update_location(media, file_path, location_name):

elodie.py 1 location

@@ 155-177 (lines=23) @@
152
    log.progress('', True)
153
    result.write()
154
155
@click.command('verify')
156
@click.option('--debug', default=False, is_flag=True,
157
              help='Override the value in constants.py with True.')
158
def _verify(debug):
159
    constants.debug = debug
160
    result = Result()
161
    db = Db()
162
    for checksum, file_path in db.all():
163
        if not os.path.isfile(file_path):
164
            result.append((file_path, False))
165
            log.progress('x')
166
            continue
167
168
        actual_checksum = db.checksum(file_path)
169
        if checksum == actual_checksum:
170
            result.append((file_path, True))
171
            log.progress()
172
        else:
173
            result.append((file_path, False))
174
            log.progress('x')
175
176
    log.progress('', True)
177
    result.write()
178
179
180
def update_location(media, file_path, location_name):