sfa/methods/__init__.py should be maintained with 'make index'
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 15 Oct 2010 13:17:46 +0000 (15:17 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 15 Oct 2010 13:17:46 +0000 (15:17 +0200)
Makefile
sfa/methods/__init__.py

index 04ac659..84b999c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-## (Re)builds Python metafile (__init__.py) and documentation
+## (Re)builds Python metafile (__init__.py) 
 # 
 # overwritten by the specfile
 DESTDIR="/"
@@ -42,13 +42,36 @@ wsdl-clean:
        $(MAKE) -C wsdl clean
 
 .PHONY: wsdl wsdl-install wsdl-clean
-##########
 
-# are the .java files used ?
+########## refreshing methods package metafile
+# Metafiles - manage Legacy/ and Accessors by hand
+init := sfa/methods/__init__.py 
+
+index: $(init)
+
+index-clean:
+       rm $(init)
+
+methods_now := $(sort $(shell fgrep -v '"' sfa/methods/__init__.py 2>/dev/null))
+# what should be declared
+methods_paths := $(filter-out %/__init__.py, $(wildcard sfa/methods/*.py))
+methods_files := $(sort $(notdir $(methods_paths:.py=)))
+
+ifneq ($(methods_now),$(methods_files))
+sfa/methods/__init__.py: force
+endif
+sfa/methods/__init__.py: 
+       (echo '## Please use make index to update this file' ; echo 'all = """' ; cd sfa/methods; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
+
+force:
+
+##########
 tags:  
        find . -type f | egrep -v '/\.git/|/\.svn/|TAGS|\.py[co]$$|\.doc$$|\.html$$|\.pdf$$' | xargs etags
 .PHONY: tags
 
+signatures:
+       grep 'def.*call' sfa/methods/*.py > sfa/methods/SIGNATURES
 
 ########## sync
 # 2 forms are supported
index 6aa7927..a585d93 100644 (file)
@@ -1,30 +1,34 @@
+## Please use make index to update this file
 all = """
+CreateSliver
+DeleteSliver
 GetCredential
-GetSelfCredential
 GetGids
-get_aggregates
-get_key
-get_registries
-get_trusted_certs
+GetSelfCredential
+GetTicket
+GetVersion
 List
+ListResources
+ListSlices
 RedeemTicket
 Register
-register_peer_object
+RegisterPeerObject
 Remove
-reset_slice
+RemovePeerObject
+RenewSliver
 Resolve
-Update
-remove_peer_object
-GetTicket
-GetVersion
-ListResources
-ListSlices
-CreateSliver
-UpdateSliver
-DeleteSliver
+ResolveGENI
+Shutdown
 SliverStatus
-RenewSliver
 Start
 Stop
-Shutdown
+Update
+UpdateSliver
+get_aggregates
+get_key
+get_registries
+get_trusted_certs
+register_peer_object
+remove_peer_object
+reset_slice
 """.split()