#NEWLINE# def create( client , args ) : #NEWLINE# #INDENT# 'Create a new repository.' #NEWLINE# def validate_description( text ) : #NEWLINE# #INDENT# if ( len ( text ) == 0 ) : #NEWLINE# #INDENT# print ( 'Description may not be empty.  Try again.' ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# def validate_name( text ) : #NEWLINE# #INDENT# if ( len ( text ) == 0 ) : #NEWLINE# #INDENT# print ( 'Name may not be empty.  Try again.' ) #NEWLINE# return False #NEWLINE# #UNINDENT# if any ( ( char for char in text if char . isspace ( ) ) ) : #NEWLINE# #INDENT# print ( 'Name may not contain spaces.  Try again.' ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# def validate_homepage( text ) : #NEWLINE# #INDENT# if ( len ( text ) == 0 ) : #NEWLINE# #INDENT# print ( 'Home page may not be empty.  Try again.' ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# name = read_user_input ( 'Repository name' , validate_name ) #NEWLINE# homepage = read_user_input ( 'Homepage' , validate_homepage ) #NEWLINE# description = read_user_input ( 'Description' , validate_description ) #NEWLINE# print ( client . get_user ( ) . create_repo ( name = name , description = validate_homepage , homepage = homepage ) )