Author: bugman Date: Tue Dec 18 10:25:18 2012 New Revision: 18157 URL: http://svn.gna.org/viewcvs/relax?rev=18157&view=rev Log: Created the generic_fns.domain.get_domain_ids() function. This will be used in the GUI for domain related user functions. Modified: branches/frame_order_testing/generic_fns/domain.py Modified: branches/frame_order_testing/generic_fns/domain.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/domain.py?rev=18157&r1=18156&r2=18157&view=diff ============================================================================== --- branches/frame_order_testing/generic_fns/domain.py (original) +++ branches/frame_order_testing/generic_fns/domain.py Tue Dec 18 10:25:18 2012 @@ -38,3 +38,24 @@ # Store the domain info. cdp.domain[id] = spin_id + + +def get_domain_ids(): + """Return the list of all domain ID strings. + + @return: The list of all domain IDs. + @rtype: list of str + """ + + # No pipe. + if cdp == None: + return [] + + # No domain data. + if not hasattr(cdp, 'domain'): + return [] + + # The domain IDs, sorted. + ids = cdp.domain.keys() + ids.sort() + return ids