Lucas Duailibe avatar Lucas Duailibe committed d6b03c0

correcting identation

Comments (0)

Files changed (2)

     ('media',              'text', True),
     ('albumdisambig',      'text', True),
     ('rg_album_gain',      'real', True),
-    ('rg_album_peak',      'real', True),
+    ('rg_album_peak',      'real', True),®
     ('original_year',      'int',  True),
     ('original_month',     'int',  True),
     ('original_day',       'int',  True),
         if not sanitize:
             mapping['path'] = displayable_path(self.path)
 
-	# Convert the import time to human readable
-	mapping['itime'] = time.strftime(ITIME_FORMAT, time.localtime(getattr(self, 'itime')))
+        # Convert the import time to human readable
+        mapping['itime'] = time.strftime(ITIME_FORMAT, time.localtime(getattr(self, 'itime')))
 
         # Use the album artist if the track artist is not set and
         # vice-versa.
 
     def match(self, item):
         for subq in self.subqueries:
-	    if subq.match(item):
-		return True
-	return False
+            if subq.match(item):
+                return True
+        return False
 
 class MutableCollectionQuery(CollectionQuery):
     """A collection query whose subqueries may be modified after the
     # Item manipulation.
 
     def add(self, item, copy=False):
-	item.itime = time.time()
-	item.library = self
-	if copy:
-	    self.move(item, copy=True)
+        item.itime = time.time()
+        item.library = self
+        if copy:
+            self.move(item, copy=True)
 
         # Build essential parts of query.
         columns = ','.join([key for key in ITEM_KEYS if key != 'id'])
 
     def add_album(self, items):
         """Create a new album in the database with metadata derived
-	from its items. The items are added to the database if they
-	don't yet have an ID. Returns an Album object.
-	"""
-	album_keys = ALBUM_KEYS_ITEM + ['itime']
+        from its items. The items are added to the database if they
+        don't yet have an ID. Returns an Album object.
+        """
+        album_keys = ALBUM_KEYS_ITEM + ['itime']
 
-	# Set the metadata from the first item.
-	album_values = dict(
+        # Set the metadata from the first item.
+        album_values = dict(
             (key, getattr(items[0], key)) for key in ALBUM_KEYS_ITEM)
 
-	# Manually set the date when the album was added,
-	# because the items don't yet have these
-	album_values['itime'] = time.time()
+        # Manually set the date when the album was added,
+        # because the items don't yet have these
+        album_values['itime'] = time.time()
 
-	with self.transaction() as tx:
-	    sql = 'INSERT INTO albums (%s) VALUES (%s)' % \
-		(', '.join(album_keys),
-		', '.join(['?'] * len(album_keys)))
-	    subvals = [album_values[key] for key in album_keys]
+        with self.transaction() as tx:
+            sql = 'INSERT INTO albums (%s) VALUES (%s)' % \
+                (', '.join(album_keys),
+                ', '.join(['?'] * len(album_keys)))
+            subvals = [album_values[key] for key in album_keys]
             album_id = tx.mutate(sql, subvals)
 
             # Add the items to the library.
         # Construct the new Album object.
         record = {}
         for key in ALBUM_KEYS:
-	    if key in album_keys:
-		record[key] = album_values[key]
+            if key in album_keys:
+                record[key] = album_values[key]
             else:
                 # Non-item fields default to None.
                 record[key] = None
         mapping['artpath'] = displayable_path(mapping['artpath'])
         mapping['path'] = displayable_path(self.item_dir())
 
-	# Convert the import time to human readable format
-	mapping['itime'] = time.strftime(ITIME_FORMAT, time.localtime(mapping['itime']))
+        # Convert the import time to human readable format
+        mapping['itime'] = time.strftime(ITIME_FORMAT, time.localtime(mapping['itime']))
 
         # Get template functions.
         funcs = DefaultTemplateFunctions().functions()
 
     @staticmethod
     def tmpl_format(s, format):
-	"""Format the import time to any format according to time.strfime()
-	"""
-	return time.strftime(format, time.strptime(s, ITIME_FORMAT))
+        """Format the import time to any format according to time.strfime()
+        """
+        return time.strftime(format, time.strptime(s, ITIME_FORMAT))
 
     def tmpl_aunique(self, keys=None, disam=None):
         """Generate a string that is guaranteed to be unique among all
 
     def test_mtime_up_to_date_after_read(self):
         self.i.title = 'something else'
-	self.i.read()
-	self.assertGreaterEqual(self.i.mtime, self._mtime())
+        self.i.read()
+        self.assertGreaterEqual(self.i.mtime, self._mtime())
 
 class ImportTimeTest(unittest.TestCase):
     def setUp(self):
-	self.lib = beets.library.Library(':memory:')
+        self.lib = beets.library.Library(':memory:')
 
     def test_itime_for_album(self):
-	self.track = item()
-	self.album = self.lib.add_album((self.track,))
-	self.assertGreater(self.album.itime, 0)
-	self.assertGreater(self.track.itime, 0)
+        self.track = item()
+        self.album = self.lib.add_album((self.track,))
+        self.assertGreater(self.album.itime, 0)
+        self.assertGreater(self.track.itime, 0)
 
     def test_atime_for_singleton(self):
-	self.singleton = item()
-	self.lib.add(self.singleton)
-	self.assertGreater(self.singleton.itime, 0)
+        self.singleton = item()
+        self.lib.add(self.singleton)
+        self.assertGreater(self.singleton.itime, 0)
 
 def suite():
     return unittest.TestLoader().loadTestsFromName(__name__)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.