View Single Post
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#73
Originally Posted by noobmonkey View Post
There is alot lol!

Code:
if g.strip() == "3.2010.02-8":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.1.1")
        elif g.strip() == "2.2009.51-1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.1")
        elif g.strip() == "2009.51-1.203.2":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.1 UK Generic Version")
        elif g.strip() == "2009.51-1.203.1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.1 UK Generic Version")
        elif g.strip() == "2009.51-1.205.1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.1 UK Vodafone Version")
        elif g.strip() == "2009.51-1.205.2":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.1 UK Vodafone Version")
        elif g.strip() == "1.2009.44-1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1.01")
        elif g.strip() == "1.2009.42-11":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 - Initial public release ")
        elif g.strip() == "1.2009.42-11.002":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 USA Version")
        elif g.strip() == "1.2009.42-11.003":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 Mid-East/N-Africa Version")
        elif g.strip() == "1.2009.42-11.203":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Generic Version")
        elif g.strip() == "1.2009.42-11.203.0":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Generic Version")
        elif g.strip() == "1.2009.42-11.203.1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Generic Version")
        elif g.strip() == "1.2009.42-11.203.2":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Generic Version")
        elif g.strip() == "1.2009.42-11.205":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Vodafone Version")
        elif g.strip() == "1.2009.42-11.205.0":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Vodafone Version")
        elif g.strip() == "1.2009.42-11.205.1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Vodafone Version")
        elif g.strip() == "1.2009.42-11.205.2":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Pr 1 UK Vodafone Version")
        elif g.strip() == "1.2009.41-1":
            self.lbl_Maemo_Ver_Info.setText(g.strip() + " - Early Release Vanilla Variant")
        else:
           self.lbl_Maemo_Ver_Info.setText(g + " - Varient unknown -")
Ouch - you'd be better splitting the version string down and handling the parts separately. Probably the easiest method would be to split on hyphens first, giving you two strings A and B, then you can split A on dots (with either 1+2 or 2+3 being the year+week combination identifying the PR code), and B on dots as well (with the 2nd entry, if present, being the variant). You could also use a regex but that could get a bit more messy.
 

The Following User Says Thank You to Rob1n For This Useful Post: