Skip to content

Commit ba83c58

Browse files
authored
v7.5
1 parent ab24a08 commit ba83c58

File tree

6 files changed

+33
-11
lines changed

6 files changed

+33
-11
lines changed

choco/ReadMe.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# createstructure
2-
[![GitHub license](https://img.shields.io/badge/license-GNU-green?style=flat)](https://github.com/createstructure/createstructure/blob/master/LICENSE) ![Author](https://img.shields.io/badge/author-Castellani%20Davide-green?style=flat) ![Version](https://img.shields.io/badge/version-v7.4-blue?style=flat) ![Language Python](https://img.shields.io/badge/language-Python-yellowgreen?style=flat) ![sys.platform supported](https://img.shields.io/badge/OS%20platform%20supported-Linux,%20Windows%20&%20Mac%20OS-blue?style=flat) [![On GitHub](https://img.shields.io/badge/on%20GitHub-True-green?style=flat&logo=github)](https://github.com/createstructure/createstructure) ![PyPI](https://img.shields.io/pypi/v/createstructure)
2+
[![GitHub license](https://img.shields.io/badge/license-GNU-green?style=flat)](https://github.com/createstructure/createstructure/blob/master/LICENSE) ![Author](https://img.shields.io/badge/author-Castellani%20Davide-green?style=flat) ![Version](https://img.shields.io/badge/version-v7.5-blue?style=flat) ![Language Python](https://img.shields.io/badge/language-Python-yellowgreen?style=flat) ![sys.platform supported](https://img.shields.io/badge/OS%20platform%20supported-Linux,%20Windows%20&%20Mac%20OS-blue?style=flat) [![On GitHub](https://img.shields.io/badge/on%20GitHub-True-green?style=flat&logo=github)](https://github.com/createstructure/createstructure) ![PyPI](https://img.shields.io/pypi/v/createstructure)
33

44
![](https://github.com/CastellaniDavide/createstructure/raw/master/docs/createstructure.png)
55

@@ -186,8 +186,12 @@ With this program, you can easily create a repository on GitHub :octocat: with a
186186
- [2.0_2020-03-24](#20_2020-03-24)
187187
- [1.0_2020-03-24](#10_2020-03-24)
188188

189-
#### 7.3_2021-03-07
190-
- Fixed a minor bugs
189+
#### 7.5_2021-03-07
190+
- Fixed a bug
191+
- Added the avariability for not-texual files
192+
193+
#### 7.4_2021-03-07
194+
- Fixed a minor bug
191195

192196
#### 7.3_2021-03-07
193197
- Fixed few bugs

choco/createstructure.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
33
<metadata>
44
<id>createstructure</id>
5-
<version>7.4</version>
5+
<version>7.5</version>
66
<title>createstructure (Install)</title>
77
<authors>Castellani Davide</authors>
88
<projectUrl>https://github.com/createstructure/createstructure</projectUrl>

choco/tools/VERIFICATION.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ To check the correct funtionality try to:
77
- v7.2 0733B24BDEE31972D12D37C4A6BA115448516037A7B6291592A8CB5F31898EE3
88
- v7.3 0733B24BDEE31972D12D37C4A6BA115448516037A7B6291592A8CB5F31898EE3
99
- v7.4 0733B24BDEE31972D12D37C4A6BA115448516037A7B6291592A8CB5F31898EE3
10+
- v7.5 0733B24BDEE31972D12D37C4A6BA115448516037A7B6291592A8CB5F31898EE3
1011
- Do the login "createstructure -l" in a shell as An Administrator.
1112
- Create a repository ""createstructure"
1213
- If you want you can check it manually with the source, you can found it in this link: https://github.com/CastellaniDavide/create_structure

createstructure/__init__.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def initial_inputs(self):
8181
# Check all data
8282
assert(self.TOKEN != "TODO" and self.TOKEN != None and self.TOKEN != "***")
8383

84-
if self.VERBOSE : print(f"{self.get_emoji('i')}self.CONTINUE\t\t\t{self.CONTINUE}\n{self.get_emoji('i')}self.TOKEN\t\t\t{self.TOKEN}\n{self.get_emoji('i')}self.SOURCES_OF_TEMPLATES\t{self.SOURCES_OF_TEMPLATES}\n{self.get_emoji('i')}self.ORGANIZATION_NAME\t{self.ORGANIZATION_NAME}\n{self.get_emoji('i')}self.IGNORE\t\t\t{self.IGNORE}\n{self.get_emoji('i')}self.VERBOSE\t\t\t{self.VERBOSE}")
84+
if self.VERBOSE : print(f"{self.get_emoji('i')}self.CONTINUE\t\t\t{self.CONTINUE}\n{self.get_emoji('i')}self.TOKEN\t\t\t{self.TOKEN}\n{self.get_emoji('i')}self.ORGANIZATION_NAME\t{self.ORGANIZATION_NAME}\n{self.get_emoji('i')}self.IGNORE\t\t\t{self.IGNORE}\n{self.get_emoji('i')}self.VERBOSE\t\t\t{self.VERBOSE}")
8585

8686
except:
8787
self.CONTINUE = False
@@ -208,7 +208,7 @@ def choose_template(self):
208208
if "/" in self.ANSWERS['template']: # If it's yours
209209
try:
210210
self.template_name = self.g.get_repo(f"{self.ANSWERS['template']}").full_name
211-
assert(self.template.private == True)
211+
assert(self.g.get_repo(self.template_name).private == True)
212212
except:
213213
print(f"{self.get_emoji('i')}{self.ANSWERS['template']} not founded, now I want to use the default repo")
214214
self.template_name = "createstructure/default-template"
@@ -226,7 +226,7 @@ def scan_and_elaborate(self, loc=""):
226226
"""Scan all files in the repository and push it in the new directory (cahanging the necessary)
227227
"""
228228
if self.TEMPLATE and loc == "":
229-
self.create_file(".createstructure/change.json", str(wget(f'https://raw.githubusercontent.com/createstructure/default-template/master/.createstructure/change.json').text))
229+
self.create_file(".createstructure/change.json", self.g.get_repo("createstructure/default-template").get_contents(".createstructure/change.json").decoded_content.decode())
230230

231231
contents = self.template.get_contents(f"{loc}")
232232
for content_file in sorted(contents, reverse=True, key=createstructure.name_of_path): # Put .folders at the end
@@ -236,7 +236,10 @@ def scan_and_elaborate(self, loc=""):
236236
while (active_count() != 2 and dt.now().timestamp() - start_waiting < 60): pass # Wait the end of processes or 60 seconds (a minute)
237237

238238
if content_file.type == "file":
239-
Thread(target = self.create_file, args = (self.change(content_file.path), f"{self.change(wget(f'https://raw.githubusercontent.com/{self.template_name}/master/{content_file.path}').text)}")).start()
239+
try:
240+
Thread(target = self.create_file, args = (self.change(content_file.path), self.change(self.g.get_repo(self.template_name).get_contents(content_file.path).decoded_content.decode()))).start()
241+
except: # If it's not a text file (eg. is an image)
242+
Thread(target = self.create_file, args = (self.change(content_file.path), self.g.get_repo(self.template_name).get_contents(content_file.path).decoded_content)).start()
240243
else:
241244
Thread(target = self.scan_and_elaborate, args = (content_file.path, )).start()
242245

@@ -255,8 +258,11 @@ def change_map(self):
255258
change_map = {}
256259
change_map_special = {}
257260

261+
# escape value
262+
change_map["solsol"] = "sol"
263+
258264
# repo changes
259-
change_map = eval(wget(f"https://raw.githubusercontent.com/{self.template_name}/master/.createstructure/change.json").text)
265+
change_map = eval(self.g.get_repo(self.template_name).get_contents(".createstructure/change.json").decoded_content.decode())
260266

261267
# answer changes
262268
for key, value in self.ANSWERS.items():
@@ -276,7 +282,7 @@ def change(self, text):
276282
"""
277283
return compile("|".join(self.change_map_special.keys())).sub(lambda m: self.change_map_special[escape(m.group(0))], compile("|".join(self.change_map.keys())).sub(lambda m: self.change_map[escape(m.group(0))], text))
278284

279-
def create_file (self, path, file):
285+
def create_file(self, path, file):
280286
"""Create the file into the repo
281287
"""
282288
try:

debian/debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
createstructure (7.5) focal; urgency=medium
2+
3+
* Fixed a bug
4+
* Added the avariability for not-texual files
5+
6+
-- Castellani Davide <help@castellanidavide.it> Sun, 07 Mar 2021 10:08:00 +1000
7+
18
createstructure (7.4) focal; urgency=medium
29

310
* Fixed a minor bug

docs/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# createstructure
2-
[![GitHub license](https://img.shields.io/badge/license-GNU-green?style=flat)](https://github.com/createstructure/createstructure/blob/master/LICENSE) ![Author](https://img.shields.io/badge/author-Castellani%20Davide-green?style=flat) ![Version](https://img.shields.io/badge/version-v7.4-blue?style=flat) ![Language Python](https://img.shields.io/badge/language-Python-yellowgreen?style=flat) ![sys.platform supported](https://img.shields.io/badge/OS%20platform%20supported-Linux,%20Windows%20&%20Mac%20OS-blue?style=flat) [![On GitHub](https://img.shields.io/badge/on%20GitHub-True-green?style=flat&logo=github)](https://github.com/createstructure/createstructure) ![PyPI](https://img.shields.io/pypi/v/createstructure)
2+
[![GitHub license](https://img.shields.io/badge/license-GNU-green?style=flat)](https://github.com/createstructure/createstructure/blob/master/LICENSE) ![Author](https://img.shields.io/badge/author-Castellani%20Davide-green?style=flat) ![Version](https://img.shields.io/badge/version-v7.5-blue?style=flat) ![Language Python](https://img.shields.io/badge/language-Python-yellowgreen?style=flat) ![sys.platform supported](https://img.shields.io/badge/OS%20platform%20supported-Linux,%20Windows%20&%20Mac%20OS-blue?style=flat) [![On GitHub](https://img.shields.io/badge/on%20GitHub-True-green?style=flat&logo=github)](https://github.com/createstructure/createstructure) ![PyPI](https://img.shields.io/pypi/v/createstructure)
33

44
![](https://github.com/CastellaniDavide/createstructure/raw/master/docs/createstructure.png)
55

@@ -186,6 +186,10 @@ With this program, you can easily create a repository on GitHub :octocat: with a
186186
- [2.0_2020-03-24](#20_2020-03-24)
187187
- [1.0_2020-03-24](#10_2020-03-24)
188188

189+
#### 7.5_2021-03-07
190+
- Fixed a bug
191+
- Added the avariability for not-texual files
192+
189193
#### 7.4_2021-03-07
190194
- Fixed a minor bug
191195

0 commit comments

Comments
 (0)