Skip to content

Commit

Permalink
Cleanup class linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeSeren committed Apr 2, 2018
1 parent 98f0aa9 commit 86fc41f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions afew/MailMover.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: ISC
# Copyright (c) dtk <[email protected]>
"""This module contain the MailMover class"""

import os
import logging
Expand Down Expand Up @@ -28,19 +29,23 @@ def __init__(self, max_age=0, rename=False, dry_run=False):
start = date.today() - days
now = datetime.now()
self.query += ' AND {start}..{now}'.format(
start=start.strftime('%s'),
now=now.strftime('%s'))
start=start.strftime('%s'),
now=now.strftime('%s'))
self.dry_run = dry_run
self.rename = rename

""" return the new name """
def get_new_name(self, fname, destination):
if self.rename:
return os.path.join(
destination,
# construct a new filename, composed of a made-up ID
# and the flags part of the original filename.
str(uuid.uuid1()) + ':' + os.path.basename(fname).split(':')[-1]
)
destination,
# construct a new filename,
# composed of a made-up ID
# and the flags part of the original filename.
str(
uuid.uuid1())
+ ':'
+ os.path.basename(fname).split(':')[-1])
else:
return destination

Expand Down

0 comments on commit 86fc41f

Please sign in to comment.