@@ -85,15 +85,15 @@ def initial_inputs(self):
8585
8686 except :
8787 self .CONTINUE = False
88- documentation = ["usage create_structure " ,
88+ documentation = ["usage createstructure " ,
8989 "\t [--ignore= | -i=]" ,
9090 "\t [--organization= | -o=]" ,
9191 "\t [--sources= | -s=]" ,
9292 "\t [--template | -temp]"
9393 "\t [--token= | -t=]" ,
9494 "\t [--verbose | -v]" ,
9595 "" ,
96- "These are the create_structure arguments:" ,
96+ "These are the createstructure arguments:" ,
9797 "\t --ignore= or -i= (optional) The folders to be ignored" ,
9898 "\t --organization= or -o= (optional) The organization name, leave empty if you want to create repos in your personal account" ,
9999 "\t --sources= or -s= (optional) The array with your favourite sources, for eg. ['CastellaniDavide']" ,
@@ -133,7 +133,7 @@ def asks(self):
133133 if question_tag == "team" :
134134 self .ANSWERS ["team" ] = "" # default value
135135 if self .ORGANIZATION_NAME != "" : # If there is an organization
136- if create_structure .is_positive (input (f"{ self .get_emoji ('?' )} { current_quest } " )):
136+ if createstructure .is_positive (input (f"{ self .get_emoji ('?' )} { current_quest } " )):
137137 self .choose_team ()
138138 else :
139139 self .ANSWERS [question_tag ] = input (f"{ self .get_emoji ('?' )} { current_quest } " )
@@ -181,18 +181,18 @@ def create_repo(self):
181181 self .ANSWERS ['name' ] = self .ANSWERS ['name' ] + "-template"
182182
183183 if self .ORGANIZATION_NAME == "" :
184- self .repo = self .g .get_user ().create_repo (self .ANSWERS ['name' ] if (self .ANSWERS ['prefix' ] == "" ) else f"{ self .ANSWERS ['prefix' ]} -{ self .ANSWERS ['name' ]} " , description = self .ANSWERS ['descr' ], private = create_structure .is_positive (self .ANSWERS ['private' ]), has_issues = True , has_wiki = False , has_downloads = True , has_projects = False )
184+ self .repo = self .g .get_user ().create_repo (self .ANSWERS ['name' ] if (self .ANSWERS ['prefix' ] == "" ) else f"{ self .ANSWERS ['prefix' ]} -{ self .ANSWERS ['name' ]} " , description = self .ANSWERS ['descr' ], private = createstructure .is_positive (self .ANSWERS ['private' ]), has_issues = True , has_wiki = False , has_downloads = True , has_projects = False )
185185 else :
186186 if self .ANSWERS ["team" ] == "" :
187- self .repo = self .g .get_organization (self .ORGANIZATION_NAME ).create_repo (self .ANSWERS ['name' ] if (self .ANSWERS ['prefix' ] == "" ) else f"{ self .ANSWERS ['prefix' ]} -{ self .ANSWERS ['name' ]} " , description = self .ANSWERS ['descr' ], private = create_structure .is_positive (self .ANSWERS ['private' ]), has_issues = True , has_wiki = False , has_downloads = True , has_projects = False )
187+ self .repo = self .g .get_organization (self .ORGANIZATION_NAME ).create_repo (self .ANSWERS ['name' ] if (self .ANSWERS ['prefix' ] == "" ) else f"{ self .ANSWERS ['prefix' ]} -{ self .ANSWERS ['name' ]} " , description = self .ANSWERS ['descr' ], private = createstructure .is_positive (self .ANSWERS ['private' ]), has_issues = True , has_wiki = False , has_downloads = True , has_projects = False )
188188 else :
189189 # Create team if not exists
190190 try :
191191 self .g .get_organization (self .ORGANIZATION_NAME ).create_team (self .ANSWERS ["team" ], privacy = "closed" )
192192 except :
193193 pass
194194
195- self .repo = self .g .get_organization (self .ORGANIZATION_NAME ).create_repo (self .ANSWERS ['name' ] if (self .ANSWERS ['prefix' ] == "" ) else f"{ self .ANSWERS ['prefix' ]} -{ self .ANSWERS ['name' ]} " , description = self .ANSWERS ['descr' ], private = create_structure .is_positive (self .ANSWERS ['private' ]), has_issues = True , has_wiki = False , has_downloads = True , has_projects = False , team_id = [i for i in self .g .get_organization (self .ORGANIZATION_NAME ).get_teams () if i .name == self .ANSWERS ["team" ]][0 ].id )
195+ self .repo = self .g .get_organization (self .ORGANIZATION_NAME ).create_repo (self .ANSWERS ['name' ] if (self .ANSWERS ['prefix' ] == "" ) else f"{ self .ANSWERS ['prefix' ]} -{ self .ANSWERS ['name' ]} " , description = self .ANSWERS ['descr' ], private = createstructure .is_positive (self .ANSWERS ['private' ]), has_issues = True , has_wiki = False , has_downloads = True , has_projects = False , team_id = [i for i in self .g .get_organization (self .ORGANIZATION_NAME ).get_teams () if i .name == self .ANSWERS ["team" ]][0 ].id )
196196
197197 if self .ANSWERS ['name' ].endswith ("-template" ):
198198 self .ANSWERS ['name' ] = self .ANSWERS ['name' ][:len (self .ANSWERS ['name' ]) - len ("-template" ):]
@@ -230,7 +230,7 @@ def scan_and_elaborate(self, loc=""):
230230 self .create_file (".createstructure/change.json" , str (wget (f'https://raw.githubusercontent.com/createstructure/default-template/master/.createstructure/change.json' ).text ))
231231
232232 contents = self .template .get_contents (f"{ loc } " )
233- for content_file in sorted (contents , reverse = True , key = create_structure .name_of_path ): # Put .folders at the end
233+ for content_file in sorted (contents , reverse = True , key = createstructure .name_of_path ): # Put .folders at the end
234234 if not content_file .path in [".createstructure" , "" ] + self .IGNORE :
235235 if content_file .path == ".github/workflows" : # Wait the end of others before do workflows
236236 start_waiting = dt .now ().timestamp ()
@@ -306,5 +306,5 @@ def get_emoji(self, emoji):
306306if __name__ == "__main__" :
307307 """ Entry point
308308 """
309- create_structure () # Entry point
309+ createstructure () # Entry point
310310
0 commit comments