Skip to content

Commit 5523c12

Browse files
Use poetry and add FPNavigator (Closes #2)
1 parent 205e28e commit 5523c12

File tree

14 files changed

+1245
-422
lines changed

14 files changed

+1245
-422
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __pycache__
1111
# Build folder and version
1212
/build
1313
build.txt
14+
auth
1415

1516
# any sub build folder
1617
**/build

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
## General Overview
2+
"fpclib" stands for "Flashpoint Curation Library" and is a powerful collection of functions and classes you can use and extend to hopefully curate any game/animation in existence through python3. If you're not familiar with curating for Flashpoint and would like to know how to curate, first follow the [Curation Tutorial](https://bluemaxima.org/flashpoint/datahub/Curation_Tutorial) page on the Flashpoint wiki. If you're not familiar with using python or coding, you should read the [official python tutorial](https://docs.python.org/3/tutorial/index.html) before using this library.
3+
4+
Although there are already several useful tools you can use for manually curating games/animations for Flashpoint and downloading assets easily, such as Flashpoint Core, cURLsDownloader, and MAD4FP, none of these tools offer the ability to curate through code or automate the process; fpclib was created to fix that. [fpcurator](https://github.com/FlashpointProject/fpcurator) uses fpclib to automatically generate curations. Of course, you should still always manually check any curation you make with fpclib in Flashpoint Core to make sure it works properly.
5+
6+
There are numerous benefits of using fpclib/fpcurator to help you curate:
7+
8+
* By default, fpclib downloads main game/animation files and puts them in the right file format based upon your launch commands.
9+
* Logos and screenshots can be automatically downloaded from online and converted to PNG files.
10+
* Curating similar games/animations from one or more websites is simple and easy thanks to the `fpclib.curate()` function.
11+
* **Nearly every kind of Curation is possible to make with this library!** This library and documentation were created with the intent of making it easy to overwrite the Curation class to make it do different things. Anything you can do in the "Curate" tab in Flashpoint Core you can do with fpclib, except test games.
12+
13+
Here's some example code of using the library to curate "Interactive Buddy" from Newgrounds:
14+
```python
15+
# Import fpclib curation
16+
from fpclib import Curation
17+
18+
# Create a curation from a given url
19+
curation = Curation(url='https://www.newgrounds.com/portal/view/218014')
20+
# Set the logo of the curation
21+
curation.logo = 'https://picon.ngfiles.com/218000/flash_218014_medium.gif'
22+
23+
# You can set metadata through the object directly or through the set_meta method
24+
curation.set_meta(title='Interactive Buddy', tags=['Simulation', 'Toy'])
25+
curation.set_meta(dev='Shock Value', pub='Wrong Publisher')
26+
curation.pub = 'Newgrounds'
27+
curation.ver = '1.01'
28+
curation.date = '2005-02-08'
29+
30+
# Add an additional app
31+
curation.set_meta(cmd='http://uploads.ungrounded.net/218000/218014_DAbuddy_latest.swf')
32+
curation.add_app('Kongregate v1.02', 'http://chat.kongregate.com/gamez/0003/0303/live/ib2.swf?kongregate_game_version=1363985380')
33+
34+
# Export this curation to the current working directory
35+
curation.save()
36+
```
37+
38+
You can also test the library by running the script directly or with `fpclib.test()`, which will also curate "Interactive Buddy" in the current working directory, delete the curation, and check an invalid curation.
39+
40+
## More Reading
41+
42+
You can read more about this library in the [official documentation](https://www.mathgeniuszach.com/bin/fpclib/).
43+
44+
## Usage
45+
46+
You can install the library with:
47+
```
48+
pip install fpclib
49+
```
50+
51+
or you can put the "fpclib" script (check the releases page) in the same directory as your script.
52+
53+
If you choose the second option, you'll also need to install these libraries through pip:
54+
```
55+
pip install requests
56+
pip install beautifulsoup4
57+
pip install pillow
58+
pip install ruamel.yaml
59+
```
60+
61+
Once you have all of that set up, you can put `import fpclib` at the top of your script to use it's methods.
62+
63+
## License
64+
65+
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.

README.rst

Lines changed: 0 additions & 69 deletions
This file was deleted.

build.bat

Lines changed: 0 additions & 18 deletions
This file was deleted.

doc/source/about.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ About
77
| **Version**: |version|
88
| **Special Thanks**:
99
10-
* **DarkMoe** for inspiring me with his hard work and many Curations.
10+
* **DarkMoe** for inspiring this project with his hard work and many Curations.
1111
* **XXLuigiMario** for making the original AutoCurator.
12-
* **eientei** and **afrmtbl** for bits and bobs of stuff.
12+
* **prostagma** for actively reporting bugs, adding features, and site definitions to fpcurator.
13+
* **Luvexina**, **eientei**, **afrmtbl** for bits and bobs of stuff.

doc/source/conf.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@
1212
#
1313
import os
1414
import sys
15+
import toml
16+
from pathlib import Path
1517

1618
sys.path.insert(0, os.path.abspath('../../'))
17-
import metadata
18-
19+
project = toml.load(Path(__file__).parent.parent.parent / "pyproject.toml")
20+
metadata = project["tool"]["poetry"]
1921

2022
# -- Project information -----------------------------------------------------
2123

22-
project = metadata.NAME
23-
author = metadata.AUTHOR
24-
release = metadata.VERSION
24+
project = metadata["name"]
25+
author = metadata["authors"][0].split()[0]
26+
release = metadata["version"]
2527

2628
# -- General configuration ---------------------------------------------------
2729

@@ -77,4 +79,4 @@
7779
7880
.. |version| replace:: %s
7981
80-
""" % (metadata.NAME, metadata.AUTHOR, metadata.RELEASE)
82+
""" % (project, author, release)

doc/source/globals.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Regexes
3737

3838
:hide:`WAYBACK_LINK`
3939
^^^^^^^^^^^^^^^^^^^^
40-
40+
4141
.. autodata:: WAYBACK_LINK
4242
:annotation:
4343

@@ -136,6 +136,31 @@ Application Paths
136136

137137
.. autodata:: SVR
138138

139+
:hide:`SHIVA3D`
140+
^^^^^^^^^^^^^^^
141+
142+
.. autodata:: SHIVA3D
143+
144+
:hide:`BROWSER_MODE`
145+
^^^^^^^^^^^^^^^^^^^^
146+
147+
.. autodata:: BROWSER_MODE
148+
149+
:hide:`CHROME`
150+
^^^^^^^^^^^^^^
151+
152+
.. autodata:: CHROME
153+
154+
:hide:`NETSCAPE`
155+
^^^^^^^^^^^^^^^^
156+
157+
.. autodata:: NETSCAPE
158+
159+
:hide:`FPNAVIGATOR`
160+
^^^^^^^^^^^^^^^^^^^
161+
162+
.. autodata:: FPNAVIGATOR
163+
139164
:hide:`APPLICATIONS`
140165
^^^^^^^^^^^^^^^^^^^^
141166

doc/source/index.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Home
66

77
.. toctree::
88
:hidden:
9-
9+
1010
basics
1111
advanced
1212
globals
@@ -21,13 +21,13 @@ General Overview
2121
================
2222
"fpclib" stands for "Flashpoint Curation Library" and is a powerful collection of functions and classes you can use and extend to hopefully curate any game/animation in existence through python3. If you're not familiar with curating for Flashpoint and would like to know how to curate, first follow the `Curation Tutorial <https://bluemaxima.org/flashpoint/datahub/Curation_Tutorial>`_ page on the Flashpoint wiki. If you're not familiar with using python or coding, you should read the `official python tutorial <https://docs.python.org/3/tutorial/index.html>`_ before using this library.
2323

24-
Although there are already several useful tools you can use for manually curating games/animations for Flashpoint and downloading assets easily, such as Flashpoint Core, cURLsDownloader, and MAD4FP, none of these tools offer the ability to curate through code or automate the process; fpclib was created to fix that. Of course, you should still always manually check any curation you make with fpclib in Flashpoint Core to make sure it works properly.
24+
Although there are already several useful tools you can use for manually curating games/animations for Flashpoint and downloading assets easily, such as Flashpoint Core, cURLsDownloader, and MAD4FP, none of these tools offer the ability to curate through code or automate the process; fpclib was created to fix that. `fpcurator <https://github.com/FlashpointProject/fpcurator>`_ uses fpclib to automatically generate curations. Of course, you should still always manually check any curation you make with fpclib in Flashpoint Core to make sure it works properly.
2525

26-
There are numerous benefits of using fpclib to help you curate:
26+
There are numerous benefits of using fpclib/fpcurator to help you curate:
2727

2828
* By default, fpclib downloads main game/animation files and puts them in the right file format based upon your launch commands.
2929
* Logos and screenshots can be automatically downloaded from online and converted to PNG files.
30-
* Curating similar games/animations from one or more websites is simple and easy thanks to the :func:`fpclib.curate()` function.
30+
* Curating similar games/animations from one or more websites is simple and easy thanks to the :code:`fpclib.curate()` function.
3131
* **Nearly every kind of Curation is possible to make with this library!** This library and documentation were created with the intent of making it easy to overwrite the Curation class to make it do different things. Anything you can do in the "Curate" tab in Flashpoint Core you can do with fpclib, except test games.
3232

3333
Here's some example code of using the library to curate "Interactive Buddy" from Newgrounds::
@@ -39,22 +39,22 @@ Here's some example code of using the library to curate "Interactive Buddy" from
3939
curation = Curation(url='https://www.newgrounds.com/portal/view/218014')
4040
# Set the logo of the curation
4141
curation.logo = 'https://picon.ngfiles.com/218000/flash_218014_medium.gif'
42-
42+
4343
# You can set metadata through the object directly or through the set_meta method
4444
curation.set_meta(title='Interactive Buddy', tags=['Simulation', 'Toy'])
4545
curation.set_meta(dev='Shock Value', pub='Wrong Publisher')
4646
curation.pub = 'Newgrounds'
4747
curation.ver = '1.01'
4848
curation.date = '2005-02-08'
49-
49+
5050
# Add an additional app
5151
curation.set_meta(cmd='http://uploads.ungrounded.net/218000/218014_DAbuddy_latest.swf')
5252
curation.add_app('Kongregate v1.02', 'http://chat.kongregate.com/gamez/0003/0303/live/ib2.swf?kongregate_game_version=1363985380')
5353

5454
# Export this curation to the current working directory
5555
curation.save()
5656

57-
You can also test the library by running the script directly or with :func:`fpclib.test()`, which will also curate "Interactive Buddy" in the current working directory, delete the curation, and check an invalid curation.
57+
You can also test the library by running the script directly or with :code:`fpclib.test()`, which will also curate "Interactive Buddy" in the current working directory, delete the curation, and check an invalid curation.
5858

5959
More Reading
6060
============
@@ -69,12 +69,11 @@ More Reading
6969
Usage
7070
=====
7171

72-
You can install the library with
73-
::
72+
You can install the library with::
7473

7574
pip install fpclib
7675

77-
or you can put the "fpclib.py" script (check the releases page on `github <https://github.com/xMGZx/fpclib>`_) in the same directory as your script.
76+
or you can put the "fpclib" script (check the releases page) in the same directory as your script.
7877

7978
If you choose the second option, you'll also need to install these libraries through pip::
8079

@@ -85,9 +84,9 @@ If you choose the second option, you'll also need to install these libraries thr
8584

8685
Once you have all of that set up, you can put :code:`import fpclib` at the top of your script to use it's methods.
8786

88-
Licence
87+
License
8988
=======
9089

9190
.. raw:: html
92-
91+
9392
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.

0 commit comments

Comments
 (0)