19 |
19 |
20 def formatTime(seconds): |
20 def formatTime(seconds): |
21 """ |
21 """ |
22 Module function to return a formatted time string. |
22 Module function to return a formatted time string. |
23 |
23 |
24 @param seconds time in seconds since epoch to be formatted (float or long) |
24 @param seconds time in seconds since epoch to be formatted |
25 @return formatted time string (string) |
25 @type float or int |
|
26 @return formatted time string |
|
27 @rtype str |
26 """ |
28 """ |
27 return ( |
29 return ( |
28 QDateTime.fromSecsSinceEpoch(int(seconds)) |
30 QDateTime.fromSecsSinceEpoch(int(seconds)) |
29 .toTimeSpec(Qt.TimeSpec.LocalTime) |
31 .toTimeSpec(Qt.TimeSpec.LocalTime) |
30 .toString("yyyy-MM-dd hh:mm:ss") |
32 .toString("yyyy-MM-dd hh:mm:ss") |
33 |
35 |
34 def dateFromTime_t(seconds): |
36 def dateFromTime_t(seconds): |
35 """ |
37 """ |
36 Module function to return the date. |
38 Module function to return the date. |
37 |
39 |
38 @param seconds time in seconds since epoch to be formatted (float or long) |
40 @param seconds time in seconds since epoch to be formatted |
39 @return date (QDate) |
41 @type float or int |
|
42 @return date |
|
43 @rtype QDate |
40 """ |
44 """ |
41 return ( |
45 return ( |
42 QDateTime.fromSecsSinceEpoch(int(seconds)) |
46 QDateTime.fromSecsSinceEpoch(int(seconds)) |
43 .toTimeSpec(Qt.TimeSpec.LocalTime) |
47 .toTimeSpec(Qt.TimeSpec.LocalTime) |
44 .date() |
48 .date() |
47 |
51 |
48 def getServersPath(): |
52 def getServersPath(): |
49 """ |
53 """ |
50 Module function to get the filename of the servers file. |
54 Module function to get the filename of the servers file. |
51 |
55 |
52 @return filename of the servers file (string) |
56 @return filename of the servers file |
|
57 @rtype str |
53 """ |
58 """ |
54 if OSUtilities.isWindowsPlatform(): |
59 if OSUtilities.isWindowsPlatform(): |
55 appdata = os.environ["APPDATA"] |
60 appdata = os.environ["APPDATA"] |
56 return os.path.join(appdata, "Subversion", "servers") |
61 return os.path.join(appdata, "Subversion", "servers") |
57 else: |
62 else: |
61 |
66 |
62 def getConfigPath(): |
67 def getConfigPath(): |
63 """ |
68 """ |
64 Module function to get the filename of the config file. |
69 Module function to get the filename of the config file. |
65 |
70 |
66 @return filename of the config file (string) |
71 @return filename of the config file |
|
72 @rtype str |
67 """ |
73 """ |
68 if OSUtilities.isWindowsPlatform(): |
74 if OSUtilities.isWindowsPlatform(): |
69 appdata = os.environ["APPDATA"] |
75 appdata = os.environ["APPDATA"] |
70 return os.path.join(appdata, "Subversion", "config") |
76 return os.path.join(appdata, "Subversion", "config") |
71 else: |
77 else: |