From 7e274bfbbebae63f812c0ce9afb924937537e44e Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Thu, 30 Mar 2023 10:55:01 +0200 Subject: [PATCH] deleted pointless files --- src/python.py | 61 -------------- src/test.db | Bin 65536 -> 0 bytes src/test.py | 1 - src/try-programming-interface.py | 133 ------------------------------- src/try.py | 3 - src/try_python.py | 41 ---------- 6 files changed, 239 deletions(-) delete mode 100644 src/python.py delete mode 100644 src/test.db delete mode 100644 src/test.py delete mode 100644 src/try-programming-interface.py delete mode 100644 src/try.py delete mode 100644 src/try_python.py diff --git a/src/python.py b/src/python.py deleted file mode 100644 index af1c3e7..0000000 --- a/src/python.py +++ /dev/null @@ -1,61 +0,0 @@ -class SuperFoo: - ATTRIBUTES: tuple = tuple() - -class Foo(SuperFoo): - def __init__(self, bar1, bar2, bar3) -> None: - self.bar1 = bar1 - self.bar2 = bar2 - self.bar3 = bar3 - - ATTRIBUTES: tuple = ("bar1", "bar2", "bar3") - - -def process(child_instance: SuperFoo): - for attribute in child_instance.ATTRIBUTES: - print(getattr(child_instance, attribute)) - -process(Foo(123, 456, 789)) - -""" -Hi! - -I got following code *(It is a very simplified and broken down example)*: - -```python -class SuperFoo: - ATTRIBUTES: tuple = tuple() - -class Foo(SuperFoo): - def __init__(self, bar1, bar2, bar3) -> None: - self.bar1 = bar1 - self.bar2 = bar2 - self.bar3 = bar3 - - ATTRIBUTES: tuple = (Foo.bar1, Foo.bar2, Foo.bar3) - - -def process(child_instance: SuperFoo): - for attribute in child_instance.ATTRIBUTES: - print(getattr(child_instance, attribute)) - -process(Foo(123, 456, 789)) -``` - -the output I expect would be: - -``` -> 123 -> 456 -> 789 -``` - -Obviously this doesn't work, instead the IDE warns me that `Foo` is not defined, and the error which is raised says so as well. - -``` -ATTRIBUTES: tuple = (Foo.bar1, Foo.bar2, Foo.bar3) -NameError: name 'Foo' is not defined -``` - -While I completely get why this happens, I have no clue how to solve it. -Any help would be appreciated. -""" \ No newline at end of file diff --git a/src/test.db b/src/test.db deleted file mode 100644 index 42f100548b3c19afe1579226081daf3873953a7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65536 zcmeI*&2Q6Y90zc_PTC~2btP0q6^A{HO|$~jyf(=Y+fo)-M@gYg#Fz$=V>_ueHz~0L zRN6G9j9qr$Kd}4uPwcdzf#AYz2acRTLSxbnd;C0cUOEbCHC~FoR+>2W^Ekif^E`eW zzojeZ7fr_?m3m`Mbx2&85JXY!Co%#ofMq3IA|gX-ohnL2+rzi@gXUpVT` zV~g`<_Rl-Dw47TwohN5<7pJ{t%#h{WsoZide=@hiKWy66XS}8LxjzG1~%sn@E!blowzuW;SzowC_9lNUW9Jbsd2Dv*3}anTD)^+I6++axmW zQpHf6X2Wn(%`Yu2=Cb+DqR1z?Q`zETfkeE8_Lj9BMPEtXV0Uk`J~|Sfni5;bdCju| zaGbF|5uBrD2s7Bc!VC&( zqiQ((InZaor)@E4x55|IQN^^jlyY5lR$Y;bNH`o8Z(iVSne}4s({P^>>$$cdc{M*EmSZ|xtDTP#5!TaLYT2;7 z#r5g&p3QdXs&Bgqx~{#gtbdNK(l7lzLpP5*r_|mZ=+C3on>DAg(aF`#Q&t;VUGFZi zJBP()*Bk9spwn;DzRF&wYpA!d?R%@x%*^m`_(XWy^_p!Pq6~lJ#+bxf^vx!#sg-)O zp&9(y*H>43+A}I^(2Ckv?-bW9ZKs=UugDF}D;cYfEwh`AZcRQTw`MdP)vP%#H5Kb* z?&-qm97Q3WgeM|I`H)af(AE%vo?rIuBsO8Q*GwJnh~GCgWDE8`oDEYzUQrG zyb?-L{_5Y%iX-94N%1?QU3s;ty9pZFQgOBF?yJq)V7TS)Hd52>R#$hbWz?#?qhhsi z)XhW9+mk7@StDzvWtq02)oZ#7;CsYYiIr4D)sxs`gcT1?aT?s!`(`>Ao=d zddxS0yczzt3-r?TZKzq>=if*U4-JQpPj0uaxSTF`tt!#4nC||(Fh>7G`A>m9FhBqT z5P$##AOHafKmY;|fB*y_ur~$X5d+e!8@lwxuLnLg=`p%WqrOI*RfDWFYvXs8Lv)@f z|1Ho51_(d^0uX=z1Rwwb2tWV=5P$##-Zp_@Nea?q0`B>L-?&eZf0o}J|B;ShfB*y_ z009U<00Izz00bZafwxwmCHsQKaHcgG2ukU6GMSE~VoEX|Eh~v+Y)(n*5luD9XJl;-JuK(i}`RVgjj>8R0|&7>mfc!HjlZUv=aaVpai13|wUt3hV-u)6;r7GxsuMIVT2+lbHjwp5mEAN;h;}iR$IJ zl1N44O1Z4gDXO8)r7C4ZP0Ur?+p3;zlFTI1iA0?4|GVe^eexwi{zbkoUy{FnYa2NV z1_1~_00Izz00bZa0SG_<0uXpv0@G4a9OQtC&rLYUaSq8%ILJYWp~F%!ILI*qe*gai zL4NSE5U^YbKmY;|fB*y_009U<00Izz00drvzyWbodY^vIn7gkZpjTJ8*IbbHH5a)5 z{}t2#J^}&|fB*y_009U<00Izz00bcLx&++&|LL&+e*XWiAm4pmf#7o?009U<00Izz z00bZa0SG_<0ub1_z){g(q`&u{s8qCMvXW3Dkz_?lMAAtmLw~(Msm!I5dL@=I%H?SL z{(n)vFVF`D2tWV=5P$##AOHafKmY;|fB*#cn1Fl#{~(6|aQ*)tt5}2!0SG_<0uX=z z1Rwwb2tWV=5ZH-8&;S1uCU%k$X(0ds2tWV=5P$##AOHafKmY;|*lPmr`G4&H@3mS( zybyo@1Rwwb2tWV=5P$##AOL}#3GmzBSC(&+l3(?1Rwwb2tWV=5P$##AOHafKmY=7oWPjqll%etpa1v) w0KWhKSdbsTagib*2tWV=5P$##AOHafKmY;|fB*z`Eifudl7IZpGT;CI7pZ8=@&Et; diff --git a/src/test.py b/src/test.py deleted file mode 100644 index 57d44fe..0000000 --- a/src/test.py +++ /dev/null @@ -1 +0,0 @@ -from music_kraken import objects \ No newline at end of file diff --git a/src/try-programming-interface.py b/src/try-programming-interface.py deleted file mode 100644 index 6b09d91..0000000 --- a/src/try-programming-interface.py +++ /dev/null @@ -1,133 +0,0 @@ -import music_kraken as mk -print(mk.__path__) - -# if you simply wan't to run the buildin minimal cli just do this: -# mk.cli() - -# SEARCH - -""" -The whole programm takes the data it processes further from the cache, a sqlite database. -So bevore you can do anything, you will need to fill it with the songs you -wan't to download. -For now the base of everything is musicbrainz, so you need to get the -musicbrainz id and the type the id corresponds to (artist/release group/release/track). -To get this you first have to initialize a search object (music_kraken.metadata.metadata_search.Search). -""" - -search_object = src.music_kraken.audio_source_not_used_anymore.metadata.metadata_search.Search() - -""" -Then you need an initial "text search" to get some options you can choose from. For -this you can either specify artists releases and whatever directly with: - - Search.search_from_text(self, artist: str = None, release_group: str = None, recording: str = None) -Or you can search with a text Querry like in the default cli: - - Search.search_from_query(self, query: str) -""" - -multiple_options = search_object.search_from_text(artist=input("input the name of the artist: ")) - -""" -both possible methods return an instance of MultipleOptions. It can just be -printed or converted to a string. -""" - -print(multiple_options) - -""" -After the first "text search" you can either again search again with the same function, -or you can further explore one of the options from the previous search. -For this simply call Search.choose(self, index: int). -The index represents the number in the previously returned instance of MultipleOptions. -The element which has been chosen with `choose(i)` will be selectend, -and can be downloaded with following steps - -Thus this has to be done **after either search_from_text or search_from_query** -""" - -# choosing the best matching band -multiple_options = search_object.choose(0) -# choosing the first ever release group of this band -multiple_options = search_object.choose(1) -# printing out the current options -print(multiple_options) - -""" -This process can be repeated indefenetly (until you run out of memory). -A search history is kept in the Search instance. You could go back to -the previous search like this: - -multiple_options = search.get_previous_options() -""" - -# DOWNLOADING METADATA / FILLING UP THE CACHE DB - -""" -If you selected the Option you want with `Search.choose(i)`, you can -finally download the metadata of either: - - an artist (the whole discography) - - a release group - - a release - - a track/recording -To download you need the selected Option Object (`music_kraken.metadata.metadata_search.Option`) -it is simply stored in Search.current_option. - -If you already know what you wan't to download you can skip all the steps above and just create -a dictionary like this and use it later (*might change and break after I add multiple metadata sources which I will*): -```python -{ - 'type': option_type, - 'id': musicbrainz_id -} -``` -The option type is a string (I'm sorry for not making it an enum I know its a bad pratice), which can -have following values: - - 'artist' - - 'release_group' - - 'release' - - 'recording' -**PAY ATTENTION TO TYPOS, ITS CASE SENSITIVE** - -The musicbrainz id is just the id of the object from musicbrainz. -""" - -# in this example I will choose the previous selected option. -option_to_download = search_object.current_option -print(option_to_download) - -""" -If you got the Option instance you want to download, then downloading the metadata is really straight -forward so I just show the code. -""" - -# I am aware of abstrackt classes -metadata_downloader = src.music_kraken.audio_source_not_used_anymore.metadata.metadata_fetch.MetadataDownloader() -metadata_downloader.download({'type': option_to_download.type, 'id': option_to_download.id}) - -""" -This will add the requested songs to the cache database. -""" - - -# CACHE / TEMPORARY DATABASE -""" -All the data can be gotten from the temporary database / cache. -You can get the database object like this: -""" - -cache = mk.database.temp_database.temp_database -print(cache) - -""" -When fetching any song data from the cache, you will get it as Song -object (music_kraken.database.song.Song). There are multiple methods -to get different sets of Songs. The names explain the methods pretty -well: - - get_track_metadata(id: str) - - get_tracks_to_download() - - get_tracks_without_src() - - get_tracks_without_isrc() - - get_tracks_without_filepath() - -the id always is a musicbrainz id and distinct for every track -""" diff --git a/src/try.py b/src/try.py deleted file mode 100644 index 5433071..0000000 --- a/src/try.py +++ /dev/null @@ -1,3 +0,0 @@ -from tests import test_objects - - diff --git a/src/try_python.py b/src/try_python.py deleted file mode 100644 index d44e67a..0000000 --- a/src/try_python.py +++ /dev/null @@ -1,41 +0,0 @@ -from typing import Optional - - -class TreeNode: - """A class representing a binary tree node.""" - - def __init__(self, val: int = 0, left: Optional['TreeNode'] = None, right: Optional['TreeNode'] = None): - """ - Initializes a new instance of the TreeNode class. - - Args: - val: The value of the node. - left: The left child of the node. - right: The right child of the node. - """ - self.val = val - self.left = left - self.right = right - - -def invert_tree(root: Optional[TreeNode]) -> Optional[TreeNode]: - """ - Inverts a binary tree. - - Args: - root: The root node of the binary tree. - - Returns: - The root node of the inverted binary tree. - """ - if root is None: - return None - - # Swap left and right children of the root node - root.left, root.right = root.right, root.left - - # Recursively invert the left and right subtrees - invert_tree(root.left) - invert_tree(root.right) - - return root