blob: ea73cdd2b54e9c9b04c5b0ab36fa3e743596f2f9 [file] [log] [blame]
martin f. krafftf37f0682013-06-14 16:36:20 +02001#
2# -*- coding: utf-8 -*-
3#
4# This file is part of reclass (http://github.com/madduck/reclass)
5#
6# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
7# Released under the terms of the Artistic Licence 2.0
8#
9from mergers.base import BaseMerger
10
11class BaseListMerger(BaseMerger):
12
13 def merge(self, first, second):
14 first = [first] if not isinstance(first, list) else first[:]
martin f. kraffta95eaa32013-06-16 11:56:41 +020015 if second is None:
16 return first
martin f. krafftf37f0682013-06-14 16:36:20 +020017 second = [second] if not isinstance(second, list) else second[:]
18 return self._combine(first, second)