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

Ability to be able to create a shortcut for a python "entry_point" #14

Open
martinohanlon opened this issue Jun 4, 2018 · 7 comments
Open

Comments

@martinohanlon
Copy link
Owner

When creating python packages entry_point's are added into the Python\Scripts directory for python applications.

shortcut should be able to create a shortcut for these entry_point's

Based on requests in #7 from @kiwi0fruit

@kiwi0fruit
Copy link

kiwi0fruit commented Jun 4, 2018

I suggest adding kwarg entry_point=True/False to desktop and menu shortcut creation methods. They internally may call self.create_entry_point_shortcut.

@martinohanlon
Copy link
Owner Author

martinohanlon commented Jun 4, 2018

This is dependent on #10 as the entry_point may not have been created by the time the shortcut is needed to be created.

shortcut could provide functions to return the 'entry' point directory which can be used to provide a full target path

e.g.

from shortcut import ShortCutter, entry_point_dir
sc = ShortCutter()
sc.create_menu_shortcut(entry_point_dir + "my_app", target_exists=False)

@martinohanlon
Copy link
Owner Author

I suggest adding kwarg entry_point=True/False to desktop and menu shortcut creation methods.

What if the target is already is a complete path? Would entry_point be ignored? Error raised?

@kiwi0fruit
Copy link

kiwi0fruit commented Jun 4, 2018

sc.create_desktop_shortcut(
    os.path.join(sc.bin_folder,
                 'myapp' + ('.exe' if (if os.name == 'nt') else '')
))

There is also an extension .exe thing... A wrapper would look nicer:

sc.create_desktop_shortcut('myapp', entry_point=True)

In this case entry_point=True kwarg means that we do not care if the file exist in <...>/bin or <...>\Scripts.

@kiwi0fruit
Copy link

kiwi0fruit commented Jun 4, 2018

What if the target is already is a complete path? Would entry_point be ignored? Error raised?

I guess error is better. (ValueError())

@martinohanlon
Copy link
Owner Author

So, if it was an entry_point shortcut would need to attached the appropriate extension for the OS?

I think its just windows which would need .exe attached.

@kiwi0fruit
Copy link

I guess here should be a check if a target doesn't contain path separators and a valid filename.

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

No branches or pull requests

2 participants