Skip to content

Conversation

@byronz
Copy link
Contributor

@byronz byronz commented Oct 29, 2019

this PR solves the problem when dashR app is defined in a string chunk, and the app needs to work with assets or clientside js file.


self.started = True

return app
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rpkyle in case you need to get the tmp path, start() returns it

)
self._tmp_app_path = os.path.join(
"/tmp" if not self.is_windows else os.getenv("TEMP"),
uuid.uuid4().hex,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as @rpkyle mentioned, the hot reloading on R side will actively monitor all the folder under the main app file, in this case, the old approach using /tmp/app_{}.R is not safe

@byronz byronz marked this pull request as ready for review October 29, 2019 23:15
os.path.join(cwd, _)
for _ in os.listdir(cwd)
if not _.startswith("__")
and os.path.isdir(os.path.join(cwd, _))
Copy link
Collaborator

Choose a reason for hiding this comment

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

🐄 why _? I prefer to use that only when the var isn't going to be used at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also like to use that in list comprehension especially when it gets more complicated.

  • shorter
  • I think it's easier to read once you used to the convention, and can be more focus on the operation and logic side.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair enough. I'd tend to use a 1-character name for that but I see your point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. I'd tend to use a 1-character name for that but I see your point.

1-char name is anti-pylint

Copy link
Collaborator

Choose a reason for hiding this comment

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

_ isn't a 1-char name? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw, it's a valid 1-char name, certified.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Just one style comment - aside from that, if @rpkyle can confirm this works as desired, I'm happy! 💃

@byronz
Copy link
Contributor Author

byronz commented Oct 30, 2019

Just one style comment - aside from that, if @rpkyle can confirm this works as desired, I'm happy! 💃

not only confirmed by Ryan. he also promises a nice shot of espresso tomorrow.

@byronz byronz merged commit b3b9de9 into dev Oct 30, 2019
@byronz byronz deleted the dbg-r-reload branch October 30, 2019 02:53
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