Don't generate __init__ files.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Fri, 15 Oct 2010 08:54:58 +0000 (04:54 -0400)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Fri, 15 Oct 2010 08:54:58 +0000 (04:54 -0400)
Makefile
PLC/Methods/__init__.py
PLC/__init__.py

index 3cc5ce7..ed75dce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ ifneq ($(PLC_now),$(PLC_files))
 PLC/__init__.py: force
 endif
 PLC/__init__.py: 
-       (echo '## Please use make index to update this file' ; echo 'all = """' ; cd PLC; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
+       echo "This step is obsolete"
 
 ########## Methods/
 # the current content of __init__.py
@@ -77,7 +77,7 @@ ifneq ($(METHODS_now),$(METHODS_files))
 PLC/Methods/__init__.py: force
 endif
 PLC/Methods/__init__.py: 
-       (echo '## Please use make index to update this file' ; echo 'native_methods = """' ; cd PLC/Methods; ls -1 *.py system/*.py | grep -v __init__ | sed -e 's,.py$$,,' -e 's,system/,system.,' ; echo '""".split()') > $@
+       echo "This step is obsolete"
 
 ##########
 
index f2c24ea..d72755e 100644 (file)
-## Please use make index to update this file
-native_methods = """
-AddAddressType
-AddAddressTypeToAddress
-AddBootState
-AddConfFile
-AddConfFileToNode
-AddConfFileToNodeGroup
-AddIlink
-AddInitScript
-AddInterface
-AddInterfaceTag
-AddKeyType
-AddLeases
-AddMessage
-AddNetworkMethod
-AddNetworkType
-AddNode
-AddNodeGroup
-AddNodeTag
-AddNodeToPCU
-AddNodeType
-AddPCU
-AddPCUProtocolType
-AddPCUType
-AddPeer
-AddPerson
-AddPersonKey
-AddPersonTag
-AddPersonToSite
-AddPersonToSlice
-AddRole
-AddRoleToPerson
-AddSession
-AddSite
-AddSiteAddress
-AddSiteTag
-AddSlice
-AddSliceInstantiation
-AddSliceTag
-AddSliceToNodes
-AddSliceToNodesWhitelist
-AddTagType
-AuthCheck
-BindObjectToPeer
-BlacklistKey
-BootCheckAuthentication
-BootGetNodeDetails
-BootNotifyOwners
-BootUpdateNode
-DeleteAddress
-DeleteAddressType
-DeleteAddressTypeFromAddress
-DeleteBootState
-DeleteConfFile
-DeleteConfFileFromNode
-DeleteConfFileFromNodeGroup
-DeleteIlink
-DeleteInitScript
-DeleteInterface
-DeleteInterfaceTag
-DeleteKey
-DeleteKeyType
-DeleteLeases
-DeleteMessage
-DeleteNetworkMethod
-DeleteNetworkType
-DeleteNode
-DeleteNodeFromPCU
-DeleteNodeGroup
-DeleteNodeTag
-DeleteNodeType
-DeletePCU
-DeletePCUProtocolType
-DeletePCUType
-DeletePeer
-DeletePerson
-DeletePersonFromSite
-DeletePersonFromSlice
-DeletePersonTag
-DeleteRole
-DeleteRoleFromPerson
-DeleteSession
-DeleteSite
-DeleteSiteTag
-DeleteSlice
-DeleteSliceFromNodes
-DeleteSliceFromNodesWhitelist
-DeleteSliceInstantiation
-DeleteSliceTag
-DeleteTagType
-GenerateNodeConfFile
-GetAddressTypes
-GetAddresses
-GetBootMedium
-GetBootStates
-GetConfFiles
-GetEventObjects
-GetEvents
-GetIlinks
-GetInitScripts
-GetInterfaceTags
-GetInterfaces
-GetKeyTypes
-GetKeys
-GetLeaseGranularity
-GetLeases
-GetMessages
-GetNetworkMethods
-GetNetworkTypes
-GetNodeFlavour
-GetNodeGroups
-GetNodeTags
-GetNodeTypes
-GetNodes
-GetPCUProtocolTypes
-GetPCUTypes
-GetPCUs
-GetPeerData
-GetPeerName
-GetPeers
-GetPersonTags
-GetPersons
-GetPlcRelease
-GetRoles
-GetSession
-GetSessions
-GetSiteTags
-GetSites
-GetSliceFamily
-GetSliceInstantiations
-GetSliceKeys
-GetSliceTags
-GetSliceTicket
-GetSlices
-GetSlivers
-GetTagTypes
-GetWhitelist
-NotifyPersons
-NotifySupport
-RebootNode
-RebootNodeWithPCU
-RefreshPeer
-ReportRunlevel
-ResetPassword
-ResolveSlices
-SetPersonPrimarySite
-SliceCreate
-SliceDelete
-SliceExtendedInfo
-SliceGetTicket
-SliceInfo
-SliceListNames
-SliceListUserSlices
-SliceNodesAdd
-SliceNodesDel
-SliceNodesList
-SliceRenew
-SliceTicketGet
-SliceUpdate
-SliceUserAdd
-SliceUserDel
-SliceUsersList
-UnBindObjectFromPeer
-UpdateAddress
-UpdateAddressType
-UpdateConfFile
-UpdateIlink
-UpdateInitScript
-UpdateInterface
-UpdateInterfaceTag
-UpdateKey
-UpdateLeases
-UpdateMessage
-UpdateNode
-UpdateNodeGroup
-UpdateNodeTag
-UpdatePCU
-UpdatePCUProtocolType
-UpdatePCUType
-UpdatePeer
-UpdatePerson
-UpdatePersonTag
-UpdateSite
-UpdateSiteTag
-UpdateSlice
-UpdateSliceTag
-UpdateTagType
-VerifyPerson
-system.listMethods
-system.methodHelp
-system.methodSignature
-system.multicall
-""".split()
+#!/usr/bin/python -tt
+
+import os
+native_methods = []
+toppath = os.path.dirname(__file__)
+for path, dirs, methods in os.walk(toppath):
+    remove_dirs = []
+    for dir in dirs:
+        if dir.startswith("."):
+            remove_dirs.append(dir)
+    for dir in remove_dirs:
+        dirs.remove(dir)
+    prefix = path + "/"
+    prefix = prefix[len(toppath) + 1:].replace("/", ".")
+    for method in methods:
+        if method == "__init__.py":
+            continue
+        if not method.endswith(".py"):
+            continue
+        native_methods.append(prefix + method[:-3])
index b892448..39b6f70 100644 (file)
@@ -1,57 +1,4 @@
-## Please use make index to update this file
-all = """
-API
-Accessor
-AddressTypes
-Addresses
-Auth
-Boot
-BootStates
-ConfFiles
-Config
-Debug
-EventObjects
-Events
-Faults
-Filter
-GPG
-Ilinks
-InitScripts
-InterfaceTags
-Interfaces
-KeyTypes
-Keys
-LeaseFilter
-Leases
-Messages
-Method
-Namespace
-NetworkMethods
-NetworkTypes
-NodeGroups
-NodeTags
-NodeTypes
-Nodes
-PCUProtocolTypes
-PCUTypes
-PCUs
-POD
-Parameter
-Peers
-PersonTags
-Persons
-PostgreSQL
-PyCurl
-Roles
-Sessions
-Shell
-SiteTags
-Sites
-SliceInstantiations
-SliceTags
-Slices
-Table
-TagTypes
-Timestamp
-sendmail
-""".split()
+#!/usr/bin/python -tt
+
+import os
+all = [i[:-3] for i in os.listdir(os.path.dirname(__file__)) if i.endswith(".py") and not i.startswith(".")]