Plugins/VcsPlugins/vcsPySvn/SvnUtilities.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1509
c0b5e693b0eb
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
11 11
12 from PyQt4.QtCore import QDateTime, Qt 12 from PyQt4.QtCore import QDateTime, Qt
13 13
14 import Utilities 14 import Utilities
15 15
16
16 def formatTime(seconds): 17 def formatTime(seconds):
17 """ 18 """
18 Module function to return a formatted time string. 19 Module function to return a formatted time string.
19 20
20 @param seconds time in seconds since epoch to be formatted (float or long) 21 @param seconds time in seconds since epoch to be formatted (float or long)
22 """ 23 """
23 return QDateTime.fromTime_t(int(seconds))\ 24 return QDateTime.fromTime_t(int(seconds))\
24 .toTimeSpec(Qt.LocalTime)\ 25 .toTimeSpec(Qt.LocalTime)\
25 .toString("yyyy-MM-dd hh:mm:ss") 26 .toString("yyyy-MM-dd hh:mm:ss")
26 27
28
27 def dateFromTime_t(seconds): 29 def dateFromTime_t(seconds):
28 """ 30 """
29 Module function to return the date. 31 Module function to return the date.
30 32
31 @param seconds time in seconds since epoch to be formatted (float or long) 33 @param seconds time in seconds since epoch to be formatted (float or long)
32 @return date (QDate) 34 @return date (QDate)
33 """ 35 """
34 return QDateTime.fromTime_t(int(seconds)).toTimeSpec(Qt.LocalTime).date() 36 return QDateTime.fromTime_t(int(seconds)).toTimeSpec(Qt.LocalTime).date()
37
35 38
36 def getServersPath(): 39 def getServersPath():
37 """ 40 """
38 Public method to get the filename of the servers file. 41 Public method to get the filename of the servers file.
39 42
44 return os.path.join(appdata, "Subversion", "servers") 47 return os.path.join(appdata, "Subversion", "servers")
45 else: 48 else:
46 homedir = Utilities.getHomeDir() 49 homedir = Utilities.getHomeDir()
47 return os.path.join(homedir, ".subversion", "servers") 50 return os.path.join(homedir, ".subversion", "servers")
48 51
52
49 def getConfigPath(): 53 def getConfigPath():
50 """ 54 """
51 Public method to get the filename of the config file. 55 Public method to get the filename of the config file.
52 56
53 @return filename of the config file (string) 57 @return filename of the config file (string)

eric ide

mercurial