-
-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1526 from bruno-rino/api_consistency_switch
API consistency: switch widget
- Loading branch information
Showing
19 changed files
with
459 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import importlib | ||
import sys | ||
# If the user provided a --app:<name> argument, | ||
# import that module as the app. | ||
app = [ | ||
arg.split(":")[1] | ||
for arg in sys.argv | ||
if arg.startswith("--app:") | ||
] | ||
main = importlib.import_module(f"{app[0]}.app").main | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from subclassed.app import main | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import importlib | ||
import sys | ||
|
||
import toga | ||
|
||
# If the user provided a --backend:<name> argument, | ||
# use that backend as the factory. | ||
backend = [ | ||
arg.split(":")[1] | ||
for arg in sys.argv | ||
if arg.startswith("--backend:") | ||
] | ||
try: | ||
factory = importlib.import_module(f"toga_{backend[0]}").factory | ||
except IndexError: | ||
factory = None | ||
|
||
|
||
class SubclassedApp(toga.App): | ||
pass | ||
|
||
|
||
def main(): | ||
app = SubclassedApp('Subclassed App', 'org.testbed.subclassed-app', factory=factory) | ||
|
||
print(f"app.paths.app={app.paths.app.resolve()}") | ||
print(f"app.paths.data={app.paths.data.resolve()}") | ||
print(f"app.paths.cache={app.paths.cache.resolve()}") | ||
print(f"app.paths.logs={app.paths.logs.resolve()}") | ||
print(f"app.paths.toga={app.paths.toga.resolve()}") | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.