Skip to content

Fix bug with "TypeError: fore|back|style() takes no arguments#13

Open
Arinffy wants to merge 1 commit intopetercorke:masterfrom
Arinffy:master
Open

Fix bug with "TypeError: fore|back|style() takes no arguments#13
Arinffy wants to merge 1 commit intopetercorke:masterfrom
Arinffy:master

Conversation

@Arinffy
Copy link

@Arinffy Arinffy commented Dec 7, 2024

Dear Mr. Corke,

I hope this letter finds you well.

I wanted to inform you that I am currently using a system with Docker-ubuntu20.04 and Python 3.8.5. I am incredibly grateful for your open-source project, roboticstoolbox-python, which I have been diligently studying.

Furthermore, I recently encountered an issue and debugged the fore|back|style errors. I discovered that for known and definite rendering effects, such as text, one can set the color in the form of fore.GREEN. However, for unknown and dynamic content, it is necessary to use fg(set). If this modification is not made, an error occurs when printing (robot). So far, I have not encountered any other anomalies.

If you have any questions or concerns regarding this matter, please do not hesitate to reach out to me via email at Arinffy@outlook.com.

Thank you once again for your valuable contributions to the open-source community.

Yours sincerely,

Arinffy

…rguments"

I debugged the fore|back|style errors: If it's for known and definite rendering effects like text, you can set it in the form of fore.GREEN. However, for unknown and dynamic content, it needs to be set as fg(set). If this is not modified, there will be an error when printing (robot). No other anomalies have been observed.
@petercorke
Copy link
Owner

thanks for your comments. I am really confused about fg vs fore for the colored package. From its CHANGELOG:

[2.0.0] - 2023-06-19

  • Renamed functions:
    • fg() to fore()
    • bg() to back()
    • attr() to style()

then later

[2.1.1] - 2023-06-20

Changed
Restored legacy support for version 1.x.x:
Reintroduced fg(), bg(), and attr() functions (to be deprecated in future releases).

Can you give me a small runnable example that shows the problem you are experiencing.

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.

2 participants