diff --git a/dotdrop/config.py b/dotdrop/config.py index ea22c10..c2cb09b 100644 --- a/dotdrop/config.py +++ b/dotdrop/config.py @@ -504,37 +504,6 @@ class Cfg: cnt += 1 return key - def short_to_long(self): - """transform all short keys to long keys""" - if not self.content[self.key_dotfiles]: - return - match = {} - new = {} - # handle the entries in dotfiles - for oldkey, v in self.content[self.key_dotfiles].items(): - path = v[self.key_dotfiles_dst] - path = os.path.expanduser(path) - newkey = self._get_long_key(path) - new[newkey] = v - match[oldkey] = newkey - # replace with new keys - self.content[self.key_dotfiles] = new - - # handle the entries in profiles - for k, v in self.lnk_profiles.items(): - if self.key_profiles_dots not in v: - continue - if not v[self.key_profiles_dots]: - continue - new = [] - for oldkey in v[self.key_profiles_dots]: - if oldkey == self.key_all: - continue - newkey = match[oldkey] - new.append(newkey) - # replace with new keys - v[self.key_profiles_dots] = new - def _dotfile_exists(self, dotfile): """return True and the existing dotfile key if it already exists, False and a new unique key otherwise""" diff --git a/scripts/short-to-long-key.py b/scripts/short-to-long-key.py deleted file mode 100755 index 45dbde0..0000000 --- a/scripts/short-to-long-key.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python3 -""" -author: deadc0de6 (https://github.com/deadc0de6) -Copyright (c) 2017, deadc0de6 - -transform all short dotfile keys -from the short format to the long -format - -For example ~/.config/awesome/rc.lua - short format: f_rc.lua - long format: f_config_awesome_rc.lua - -You need to have dotdrop installed for this script -to work (either with setup.py or pypi). -""" - -from docopt import docopt -import sys -import os -from dotdrop.config import Cfg - - -USAGE = """ -short-to-long-key.py - -Usage: - short-to-long-key.py - short-to-long-key.py --help - -Options: - -h --help Show this screen. - -""" - - -def main(): - args = docopt(USAGE) - path = os.path.expanduser(args['']) - - try: - - conf = Cfg(path) - except ValueError as e: - print('error: {}'.format(str(e))) - return False - - conf.short_to_long() - print(conf.dump()) - - -if __name__ == '__main__': - if main(): - sys.exit(0) - sys.exit(1)