-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add ServerContext #606
Add ServerContext #606
Conversation
xml_path : str, optional | ||
Path to the xml to load. | ||
""" | ||
def __init__(self, context_type=EContextType.user_defined, xml_path=""): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbellot000 Why is the user_defined context the default one? I think this makes the xml_path non-optional in a way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PProfizi it's the default of this constructor (because you would only need to use the constructor directly when you want to speicify an xml), it doesn't make user defined the default context (which is SERVER_CONTEXT = AvailableServerContexts.entry)
self._base_service.apply_context(server_context.SERVER_CONTEXT) | ||
except errors.DpfVersionNotSupported: | ||
self._base_service.initialize_with_context( | ||
server_context.AvailableServerContexts.premium |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbellot000 Why premium in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PProfizi premium was the old default (equivalent to standalone)
@@ -198,6 +201,10 @@ def cyclic_multistage(): | |||
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_3_0 = meets_version( | |||
get_server_version(core._global_server()), "3.0" | |||
) | |||
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_2_0 = meets_version( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cbellot000 Is the minimum server version required 2.0 or 2.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's how it was used before
Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>
Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>
Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>
Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## master #606 +/- ##
==========================================
+ Coverage 87.90% 87.98% +0.07%
==========================================
Files 68 69 +1
Lines 7566 7630 +64
==========================================
+ Hits 6651 6713 +62
- Misses 915 917 +2 |
Gives the ability to choose the context with which the server should be started.
The context allows to choose which capabilities are available.