Hi Dmitrijs, Thanks for your suggestionsand response. I had tried to obtain the grub information to display OS in exsting partitions timely , but because the response of function named "partman_column_syst" was too much, It led to the partition to die. That is why I use the global variables named "GRUB_OPTIONS". You can see the function in my patch uploaded to launchpad. If I use (1) to display OS, partition will die. So I use (2) to finish it. Like this:
def partman_column_syst(self, unused_column, cell, model, iterator, user_data): if not model[iterator][1]: return partition = model[iterator][1] #options = misc.grub_options() (1) global GRUB_OPTIONS options = GRUB_OPTIONS (2) if 'id' not in partition: cell.set_property('text', '') elif (partition['parted']['fs'] != 'free' and partition['parted']['fs'] != 'linux-swap'): for opt in options: if partition['parted']['path'] in opt: cell.set_property('text', '%s' % opt[1]) elif partition['parted']['type'] == 'unusable': cell.set_property('text', '') else: cell.set_property('text', '') Next, I will try another way, maybe I need more time to analysis, and I need you give me some suggestions about this. Thank you. At 2013-01-21 18:10:24,"Dmitrijs Ledkovs" <launch...@surgut.co.uk> wrote: >Hello, > >Thank you very much for submitting your patch. The proposed >feature - showing detected file systems in the advanced >partitioner table is very nice and useful. > >One question, does /dev/sda1 always stay as "Windows", even if it >was already marked to be formatted and used by the new >installation? I.e. is there a way to "expire" the >misc.grub_options? Although that's a corner case and gets more >tricky if partman changes are applied & reverted. > >Here are some further comments about the patch & structure. > >Usually, we don't use global variables like the introduced >GRUB_OPTIONS to store state or pass data around. (The other >defined global variables are constants). > >For example, since all of this is happening in the PageGtk >object, one can store misc.grub_options() in >self.grub_options_cache. And simply use that when generating the >table view. > >Please don't include #----start/end--- markers, as they are >redundant. The provided patch already clearly shows your changes. > >You may find it useful to use bzr to branch lp:ubiquity source >code, and then push branches back to launchpad and create merge >proposals. That way one doesn't need to maintain patches of their >own. For example see this recent merge proposal [1]. Further >documentation on how to download a branch, push your changes back >and make a merge proposal can be found here [2]. > >Once again. Thank you for your idea and patch to implement it. > >[1] https://code.launchpad.net/~laney/ubiquity/webcam- >gst-1.0/+merge/143136 > >[2] https://help.launchpad.net/Code > >** Changed in: ubiquity (Ubuntu) > Importance: Undecided => Medium > >-- >You received this bug notification because you are subscribed to the bug >report. >https://bugs.launchpad.net/bugs/1100694 > >Title: > display OS in existing partitions > >Status in “ubiquity” package in Ubuntu: > Confirmed > >Bug description: > This is used for a Chinese customized release named "UbuntuKylin" . We > want to display system already installed on a partition on the > advanced partitioning page of ubiquity. > > In Ubuntu 13.04 and the previous versions, the advanced partitioning > page only display six contents, they are device_name, partition_type, > mountpoint, format, partition_size and partition_size_used. > > In order to know the existing partitions are what the systems better, > UbuntuKylin need to add the content of existing OS after the above six > contents. > > ProblemType: Requirement for UbuntuKylin(Bug) > DistroRelease: Ubuntu 13.04 > Package: ubiquity_2.13.9 > ProcVersionSignature: Ubuntu 3.8.0-0-generic > Uname: Linux 3.8.0-0-generic i686 > Date: Thu, 17 Jan 2013 17:22:30 > >To manage notifications about this bug go to: >https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1100694/+subscriptions -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1100694 Title: display OS in existing partitions To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1100694/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs