Skip to content

Commit

Permalink
prepare 0.1.3; minor fixes; add command to check for latest available…
Browse files Browse the repository at this point in the history
… version
  • Loading branch information
barseghyanartur committed Oct 9, 2015
1 parent c12378a commit 847ee29
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .hgignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax: regexp
\.pyc$
\.hgignore~
\.git
\.git/
\.gitignore~
\.tox/
^var/
Expand Down
14 changes: 10 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Changelog
=========
0.1.3
-----
2015-10-10

0.1
---
yyyy-mm-dd
- Added extra command to check the latest version available.
- Minor fixes.

- Initial release.
0.1.2
-----
2015-10-09

- Initial PyPI release.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include README.rst
include LICENSE_GPL2.0.txt
include LICENSE_LGPL_2.1.txt
include src/charmy/bin/charmy-install
include src/charmy/bin/charmy
include src/charmy/var/.keep
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ Note, that `charmy` remembers your last destination, so once you have
specified a destination, you don't have to specify it again (unless you
want to change installation directory).

Check for the latest available version (without installing it)::

charmy check-latest-available

Ubuntu
------
When installing on Ubuntu, `charmy` creates a `.desktop` file for to be drag
Expand Down
23 changes: 20 additions & 3 deletions TODOS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,36 @@ TODOS/Roadmap

TODOS
=====
Base on MoSCoW principle. Must haves and should haves are planned to be worked on.
Base on MoSCoW principle. Must haves and should haves are planned to be worked
on.

* Features/issues marked with plus (+) are implemented/solved.
* Features/issues marked with minus (-) are yet to be implemented.

Must haves
----------
- Add icon creation and shortcut for Ubuntu installer.
+ When installing from PyPI and then charmy install, gives the following
error message:
"""
/home/foreverchild/.virtualenvs/charmy2/bin/python: bad interpreter:
No such file or directory
"""
+ When having installed with default settings (no --destination provided),
the following message is shown:
"Successfully installed to None"
+ When having installed with default settings (no --destination provided)
and then activate another, the following message is shown:
"Successfully activated in None"
+ Make a command to fetch the latest version available: charmy latest
- Make a syncdb command to sync locally installed PyCharm versions to the
database.
- In the versions command output, make clear which version is currently active.

Should haves
------------
- Add icon creation and shortcut for Ubuntu installer.
- Fedora installer.
- Redhat installer.
- RedHat installer.

Could haves
-----------
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Sphinx==1.3.1
Werkzeug==0.10.4
alabaster==0.7.6
argparse==1.2.1
charmy==0.1
decorator==4.0.4
docutils==0.12
ipdb==0.8.1
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal = 1
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
except:
readme = ''

version = '0.1'
version = '0.1.3'

exec_dirs = [
'src/charmy/bin/',
Expand All @@ -27,7 +27,7 @@
setup(
name = 'charmy',
version = version,
description = ("PyCharm installer."),
description = ("Automated PyCharm installer for Linux."),
long_description=readme,
classifiers = [
"Programming Language :: Python",
Expand Down
4 changes: 2 additions & 2 deletions src/charmy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'charmy'
__version__ = '0.1'
__build__ = 0x000001
__version__ = '0.1.3'
__build__ = 0x000004
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2015 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
6 changes: 4 additions & 2 deletions src/charmy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,13 @@ def install(self, version, edition, use_cache=True, destination=None):
downloaded_file = self.download(version, edition, use_cache=use_cache)
installed = self.setup(downloaded_file, destination)

installation_dir = destination or self.installation_dir

if installed:
self._write_distribution_info_to_db(version, edition)
return (True, destination, '')
return (True, installation_dir, '')
else:
return (False, destination, '')
return (False, installation_dir, '')

def _write_destination_info_to_config_ini(self, destination):
"""
Expand Down
11 changes: 10 additions & 1 deletion src/charmy/commands/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from ..constants import (
DEFAULT_EDITION, ACTIONS, ACTION_INSTALL, ACTION_ACTIVATE, ACTION_VERSIONS,
ACTION_UNINSTALL
ACTION_UNINSTALL, ACTION_CHECK_LATEST_AVAILABLE
)
from ..utils import get_installer
from ..helpers import detect_latest_version
Expand Down Expand Up @@ -41,6 +41,7 @@ def main():
kwargs_versions = {}
kwargs_uninstall = {}

latest_version = None
if args.version:
kwargs_install.update({'version': args.version})
kwargs_activate.update({'version': args.version})
Expand Down Expand Up @@ -109,6 +110,14 @@ def main():
res = installer.uninstall(**kwargs_uninstall)
#print(res)

elif args.action == ACTION_CHECK_LATEST_AVAILABLE:
res = latest_version or detect_latest_version()
if res:
print(" {0}".format(res))
else:
print(" Could not fetch information on latest version "
"available ")


if __name__ == "__main__":
main()
16 changes: 12 additions & 4 deletions src/charmy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
'EDITION_PROFESSIONAL', 'EDITION_COMMUNITY', 'EDITIONS', 'DEFAULT_EDITION',
'DOWNLOAD_LINK_PATTERN', 'DOWNLOAD_PAGE_LINK', 'VERSION_JS_URL',
'ACTION_INSTALL', 'ACTION_UNINSTALL', 'ACTION_ACTIVATE', 'ACTION_VERSIONS',
'ACTIONS', 'DOWNLOAD_CACHE_DIR', 'LATEST_INSTALLATION_DIR', 'DB_NAME',
'CONFIG_INI_FILE_NAME', 'LINUX_LATEST_INSTALLATION_EXEC', 'LINUX_TEMP_DIR',
'LINUX_CONFIG_DIR', 'LINUX_INSTALLATION_EXEC', 'LINUX_INSTALLATION_ICON',
'ACTION_CHECK_LATEST_AVAILABLE', 'ACTIONS', 'DOWNLOAD_CACHE_DIR',
'LATEST_INSTALLATION_DIR', 'DB_NAME', 'CONFIG_INI_FILE_NAME',
'LINUX_LATEST_INSTALLATION_EXEC', 'LINUX_TEMP_DIR', 'LINUX_CONFIG_DIR',
'LINUX_INSTALLATION_EXEC', 'LINUX_INSTALLATION_ICON',
'CONFIG_SECTION_PATHS', 'CONFIG_OPTION_DESTINATION',
)

Expand Down Expand Up @@ -72,7 +73,14 @@ def not_implemented():
ACTION_UNINSTALL = 'unistall'
ACTION_ACTIVATE = 'activate'
ACTION_VERSIONS = 'versions'
ACTIONS = (ACTION_INSTALL, ACTION_ACTIVATE, ACTION_UNINSTALL, ACTION_VERSIONS,)
ACTION_CHECK_LATEST_AVAILABLE = 'check-latest-available'
ACTIONS = (
ACTION_INSTALL,
ACTION_ACTIVATE,
ACTION_UNINSTALL,
ACTION_VERSIONS,
ACTION_CHECK_LATEST_AVAILABLE
)

# ***************************************************************************
# *************************** Config options ********************************
Expand Down
2 changes: 1 addition & 1 deletion src/charmy/installers/linux/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ def activate(self, version, edition):
# Symlink executable.
os.symlink(exec_file, latest_installation_exec)

return (True, destination, '')
return (True, installation_dir, '')

0 comments on commit 847ee29

Please sign in to comment.