Revision: 48305
Author:   kim
Date:     2009-03-11 09:45:16 +0000 (Wed, 11 Mar 2009)

Log Message:
-----------
update_self now supports revision numbers

Modified Paths:
--------------
    trunk/wikiation/installer/installation_system.py
    trunk/wikiation/installer/installer.py
    trunk/wikiation/installer/installer_util.py

Modified: trunk/wikiation/installer/installation_system.py
===================================================================
--- trunk/wikiation/installer/installation_system.py    2009-03-11 09:38:42 UTC 
(rev 48304)
+++ trunk/wikiation/installer/installation_system.py    2009-03-11 09:45:16 UTC 
(rev 48305)
@@ -70,7 +70,7 @@
                return None
 
        def do_get_revisions_generic(self, installer):
-               """directly query svn to get a list of available revisions. 
Most of the time, this is adequate."""
+               """directly query svn to get a list of available revisions. 
Usually this is adequate."""
                svnbase=self.get_svnbase()
                if svnbase:
                        location=svnbase+"/"+installer

Modified: trunk/wikiation/installer/installer.py
===================================================================
--- trunk/wikiation/installer/installer.py      2009-03-11 09:38:42 UTC (rev 
48304)
+++ trunk/wikiation/installer/installer.py      2009-03-11 09:45:16 UTC (rev 
48305)
@@ -117,11 +117,18 @@
        """uninstall something"""
        installers.uninstall(args)
 
-def update_self(ignored_args):
+def update_self(args):
        """update self to newest revision, (and switch to interactive mode)"""
 
+       
        os.chdir(settings.installerdir) 
-       os.system("svn update")
+       if len(args)==1:
+               os.system("svn update")
+       elif len(args)>=2 and isanint(args[1]):
+               os.system("svn update "+args[1])
+       elif len(args)>=2:
+               print "I'm not sure what to do with "+ (" ".join(args[1:]))
+
        print "\n\n"
        print "wikiation_installer update attempted/completed. Restarting"
        print "----------------------------------------------------------"

Modified: trunk/wikiation/installer/installer_util.py
===================================================================
--- trunk/wikiation/installer/installer_util.py 2009-03-11 09:38:42 UTC (rev 
48304)
+++ trunk/wikiation/installer/installer_util.py 2009-03-11 09:45:16 UTC (rev 
48305)
@@ -132,6 +132,12 @@
             cr = (25, 80)
     return int(cr[1]), int(cr[0])
 
+def isanint(value):
+       try:
+               num=int(value)
+       except ValueError:
+               return False
+       return True
 
 if __name__=="__main__":
        print "some tests for the utils module"
@@ -140,3 +146,9 @@
        x=[str(i) for i in x]
        print x
        print pretty_list(x)
+
+       print "isanint(0)",isanint(0)
+       print "isanint('22')",isanint('22')
+       print "isanint('22.foo')",isanint('22.foo')
+       print "isanint('foo.22')",isanint('foo.22')
+       print "isanint('bar')",isanint('bar')



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to