eric6/Project/ProjectFile.py

branch
jsonfiles
changeset 8012
ecf45f723038
parent 8006
c4110b8b5931
child 8015
09b24828d787
equal deleted inserted replaced
8011:630a173cb137 8012:ecf45f723038
6 """ 6 """
7 Module implementing a class representing the project JSON file. 7 Module implementing a class representing the project JSON file.
8 """ 8 """
9 9
10 import json 10 import json
11 import os
12 import time 11 import time
13 import typing 12 import typing
14 13
15 from PyQt5.QtCore import QObject 14 from PyQt5.QtCore import QObject
16 15
45 @param filename name of the project file 44 @param filename name of the project file
46 @type str 45 @type str
47 @return flag indicating a successful write 46 @return flag indicating a successful write
48 @rtype bool 47 @rtype bool
49 """ 48 """
50 name = os.path.splitext(os.path.basename(filename))[0]
51
52 projectDict = {} 49 projectDict = {}
53 projectDict["header"] = { 50 projectDict["header"] = {
54 "comment": f"eric project file for project {name}", 51 "comment": "eric project file for project {0}".format(
52 self.__project.getProjectName()),
55 "copyright": "Copyright (C) {0} {1}, {2}".format( 53 "copyright": "Copyright (C) {0} {1}, {2}".format(
56 time.strftime('%Y'), 54 time.strftime('%Y'),
57 self.__project.pdata["AUTHOR"], 55 self.__project.pdata["AUTHOR"],
58 self.__project.pdata["EMAIL"]) 56 self.__project.pdata["EMAIL"])
59 } 57 }

eric ide

mercurial