Skip to content

Substitute words loaded from separate file, new additions #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

belliriccardo
Copy link

Made it such that new additions can just be appended at the end of the .csv file to keep the main file more clean. Also, there are plenty more substitutions. Arrr.

@ntoll
Copy link
Owner

ntoll commented May 15, 2022

Ahoy there @belliriccardo,

Welcome to the crew. ☠️

Ye have landed plenty'o shiny phrases in that there CSV.

But surely it should be a CSR file..? Ye say it, "Sea, yes! Arrr..!" (but I jest).

This'll need fixing up before we sail it to the PyPI lagoons. Anyone doing pip install arrr will need a treasure map to find the missing CSV file. Savvy..?

Summat for ye to patch up before we hoist this sail..? But happy to accept your contribution to the crew when patched.

Arrrrrr!

🏴‍☠️

@belliriccardo
Copy link
Author

Ye're right matey, but I be missin' th' skill to package this altogether. If ye need me, I'll be in th' quarters below deck, cap'n...

@ntoll
Copy link
Owner

ntoll commented May 15, 2022

Aye. I'll keel haul this out in the coming week or so. 👍

@belliriccardo
Copy link
Author

Disregard me last pigeon message, I 'ave figured it out! Should be jolly an' ready to go.

…ectly. Example:

Before: "How are you?" -> "How be you?"
Now: "How are you?" -> "How be ye?"
Also don't de-capitalize words in the main dict so that names don't get lowercase'd (Ex. "Jack" -> "jack" inside a string of text no longer happens)
@ntoll
Copy link
Owner

ntoll commented May 16, 2022

Hmm... I've just tested it and it doesn't work. I think I know why, and will fix/check/merge when done. 👍

arrr.py Outdated
@@ -24,66 +24,25 @@
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
import argparse as arrrgparse # Geddit..? ;-)
from csv import reader as HELMSMAN # He be the only lad aboard who can read!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are ye screaming lads? helmsman be the good and usual way.

#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION
_VERSION = (1, 0, 3)

_VERSION = (1, 1, 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your editor be removing all them nice blank lines. Mates need restin betwen workin, ya know?

arrr.py Outdated
}

_PIRATE_WORDS = dict()
with open('BLABBER.csv') as NONSENSE:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This here data file needs to be in yon package there mate, and ye be better usin pkgutil or importlib.resources to access it in a portable way!

setup.py Outdated
@@ -31,5 +31,6 @@
"Topic :: Communications",
"Topic :: Software Development :: Internationalization",
],
include_package_data=True,
Copy link

@merwok merwok Dec 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This here line is good but does nothin’ for now: yon CSV trove must be inside yon package to be included as package booty!

@belliriccardo
Copy link
Author

Ahoy @merwok ! Me've forgotten a-boot(harharhar) this 'ere galley. Me've been' havin' a not so jolly time doin' me last pirate exams. About that there CSV file, I 'ave added it to th' MANIFEST.in file, I was thinkin' that was what was needed. If ye have any more comments or if I'm missin' somethin', feel free to tell! I'll go walk the plank now

@merwok
Copy link

merwok commented Dec 19, 2022

Nah laddie, yon manifest is for loading extra cargo say readme and such into yon sdist barrel, but that’s not gonna install them there files! Trust me old head and move yon file into yon package, that’s what ye need to get it packaged and installed and accessed, yarr!

@ntoll
Copy link
Owner

ntoll commented Dec 21, 2022

Ahoy there mateys..!

@merwok you be an old sea dog full of packaging tales and lore for getting the booty in th'right place? Perchance you'd scrawl a treasure map for crew mate @belliriccardo to bury his CSV treasure in the right place? Yarrrrr...

Rum and a rebase may be needed too, before this plan can happen (but it sounds like a profitable piratical enterprise).

@merwok
Copy link

merwok commented Dec 21, 2022

This here chart shows the way to get what I be sayin: belliriccardo#1

@ntoll
Copy link
Owner

ntoll commented Dec 23, 2022

Ahoy there me maties..! Merry Christmas and wishing you good plunderin' in the new year. Yarrrr.

If @belliriccardo lets @merwok's on board, I'll make it walk the plank into the shark infested waters o'this project.

turn module into package, fix packaging
@belliriccardo
Copy link
Author

Allright! Sorry for me absence, ya know me've been plunderin' all these holidays! I 'ave merged @merwok pull request, sould be jolly now!

Copy link

@merwok merwok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yo ho ho

@@ -35,55 +33,16 @@
Documentation here: https://arrr.readthedocs.io/en/latest/
"""


#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION
#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION

#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION
_VERSION = (1, 0, 3)

_VERSION = (1, 1, 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_VERSION = (1, 1, 0)
_VERSION = (1, 1, 0)


del nonsense, gibberish

#: A list of Pirate phrases to randomly insert before or after sentences.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#: A list of Pirate phrases to randomly insert before or after sentences.
#: A list of Pirate phrases to randomly insert before or after sentences.

Comment on lines 128 to 129
"Summat went awry, me lovely! Arrr..."
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Summat went awry, me lovely! Arrr..."
)
"Summat went awry, me lovely! Arrr...",
file=sys.stderr,
)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ye should complain on tha stderr room laddie!

Comment on lines +133 to +134
"Ye filthy bilge rat, don't try to fool me! I will gut yer insides!"
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Ye filthy bilge rat, don't try to fool me! I will gut yer insides!"
)
"Ye filthy bilge rat, don't try to fool me! I will gut yer insides!",
file=sys.stderr,
)
sys.exit(1)

you're,ye be
you,ye
your,yer
yourself,yerself
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yourself,yerself
yourself,yerself

"meeting": "parley with rum and cap'n",
}
_PIRATE_WORDS = dict()
with open('BLABBER.csv') as nonsense:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python landlubbers think it good practiss to eschew side effects at importin’ time, like openin’ and readin’ file.
That’s fine thinkin’ but it requires ye to go roundabout and add some init function like this here: https://github.com/python/cpython/blob/main/Lib/mimetypes.py#L336-L337

So me wonder what cap’n be thinkin’. Be fine to keep this simple if arrr be mainly a command-line program, not a module for other landlubbers to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants