blob: 2c4cc75a566085562472b54c77ebd163335a24ae (
plain)
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
|
<? include /webgli/top.pyhtml ?>
<?
drive_to_partition = shared_info.drive_to_partition
partlist = shared_info.devices[drive_to_partition].get_ordered_partition_list()
tmpparts = shared_info.devices[drive_to_partition] #.get_partitions()
?>
<: if not post_params['editpart']:
ERROR: You must select a partition to edit!<br>
<!-- return wrap_in_webgli_template(data) -->
<: else:
<?
editpart = float(post_params['editpart'])
if not editpart == -1:
tmppart = tmpparts[float(editpart)]
if post_params["DelPartition"] == "DELETE PARTITION" or post_params["Cancel"] == "Cancel":
if post_params["DelPartition"] == "DELETE PARTITION":
shared_info.devices[drive_to_partition].remove_partition(editpart)
self.redirect("/webgli/partitioning2.pyhtml?editdrive=" + drive_to_partition)
elif editpart == -1 or tmppart.get_type() == "free":
if not int(post_params['size']):
print "ERROR: you must specify a size in MB"
# return wrap_in_webgli_template(data)
else:
new_minor = shared_info.devices[drive_to_partition].add_partition(editpart, int(post_params['size']), 0, 0, post_params['filesystem'])
self.redirect("/webgli/partitioning3.pyhtml?editpart=" + str(int(new_minor)))
else:
tmppart = tmpparts[editpart]
tmppart.set_format(post_params['format'])
tmppart.set_mkfsopts(post_params['fsopts'])
tmppart.set_mountopts(post_params['mountopts'])
tmppart.set_mountpoint(post_params['mountpoint'])
self.redirect("/webgli/partitioning2.pyhtml?editdrive=" + drive_to_partition)
?>
:>
<? include /webgli/bottom.pyhtml ?>
|