Пример #1
0
def createworkingenviornment():
	"""
	This function will create workig enviornment for
	other functions to work mainly
	"""
	if len(argv) > 1:
		option = argv[-1]
		customizations = argv[1: -1]

		if option not in standard_main_options:
			printusage()
			return

		for customization in customizations:
			if customization not in standard_sub_options:
				print(customization + " option does not exist")
				printusage()
				return

		project_name = _input('Enter Project Name', allow_none = False)
		readme = _input('Enter Readme Text Please', allow_none = False)

		enviornment = dict(option = option,
						   customizations = customizations,
						   project_name = project_name,
						   readme_text = readme)
		HeadshorTriggers[enviornment['option']].clis(enviornment)
		main(enviornment)

	else:
		printusage()
		return
Пример #2
0
    def clis(enviornment):
        """
		Ads Enviornment Variables
		"""
        for idx, lic in enumerate(license_arr):
            print(idx, lic)
        license = _input("Select License Templates", default=0)
        year = _input("Enter Year", default=datetime.now().year)
        author = _input("Enter Author Of Repo", allow_none=False)
        quick_description = _input("Small Description")
        version = _input("Enter Version", default='0.1.0')
        github_repo = _input("Enter Github Repository Name",
                             default=enviornment['project_name'])
        github_profile_name = _input("Enter Profile Name", default=author)
        author_url = _input("Author Url",
                            default=get_github_link(github_profile_name,
                                                    github_repo))

        if enviornment['option'] == 'wp_theme':
            # enviornment related to ws_theme
            pass

        # Adding Enviornment
        enviornment['license'] = license
        enviornment['year'] = year
        enviornment['author'] = author
        enviornment['desc'] = quick_description
        enviornment['version'] = version
        enviornment['author_url'] = author_url
        enviornment['github_repo'] = github_repo
        enviornment['github_link'] = get_github_link(github_profile_name,
                                                     github_repo)
Пример #3
0
    def clis(enviornment):
        Trigger.clis(enviornment)
        plugin_name = _input("Enter Plugin Name", allow_none=False)
        plugin_uri = _input("Enter Plugin Url",
                            default=enviornment['github_link'])
        author_url = _input("Enter Author Url",
                            default=enviornment['github_link'])
        text_domain = _input("Enter Text Domain", allow_none=False)

        # Registering Enviornment
        enviornment['plugin_name'] = plugin_name
        enviornment['plugin_uri'] = plugin_uri
        enviornment['author_url'] = author_url
        enviornment['text_domain'] = text_domain
Пример #4
0
    def clis(enviornment):
        """ A cli enviornment Attachment"""
        Trigger.clis(enviornment)
        theme_name = _input("Enter Theme Name", allow_none=False)
        theme_uri = _input("Enter Theme Url",
                           default=enviornment['github_link'])
        author_url = _input("Enter Author Url",
                            default=enviornment['github_link'])
        tags = _input("Enter Tags Comma Seperated")
        text_domain = _input("Enter Text Domain", allow_none=False)

        # Registering Enviornment
        enviornment['theme_name'] = theme_name
        enviornment['theme_uri'] = theme_uri
        enviornment['author_url'] = author_url
        enviornment['tags'] = tags
        enviornment['text_domain'] = text_domain
Пример #5
0
 def clis(enviornment):
     """ A cli enviornment Attachment"""
     Trigger.clis(enviornment)
     packages = _input("Enter Packages",
                       default=enviornment['project_name'])
     enviornment['packages'] = [
         package.strip() for package in packages.split(',')
     ]