blob: 8c9d19de8f2fe8e776542c7a2f9fd09e7a283dbb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
doit==0.28.0
Pygments>=1.6
Pillow>=2.4.0
-python-dateutil==2.4.2
+python-dateutil>=2.2
docutils>=0.12
mako>=1.0.0
unidecode>=0.04.16
--- a/nikola/plugins/command/init.py
+++ b/nikola/plugins/command/init.py
@@ -355,15 +355,13 @@
tz = dateutil.tz.gettz(answer)
if tz is None:
- print(" WARNING: Time zone not found. Searching list of time zones for a match.")
- zonesfile = tarfile.open(fileobj=dateutil.zoneinfo.getzoneinfofile_stream())
+ print(" WARNING: Time zone not found. Searching most common timezones for a match.")
+ zonesfile = tarfile.TarFile.open(os.path.join(dateutil.zoneinfo.ZONEINFOFILE))
zonenames = [zone for zone in zonesfile.getnames() if answer.lower() in zone.lower()]
if len(zonenames) == 1:
tz = dateutil.tz.gettz(zonenames[0])
- answer = zonenames[0]
- print(" Picking '{0}'.".format(answer))
elif len(zonenames) > 1:
- print(" The following time zones match your query:")
+ print(" Could not pick one timezone. Choose one of the following:")
print(' ' + '\n '.join(zonenames))
continue
@@ -372,7 +370,7 @@
print(" Current time in {0}: {1}".format(answer, time))
answered = ask_yesno("Use this time zone?", True)
else:
- print(" ERROR: No matches found. Please try again.")
+ print(" ERROR: Time zone not found. Please try again. Time zones are case-sensitive.")
SAMPLE_CONF['TIMEZONE'] = answer
|