myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [3012] myserver-get: added http and ftp protocols supp


From: Daniele Perrone
Subject: [myserver-commit] [3012] myserver-get: added http and ftp protocols support.
Date: Tue, 24 Feb 2009 17:56:04 +0000

Revision: 3012
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3012
Author:   dperrone
Date:     2009-02-24 17:56:03 +0000 (Tue, 24 Feb 2009)

Log Message:
-----------
myserver-get: added http and ftp protocols support. Removed binary files from 
svn.

Modified Paths:
--------------
    trunk/misc/myserver-get/myserverGetLib/general.py
    trunk/misc/myserver-get/myserverGetLib/remote.py
    trunk/misc/myserver-get/repositories.xml

Added Paths:
-----------
    trunk/misc/myserver-get/list.xml-example
    trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py

Removed Paths:
-------------
    trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
    trunk/plugins/pub/python-0.1-linux64.tar.gz
    trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
    trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz

Added: trunk/misc/myserver-get/list.xml-example
===================================================================
--- trunk/misc/myserver-get/list.xml-example                            (rev 0)
+++ trunk/misc/myserver-get/list.xml-example    2009-02-24 17:56:03 UTC (rev 
3012)
@@ -0,0 +1,8 @@
+<!--TO PUT INTO REPOSITORY ROOT -->
+<PLUGINS revision="1">
+    <PLUGIN>php</PLUGIN>
+    <PLUGIN>python_http_handler</PLUGIN>
+    <PLUGIN>rules_checker</PLUGIN>
+    <PLUGIN>python</PLUGIN>
+    <PLUGIN>http_checker</PLUGIN>
+</PLUGINS>

Modified: trunk/misc/myserver-get/myserverGetLib/general.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/general.py   2009-02-23 22:53:42 UTC 
(rev 3011)
+++ trunk/misc/myserver-get/myserverGetLib/general.py   2009-02-24 17:56:03 UTC 
(rev 3012)
@@ -3,6 +3,7 @@
 import config
 import remote
 import remoteSvn
+import remoteGenericUrl
 import console
 
 class MyServerGet:
@@ -11,6 +12,8 @@
         self.__listDir = listDir
         self.__repManager = remote.RepositoryManager()
         self.__repManager.addSupportedRepository("svn",remoteSvn.RepositorySvn)
+        
self.__repManager.addSupportedRepository("http",remoteGenericUrl.RepositoryGenericUrl)
+        
self.__repManager.addSupportedRepository("ftp",remoteGenericUrl.RepositoryGenericUrl)
         self.__list = []
         self.loadRepositoryList()
     

Modified: trunk/misc/myserver-get/myserverGetLib/remote.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remote.py    2009-02-23 22:53:42 UTC 
(rev 3011)
+++ trunk/misc/myserver-get/myserverGetLib/remote.py    2009-02-24 17:56:03 UTC 
(rev 3012)
@@ -19,8 +19,12 @@
     
     def getRepository(self, url):
         url = string.lower(url)
-        if string.find(url,"svn")!=-1:
+        if string.find(url,"svn")==0:
             return self.__reps["svn"]
+        elif string.find(url,"http")==0:
+            return self.__reps["http"]
+        elif string.find(url,"ftp")==0:
+            return self.__reps["ftp"]
         return None
             
 if __name__ == "__main__":

Added: trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py                  
        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py  2009-02-24 
17:56:03 UTC (rev 3012)
@@ -0,0 +1,48 @@
+import local
+import error
+import xml.dom.minidom
+from remote import Repository
+import console
+import urllib
+
+class RepositoryGenericUrl(Repository):
+    def __init__ (self,url):
+        Repository.__init__(self,url)
+        self.__pluginsXml = None
+
+    def __getPluginsList(self):
+        plugins = urllib.urlopen(self.url + "/list.xml")
+        self.__pluginsXml = xml.dom.minidom.parse(plugins)
+        
+    
+    def synchronizeListWithRepository(self, list):
+        console.write("update: "+ list.repository + '\n')
+        console.write("loading ")
+        localRevision = int(list.getRevision())
+        if self.__pluginsXml == None:
+            self.__getPluginsList()
+        pluginsElement = self.__pluginsXml.getElementsByTagName("PLUGINS")
+        remoteRevision = int(pluginsElement[0].getAttribute("revision"))
+        console.write(". ")
+        if localRevision == remoteRevision:
+            console.write("local list already updated.\n")
+        if localRevision > remoteRevision:
+            raise error.FatalError("Local plugins list corrupted!!")
+        
+        if localRevision < remoteRevision:
+            list.resetToEmptyListFile(`remoteRevision`)
+            console.write(". ")
+            
+            pluginElements = self.__pluginsXml.getElementsByTagName("PLUGIN")
+            plugins = [plugin.firstChild.data for plugin in pluginElements]
+
+            console.write(". ")
+            for plugin in plugins:
+                url = self.url + "/src/" + plugin + "/plugin.xml"
+                pluginXml =  xml.dom.minidom.parse(urllib.urlopen(url))
+                console.write(". ")
+                element = pluginXml.getElementsByTagName("PLUGIN")
+                pluginInfo = list.addPluginWithXml(element[0])
+            list.synchronizeListWithFileSystem()
+            console.write("DONE.\n")
+


Property changes on: trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py
___________________________________________________________________
Added: svn:mergeinfo
   + 

Modified: trunk/misc/myserver-get/repositories.xml
===================================================================
--- trunk/misc/myserver-get/repositories.xml    2009-02-23 22:53:42 UTC (rev 
3011)
+++ trunk/misc/myserver-get/repositories.xml    2009-02-24 17:56:03 UTC (rev 
3012)
@@ -1,3 +1,3 @@
 <REPOSITORIES>
-   <REPOSITORY>svn://svn.savannah.gnu.org/myserver/trunk/plugins</REPOSITORY>
+   <REPOSITORY>http://localhost/plugins</REPOSITORY>
 </REPOSITORIES>
\ No newline at end of file

Deleted: trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/plugins/pub/python-0.1-linux64.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz
===================================================================
(Binary files differ)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]