/[gli]/trunk/src/net/server/html/webgli/timezone.pyhtml
Gentoo

Contents of /trunk/src/net/server/html/webgli/timezone.pyhtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1253 - (show annotations) (download)
Sun Jan 15 21:29:08 2006 UTC (12 years, 11 months ago) by codeman
File size: 1526 byte(s)
  webgli/configfiles:
  	check for key in etc_files['rc.conf'] to fix key error
  webgli/timezone: small fix.

1 <? include /webgli/top.pyhtml ?>
2 <?
3 error_msg = ""
4 if post_params['back']:
5 zonepath = post_params['tzback']
6 if get_params['zonepath']:
7 zonepath = get_params['zonepath']
8 if zonepath[-1] != "/":
9 try:
10 shared_info.install_profile.set_time_zone(None, zonepath[20:], None)
11 error_msg = "Timezone Set"
12 except:
13 error_msg = "ERROR: Could not set that timezone!"
14 if not "UTC" in zonepath: # set conf value to local if not already set.
15 etc_files = shared_info.install_profile.get_etc_files()
16 if not "conf.d/clock" in etc_files:
17 etc_files['conf.d/clock'] = {}
18 etc_files['conf.d/clock']['CLOCK'] = "local"
19 try:
20 shared_info.install_profile.set_etc_files(etc_files)
21 except:
22 error_msg += "ERROR: Could not set the clock to local!"
23 else:
24 zonepath = "/usr/share/zoneinfo/"
25 skiplist = ["zone.tab","iso3166.tab","posixrules"]
26 tzlist = []
27 if os.path.isdir(zonepath):
28 for entry in os.listdir(zonepath):
29 if entry not in skiplist:
30 if os.path.isdir(zonepath + "/" + entry): entry += "/"
31 tzlist.append(entry)
32 tzlist.sort()
33 ?>
34 <h2>Timezone Setup </h2>
35 <: if error_msg:
36 <br><% error_msg %><br><br>
37 :>
38 Timezones:<br>
39 <form name="Timezone" method="post" action="/webgli/timezone.pyhtml" enctype="multipart/form-data">
40 <input type="hidden" name="tzback" value="<% zonepath %>"><br>
41 <: for timezone in tzlist:
42 <a href="/webgli/timezone.pyhtml?zonepath=<% zonepath+timezone %>"><% timezone %></a><br>
43 :>
44 <br><input type="submit" name="back" value="Back">
45 </form>
46 <? include /webgli/bottom.pyhtml ?>

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20