Skip to content
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

#INSERT in @batchcommand not handling newlines correctly? #984

Closed
ergodicbreak opened this issue May 31, 2016 · 0 comments
Closed

#INSERT in @batchcommand not handling newlines correctly? #984

ergodicbreak opened this issue May 31, 2016 · 0 comments
Labels
bug An actual error or unwanted behavior.

Comments

@ergodicbreak
Copy link
Contributor

ergodicbreak commented May 31, 2016

Brief summary of issue

Assuming a batchcommand base path to the riverport directory, and given a batchcommand file build.ev that looks like:

#INSERT riverport.dancing_dragon_inn

And the file dancing_dragon_inn.ev

#

@dig/teleport Dancing Dragon Inn;inn#01

#

@desc
  A prosperous inn, with clear glass set in wide windows and long well-oiled
  trestle tables. Fresh herbs scattered daily on the clean rush floor mats
  give the air a wholesome flavor.

  A wide wood staircase leads to sleeping rooms upstairs.

#

@dig Dancing Dragon Inn Upstairs;inn#02

#

@open staircase;stairs;stair;upstairs;up,
  staircase;stairs;stair;downstairs;down;out;o = inn#02

Running @batchcmd riverport.build fails to properly insert dancing_dragon_inn.ev.

Error output

Taking the files above, here is a log of @batchcmd/interactive riverport.build

Batch-command processor - Interactive mode for riverport.build...
01/01: @dig/teleport Dancing Dragon Inn;inn#01\#
@desc

  A pr[...](hh for help)
01/01: @dig/teleport Dancing Dragon Inn;inn#01\#
@desc

  A pr[...](hh for help)
| @dig/teleport Dancing Dragon Inn;inn#01\#
| @desc
|   A prosperous inn, with clear glass set in wide windows and long well-oiled
|   trestle tables. Fresh herbs scattered daily on the clean rush floor mats
|   give the air a wholesome flavor.
| 
|   A wide wood staircase leads to sleeping rooms upstairs.\#
| @dig Dancing Dragon Inn Upstairs;inn#02\#
| @open staircase;stairs;stair;upstairs;up,
|   staircase;stairs;stair;downstairs;down;out;o = inn#02

The separate commands are not properly separated when inserted.

ideas for how to solve / implement:

I think this may be related to this line of code in https://github.com/evennia/evennia/blob/master/evennia/utils/batchprocessors.py#L277

        def replace_insert(match):
            "Map replace entries"
            return "\#\n".join(self.parse_file(match.group(1)))

It seems like"\#\n" should be changed to "\n#". Making this change gives this output after @batchcmd\interactive riverport.build

Batch-command processor - Interactive mode for riverport.build...
01/03: @dig/teleport Dancing Dragon Inn;inn#01        (hh for help)
01/03: @dig/teleport Dancing Dragon Inn;inn#01        (hh for help)
| @dig/teleport Dancing Dragon Inn;inn#01
02/03: A prosperous inn, with clear glass set in wide windows [...](hh for help)
02/03: A prosperous inn, with clear glass set in wide windows [...](hh for help)
| A prosperous inn, with clear glass set in wide windows and long well-oiled
|   trestle tables. Fresh herbs scattered daily on the clean rush floor mats
|   give the air a wholesome flavor.
| 
|   A wide wood staircase leads to sleeping rooms upstairs.
03/03: staircase;stairs;stair;downstairs;down;out;o = inn#02(hh for help)
03/03: staircase;stairs;stair;downstairs;down;out;o = inn#02(hh for help)
| staircase;stairs;stair;downstairs;down;out;o = inn#02
End of batch file.

This is related to #939.

@Griatch Griatch added the bug An actual error or unwanted behavior. label May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An actual error or unwanted behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants