Skip to content

Substitute words loaded from separate file, new additions#9

Open
belliriccardo wants to merge 8 commits into
ntoll:masterfrom
belliriccardo:master
Open

Substitute words loaded from separate file, new additions#9
belliriccardo wants to merge 8 commits into
ntoll:masterfrom
belliriccardo:master

Conversation

@belliriccardo

Copy link
Copy Markdown

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

ntoll commented May 15, 2022

Copy link
Copy Markdown
Owner

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
Copy Markdown
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

ntoll commented May 15, 2022

Copy link
Copy Markdown
Owner

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

@belliriccardo

Copy link
Copy Markdown
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

ntoll commented May 16, 2022

Copy link
Copy Markdown
Owner

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

Comment thread arrr.py Outdated
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
Copy Markdown

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.

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

_VERSION = (1, 1, 0)

Copy link
Copy Markdown

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?

Comment thread arrr.py Outdated
}

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

Copy link
Copy Markdown

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!

Comment thread setup.py Outdated
"Topic :: Communications",
"Topic :: Software Development :: Internationalization",
],
include_package_data=True,

@merwok merwok Dec 17, 2022

Copy link
Copy Markdown

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
Copy Markdown
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

merwok commented Dec 19, 2022

Copy link
Copy Markdown

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

ntoll commented Dec 21, 2022

Copy link
Copy Markdown
Owner

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

merwok commented Dec 21, 2022

Copy link
Copy Markdown

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

@ntoll

ntoll commented Dec 23, 2022

Copy link
Copy Markdown
Owner

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
Copy Markdown
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!

@merwok merwok left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

yo ho ho

Comment thread arrr/__init__.py
"""


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

Copy link
Copy Markdown

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

Comment thread arrr/__init__.py
#: MAJOR, MINOR, RELEASE, STATUS [alpha, beta, final], VERSION
_VERSION = (1, 0, 3)

_VERSION = (1, 1, 0)

Copy link
Copy Markdown

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)

Comment thread arrr/__init__.py

del nonsense, gibberish

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

Copy link
Copy Markdown

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 thread arrr/__init__.py
Comment on lines 128 to 129
"Summat went awry, me lovely! Arrr..."
)

Copy link
Copy Markdown

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
Copy Markdown

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 thread arrr/__init__.py
Comment on lines +133 to +134
"Ye filthy bilge rat, don't try to fool me! I will gut yer insides!"
)

Copy link
Copy Markdown

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)

Comment thread arrr/blabber.csv
you're,ye be
you,ye
your,yer
yourself,yerself No newline at end of file

Copy link
Copy Markdown

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

Comment thread arrr/__init__.py
"meeting": "parley with rum and cap'n",
}
_PIRATE_WORDS = dict()
with open('BLABBER.csv') as nonsense:

Copy link
Copy Markdown

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