+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: Python script to fix the Quake Live version problem on Linux

  1. #11
    Senior Member wolf1e is on a distinguished road
    Join Date
    Oct 2010
    Posts
    220
    Ph´nglui mglw´nafh Cthulhu R´lyeh wgah´nagl fhtagn.

    You really don't need to parse and "understand" the whole structure of the xml to change a single value. Don't look it as xml, it's just a single number surrounded by meaningless text.

  2. #12
    Junior Member samyboy is on a distinguished road
    Join Date
    Aug 2010
    Posts
    15
    At first, I wanted to make both functions: the xml way, and the regexp way and compare both in order to take the best.
    However, I first created the xml way and then got tired.

    If you really want the regexp way, I can make one. Do you really want the ability to use regexp instead of xml parsing?

  3. #13
    Senior Member wolf1e is on a distinguished road
    Join Date
    Oct 2010
    Posts
    220
    I would've done this to process the install.rdf file (in perl), i guess it's easy to port to python
    Code:
    #!/usr/bin/perl
    while (<>)
    {
        if ($_ =~ /maxVersion/)
        {
            $_ =~ s/\d+(\.\d+)*(\.\*)?/7/;
            print;
            next;
        }
        print;
    }

  4. #14
    Junior Member samyboy is on a distinguished road
    Join Date
    Aug 2010
    Posts
    15
    Yeah, that's actually a few more lines, but here you go. Just use the "--wolf1e" switch.

    Hope you like it lol.

  5. #15
    Senior Member wolf1e is on a distinguished road
    Join Date
    Oct 2010
    Posts
    220
    haha nice switch name :3

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts