abc-gui-editor 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ #!/usr/bin/python3
@@ -0,0 +1,12 @@
1
+ # about.py
2
+
3
+ __version__ = "0.1.0"
4
+ __package__ = "abc_gui_editor"
5
+ __program_name__ = "abc-gui-editor"
6
+ __author__ = "Fernando Pujaico Rivera"
7
+ __email__ = "fernando.pujaico.rivera@gmail.com"
8
+ __description__ = "A graphic user interface program to work with abc notation."
9
+ __url_source__ = "https://github.com/trucomanx-desktop/AbcGuiEditor"
10
+ __url_doc__ = "https://github.com/trucomanx-desktop/AbcGuiEditor/tree/main/doc"
11
+ __url_funding__ = "https://trucomanx.github.io/en/funding.html"
12
+ __url_bugs__ = "https://github.com/trucomanx-desktop/AbcGuiEditor/issues"
@@ -0,0 +1,105 @@
1
+ import os
2
+ import subprocess
3
+ import abc_gui_editor.about as about
4
+ from abc_gui_editor.modules.resources import resource_path
5
+
6
+
7
+ def update_desktop_database(desktop_path):
8
+ applications_dir = os.path.expanduser(desktop_path)
9
+ try:
10
+ subprocess.run(
11
+ ["update-desktop-database", applications_dir],
12
+ check=True
13
+ )
14
+ print("Shortcut database updated successfully.")
15
+ except subprocess.CalledProcessError as e:
16
+ print(f"Error updating the database: {e}")
17
+ except FileNotFoundError:
18
+ print("The command 'update-desktop-database' was not found. Verify that the package 'desktop-file-utils' is installed.")
19
+
20
+ def create_desktop_file(desktop_path, overwrite=False, program_name=None, extras=""):
21
+
22
+ icon_path = resource_path('icons', 'logo.png')
23
+
24
+ if program_name is None:
25
+ __program_name = about.__program_name__
26
+ else:
27
+ __program_name = program_name
28
+
29
+ script_path = os.path.expanduser(f"~/.local/bin/{__program_name}")
30
+
31
+ desktop_entry = f"""[Desktop Entry]
32
+ Name={__program_name}
33
+ Comment={about.__description__}
34
+ Exec={script_path} %f
35
+ Terminal=false
36
+ Type=Application
37
+ Icon={icon_path}
38
+ StartupNotify=true
39
+ Categories=Education;ResearchTools;
40
+ Keywords=organizer;python;
41
+ Encoding=UTF-8
42
+ StartupWMClass={about.__package__}
43
+ {extras}
44
+ """
45
+ path = os.path.expanduser(os.path.join(desktop_path,f"{__program_name}.desktop"))
46
+
47
+ if not os.path.exists(path) or overwrite == True:
48
+ os.makedirs(os.path.dirname(path), exist_ok=True)
49
+ with open(path, "w") as f:
50
+ f.write(desktop_entry)
51
+ os.chmod(path, 0o755)
52
+ print(f"File {__program_name}.desktop created in {path}.")
53
+ update_desktop_database(desktop_path)
54
+
55
+ def create_desktop_directory( directory_name = "ResearchTools",
56
+ long_name = "Scientific research",
57
+ comment = "Tools for Writing and Research Support",
58
+ icon = "accessories-text-editor",
59
+ overwrite = False):
60
+
61
+ desktop_entry = f"""[Desktop Entry]
62
+ Version=1.0
63
+ Type=Directory
64
+ Name={long_name}
65
+ Comment={comment}
66
+ Icon={icon}
67
+ """
68
+ path = os.path.expanduser(f"~/.local/share/desktop-directories/{directory_name}.directory")
69
+
70
+ if not os.path.exists(path) or overwrite == True: # Evita sobrescrever
71
+ os.makedirs(os.path.dirname(path), exist_ok=True)
72
+ with open(path, "w") as f:
73
+ f.write(desktop_entry)
74
+ os.chmod(path, 0o755)
75
+ print(f"File {path} created.")
76
+
77
+ def create_desktop_menu(directory_name = "ResearchTools",
78
+ basename = "research-tools",
79
+ overwrite = False):
80
+
81
+ desktop_entry = f"""<!-- ~/.config/menus/applications-merged/{basename}.menu -->
82
+ <Menu>
83
+ <Name>Applications</Name>
84
+ <Menu>
85
+ <Name>{directory_name}</Name>
86
+ <Directory>{directory_name}.directory</Directory>
87
+ <Include>
88
+ <Category>{directory_name}</Category>
89
+ </Include>
90
+ </Menu>
91
+ </Menu>
92
+ """
93
+ path = os.path.expanduser(f"~/.config/menus/applications-merged/{basename}.menu")
94
+
95
+ if not os.path.exists(path) or overwrite == True: # Evita sobrescrever
96
+ os.makedirs(os.path.dirname(path), exist_ok=True)
97
+ with open(path, "w") as f:
98
+ f.write(desktop_entry)
99
+ print(f"File {path} created.")
100
+
101
+ if __name__ == '__main__':
102
+ create_desktop_menu()
103
+ create_desktop_directory()
104
+ create_desktop_file()
105
+
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 62 62" width="620" height="620" version="1.0">
3
+ <defs>
4
+ <linearGradient id="fieldGradient" gradientUnits="userSpaceOnUse" x1="42.9863" y1="7.01270" x2="22.0144" y2="51.9871">
5
+ <stop offset="0.0" stop-color="#BCD6FE"/>
6
+ <stop offset="1.0" stop-color="#6787D3"/>
7
+ </linearGradient>
8
+ <linearGradient id="edgeGradient" gradientUnits="userSpaceOnUse" x1="55.4541" y1="42.7529" x2="9.54710" y2="16.2485">
9
+ <stop offset="0.0" stop-color="#3057A7"/>
10
+ <stop offset="1.0" stop-color="#5A7AC6"/>
11
+ </linearGradient>
12
+ <radialGradient id="shadowGradient">
13
+ <stop offset="0.0" stop-color="#C0C0C0"/>
14
+ <stop offset="0.88" stop-color="#C0C0C0"/>
15
+ <stop offset="1.0" stop-color="#C0C0C0" stop-opacity="0.0"/>
16
+ </radialGradient>
17
+ </defs>
18
+ <circle id="shadow" r="26.5" cy="29.5" cx="32.5" fill="url(#shadowGradient)" transform="matrix(1.0648,0.0,0.0,1.064822,-2.1,1.0864)"/>
19
+ <circle id="field" r="25.8" cx="31" cy="31" fill="url(#fieldGradient)" stroke="url(#edgeGradient)" stroke-width="2"/>
20
+ <g id="info" fill="white">
21
+ <polygon points="23,25 35,25 35,44 39,44 39,48 23,48 23,44 27,44 27,28 23,28 23,25"/>
22
+ <circle r="4" cx="31" cy="17"/>
23
+ </g>
24
+ <script xmlns=""/></svg>
@@ -0,0 +1,255 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:cc="http://creativecommons.org/ns#"
7
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8
+ xmlns:svg="http://www.w3.org/2000/svg"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
+ width="273.06668"
13
+ height="273.06668"
14
+ viewBox="0 0 256 256"
15
+ id="svg2"
16
+ version="1.1"
17
+ inkscape:version="0.92.1 r15371"
18
+ sodipodi:docname="edit-add.svg">
19
+ <sodipodi:namedview
20
+ id="base"
21
+ pagecolor="#ffffff"
22
+ bordercolor="#666666"
23
+ borderopacity="1.0"
24
+ inkscape:pageopacity="0.0"
25
+ inkscape:pageshadow="2"
26
+ inkscape:zoom="1.8676757"
27
+ inkscape:cx="136.53334"
28
+ inkscape:cy="243.61831"
29
+ inkscape:document-units="px"
30
+ inkscape:current-layer="layer1"
31
+ showgrid="true"
32
+ units="px"
33
+ inkscape:window-width="1280"
34
+ inkscape:window-height="755"
35
+ inkscape:window-x="0"
36
+ inkscape:window-y="0"
37
+ inkscape:window-maximized="1">
38
+ <inkscape:grid
39
+ spacingy="5"
40
+ spacingx="5"
41
+ id="grid4191"
42
+ type="xygrid"
43
+ originx="0"
44
+ originy="0" />
45
+ </sodipodi:namedview>
46
+ <defs
47
+ id="defs4">
48
+ <inkscape:path-effect
49
+ is_visible="true"
50
+ id="path-effect4176"
51
+ effect="spiro" />
52
+ <inkscape:path-effect
53
+ effect="spiro"
54
+ id="path-effect4172"
55
+ is_visible="true" />
56
+ <inkscape:path-effect
57
+ effect="spiro"
58
+ id="path-effect4829"
59
+ is_visible="true" />
60
+ <inkscape:path-effect
61
+ effect="spiro"
62
+ id="path-effect4153"
63
+ is_visible="true" />
64
+ <inkscape:path-effect
65
+ effect="spiro"
66
+ id="path-effect4175"
67
+ is_visible="true" />
68
+ <clipPath
69
+ id="clipPath4174"
70
+ clipPathUnits="userSpaceOnUse">
71
+ <circle
72
+ r="128"
73
+ cy="924.36218"
74
+ cx="128"
75
+ id="circle4176"
76
+ style="fill:#cc2828;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
77
+ </clipPath>
78
+ <clipPath
79
+ id="clipPath4183"
80
+ clipPathUnits="userSpaceOnUse">
81
+ <circle
82
+ transform="rotate(-90)"
83
+ r="128"
84
+ cy="128.00002"
85
+ cx="-924.36218"
86
+ id="circle4185"
87
+ style="fill:#cc2828;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
88
+ </clipPath>
89
+ <clipPath
90
+ id="clipPath4187"
91
+ clipPathUnits="userSpaceOnUse">
92
+ <circle
93
+ r="128"
94
+ cy="924.36218"
95
+ cx="128"
96
+ id="circle4189"
97
+ style="fill:#cc2828;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
98
+ </clipPath>
99
+ <clipPath
100
+ id="clipPath4209"
101
+ clipPathUnits="userSpaceOnUse">
102
+ <circle
103
+ transform="rotate(-90)"
104
+ r="128"
105
+ cy="128"
106
+ cx="-924.36218"
107
+ id="circle4211"
108
+ style="fill:#cc2828;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
109
+ </clipPath>
110
+ <clipPath
111
+ id="clipPath4213"
112
+ clipPathUnits="userSpaceOnUse">
113
+ <circle
114
+ r="128"
115
+ cy="924.36218"
116
+ cx="128"
117
+ id="circle4215"
118
+ style="fill:#cc2828;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
119
+ </clipPath>
120
+ <clipPath
121
+ clipPathUnits="userSpaceOnUse"
122
+ id="clipPath4381">
123
+ <circle
124
+ r="128"
125
+ cy="640.4978"
126
+ cx="686.50537"
127
+ id="circle4383"
128
+ style="fill:#d83838;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
129
+ transform="rotate(38.940105)" />
130
+ </clipPath>
131
+ <clipPath
132
+ clipPathUnits="userSpaceOnUse"
133
+ id="clipPath4857">
134
+ <circle
135
+ r="128"
136
+ cy="924.36218"
137
+ cx="128"
138
+ id="circle4859"
139
+ style="fill:#68bdff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
140
+ </clipPath>
141
+ <clipPath
142
+ clipPathUnits="userSpaceOnUse"
143
+ id="clipPath5081">
144
+ <circle
145
+ style="fill:#68bdff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
146
+ id="circle5083"
147
+ cx="-127.94974"
148
+ cy="924.36218"
149
+ r="128"
150
+ transform="scale(-1,1)" />
151
+ </clipPath>
152
+ <clipPath
153
+ clipPathUnits="userSpaceOnUse"
154
+ id="clipPath5081-7">
155
+ <circle
156
+ style="fill:#68bdff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
157
+ id="circle5083-5"
158
+ cx="-127.94974"
159
+ cy="924.36218"
160
+ r="128"
161
+ transform="scale(-1,1)" />
162
+ </clipPath>
163
+ <clipPath
164
+ id="clipPath4286"
165
+ clipPathUnits="userSpaceOnUse">
166
+ <circle
167
+ r="128"
168
+ cy="927.36218"
169
+ cx="125"
170
+ id="circle4288"
171
+ style="fill:#ff7b68;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
172
+ </clipPath>
173
+ <clipPath
174
+ clipPathUnits="userSpaceOnUse"
175
+ id="clipPath4374">
176
+ <circle
177
+ style="fill:#27cdda;fill-opacity:1;stroke:none;stroke-width:31.56804466;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
178
+ id="circle4376"
179
+ cx="-554.68945"
180
+ cy="736.81812"
181
+ r="128"
182
+ transform="rotate(-45)" />
183
+ </clipPath>
184
+ <clipPath
185
+ clipPathUnits="userSpaceOnUse"
186
+ id="clipPath4389">
187
+ <circle
188
+ style="fill:#27cdda;fill-opacity:1;stroke:none;stroke-width:31.56804466;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
189
+ id="circle4391"
190
+ cx="-566.68945"
191
+ cy="742.81812"
192
+ r="128"
193
+ transform="rotate(-45)" />
194
+ </clipPath>
195
+ <clipPath
196
+ clipPathUnits="userSpaceOnUse"
197
+ id="clipPath4389-3">
198
+ <circle
199
+ style="fill:#27cdda;fill-opacity:1;stroke:none;stroke-width:31.56804466;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
200
+ id="circle4391-6"
201
+ cx="-566.68945"
202
+ cy="742.81812"
203
+ r="128"
204
+ transform="rotate(-45)" />
205
+ </clipPath>
206
+ </defs>
207
+ <metadata
208
+ id="metadata7">
209
+ <rdf:RDF>
210
+ <cc:Work
211
+ rdf:about="">
212
+ <dc:format>image/svg+xml</dc:format>
213
+ <dc:type
214
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
215
+ <dc:title />
216
+ </cc:Work>
217
+ </rdf:RDF>
218
+ </metadata>
219
+ <g
220
+ inkscape:label="Layer 1"
221
+ inkscape:groupmode="layer"
222
+ id="layer1"
223
+ transform="translate(0,-796.36216)">
224
+ <circle
225
+ r="128"
226
+ cy="924.36218"
227
+ cx="128"
228
+ id="path4172"
229
+ style="fill:#00a700;fill-opacity:1;stroke:none;stroke-width:31.56804466;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
230
+ <g
231
+ id="g4172"
232
+ transform="rotate(-45,122.87868,922.24084)"
233
+ style="fill:#00bfc3;fill-opacity:1;stroke:#ffffff;stroke-opacity:1">
234
+ <path
235
+ inkscape:connector-curvature="0"
236
+ inkscape:original-d="m 75,877.36216 100,100"
237
+ inkscape:path-effect="#path-effect4172"
238
+ id="path4174"
239
+ d="m 75,877.36216 100,100"
240
+ style="fill:#00bfc3;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:35;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
241
+ <path
242
+ style="fill:#00bfc3;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:35;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
243
+ d="m 175,877.36216 -100,100"
244
+ id="path4176"
245
+ inkscape:path-effect="#path-effect4176"
246
+ inkscape:original-d="m 175,877.36216 -100,100"
247
+ inkscape:connector-curvature="0" />
248
+ </g>
249
+ <g
250
+ style="fill:#159e36;fill-opacity:1;stroke:#008d90;stroke-linejoin:round;stroke-opacity:1"
251
+ id="g4180"
252
+ transform="rotate(45,355.20815,973.42818)"
253
+ clip-path="url(#clipPath4389-3)" />
254
+ </g>
255
+ </svg>
Binary file