~phill-ridout/openlp/pathlib3

« back to all changes in this revision

Viewing changes to openlp/core/ui/mainwindow.py

  • Committer: Philip Ridout
  • Date: 2017-08-12 17:45:56 UTC
  • Revision ID: phill.ridout@gmail.com-20170812174556-qtfxujhclyeci7jl
Convert some more utility fuctions over to using the pathlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from datetime import datetime
31
31
from distutils import dir_util
32
32
from distutils.errors import DistutilsFileError
 
33
from pathlib import Path
33
34
from tempfile import gettempdir
34
35
 
35
36
from PyQt5 import QtCore, QtGui, QtWidgets
864
865
        setting_sections.extend([plugin.name for plugin in self.plugin_manager.plugins])
865
866
        # Copy the settings file to the tmp dir, because we do not want to change the original one.
866
867
        temp_directory = os.path.join(str(gettempdir()), 'openlp')
867
 
        check_directory_exists(temp_directory)
 
868
        check_directory_exists(Path(temp_directory))
868
869
        temp_config = os.path.join(temp_directory, os.path.basename(import_file_name))
869
870
        shutil.copyfile(import_file_name, temp_config)
870
871
        settings = Settings()