Commits

Konstantine Rybnikov committed a6f54b5

add file even if it doesn't exist

Comments (0)

Files changed (1)

     
     def set_files(self, possible_files, base_path='.'):
         for file_ in possible_files:
-            file_path = os.path.join(base_path,
-                                     os.path.join(self.prefix,
-                                                  file_))
+            file_path = os.path.join(base_path, self.prefix, file_)
             if not os.path.exists(file_path):
                 log.warning(u'File %s does not exist' % file_path)
             elif not os.path.isfile(file_path):
                 log.warning(u'File %s is not a file (directory maybe?)' % file_path)
-            else:
-                self.files.append(file_)
+            self.files.append(file_)
 
     def __contains__(self, filename):
         return filename in self.files
         for filename in self.merge_groups[group_name].files:
             with codecs.open(
                 os.path.join(self.base_path,
-                             os.path.join(self.merge_groups[group_name].prefix,
-                                          filename)), 'r', 'utf-8') as f:
+                             self.merge_groups[group_name].prefix,
+                             filename), 'r', 'utf-8') as f:
                 ret_val += f.readlines()
         return ret_val
 
         with (codecs.open(
                 os.path.join(
                     self.base_path,
-                    os.path.join(self.merge_groups[group_name].prefix,
-                                 self.merge_groups[group_name].name)),
+                    self.merge_groups[group_name].prefix,
+                    self.merge_groups[group_name].name),
                 'w', 'utf-8')) as f:
             f.writelines(lines_to_save)
-
+    
     def get_group_by_filename(self, filename):
         """Returns None if there's no group for that file
         """