Esempio n. 1
0
    def parse(name, defGroup=Tags.global_):
        """
        create a Tag instance from a fully specified tag name string.

        A substring prior to a colon is assumed to be the group name.  If
        there is not group name, it is assumed to be of the group given by
        defGroup (which defaults to global).
        """
        # This is requires python 2.4
        #   parts = name.rsplit(':', 1)
        # replaced with:
        parts = name.split(':')
        if len(parts) > 2:
            try:
                parts = ":".join(parts[:-1], parts[-1])
            except Exception as e:
                import eups; eups.debug(e)

        if len(parts) == 1:
            return Tag(name, defGroup)
        else:
            if parts[0] == "user":
                parts[0] = Tags.user
            elif parts[0] == "" or parts[0] == "global":
                parts[0] = Tags.global_
            elif parts[0] == "tag":
                return Tag(parts[1])    # unknown tag, probably from a version name

            return Tag(parts[1], parts[0])
Esempio n. 2
0
    def parse(name, defGroup=Tags.global_):
        """
        create a Tag instance from a fully specified tag name string.
        
        A substring prior to a colon is assumed to be the group name.  If
        there is not group name, it is assumed to be of the group given by
        defGroup (which defaults to global).  
        """
        # This is requires python 2.4
        #   parts = name.rsplit(':', 1)
        # replaced with:
        parts = name.split(':')
        if len(parts) > 2:
            try:
                parts = ":".join(parts[:-1], parts[-1])
            except Exception as e:
                import eups; eups.debug(e)

        if len(parts) == 1:
            return Tag(name, defGroup)
        else:
            if parts[0] == "user":
                parts[0] = Tags.user
            elif parts[0] == "" or parts[0] == "global":
                parts[0] = Tags.global_
            elif parts[0] == "tag":
                return Tag(parts[1])    # unknown tag, probably from a version name

            return Tag(parts[1], parts[0])
Esempio n. 3
0
 def parse(name, defGroup=Tags.global_):
     """
     create a Tag instance from a fully specified tag name string.
     
     A substring prior to a colon is assumed to be the group name.  If
     there is not group name, it is assumed to be of the group given by
     defGroup (which defaults to global).  
     """
     # This is requires python 2.4
     #   parts = name.rsplit(':', 1)
     # replaced with:
     parts = name.split(':')
     if len(parts) > 2:
         try:
             parts = ":".join(parts[:-1], parts[-1])
         except Exception, e:
             import eups; eups.debug(e)
Esempio n. 4
0
 def parse(name, defGroup=Tags.global_):
     """
     create a Tag instance from a fully specified tag name string.
     
     A substring prior to a colon is assumed to be the group name.  If
     there is not group name, it is assumed to be of the group given by
     defGroup (which defaults to global).  
     """
     # This is requires python 2.4
     #   parts = name.rsplit(':', 1)
     # replaced with:
     parts = name.split(':')
     if len(parts) > 2:
         try:
             parts = ":".join(parts[:-1], parts[-1])
         except Exception, e:
             import eups
             eups.debug(e)