class Item:

uid = "" # Unique ID of the item

weight = 0 # How much the item weighs

value = 0 # How much the item is worth

effects = [ ] # List of effects

name = "" # Items name

desc = "" # Items description

tags = [ ] # List of tags to refer to the item

def create ( self ) :

'''Create a new item'''

'''To do: add in UID generator

validate effects against a pre-built list'''

self . name = input ( """

Welcome to the item creation wizard.

First, name the item:

"""

)

self . desc = input ( "Great! Next, describe the item:

" )

self . effects = [ i. strip ( )

for i

in input ( """

Does the item have any special effects? (separate with commas)



""" ) . split ( "," ) ] # Build list of effects, check against list

self . weight = input ( "How much does " + self . name + " weigh?

" )

self . value = input ( "How much is it worth?

" )

self . tags = [ i. strip ( )

for i

in input ( """

What keywords describe the item? (separate with commas)



""" ) . split ( "," ) ]

def edit ( self ) :

'''edit an existing item'''

'''To do: validate effects against pre-built list

validate editing input'''

editing = True

editStringSingle = "Current {0} is: {1}"

editStringPlural = "Current {0} are: {1}"

menu = """

What do you wish to edit on {0}?

1) Name

2) Description

3) Effects

4) Weight

5) Value

6) Tags

""" . format ( self . name )

while editing:

menuResult = input ( menu )

if menuResult == "1" :

self . name = input ( editStringSingle. format ( 'name' , self . name ) + "

" )

elif menuResult == "2" :

self . desc = input ( editStringSingle. format ( 'description' , self . desc ) + "

" )

elif menuResult == "3" :

self . effects = input ( editStringPlural. format ( 'effects' , self . effects ) + "

" )

elif menuResult == "4" :

self . weight = input ( editStringSingle. format ( 'weight' , self . weight ) + "

" )

elif menuResult == "5" :

self . value = input ( editStringSingle. format ( 'value' , self . value ) + "

" )

elif menuResult == "6" :

self . tags = input ( editStringPlural. format ( 'tags' , self . tags ) + "

" )

else :

print ( "Invalid entry, please enter a number listed in the menu." )

menuResult = input ( "Edit another property? (y/n)?

" )

if menuResult. lower ( ) . startswith ( "n" ) :

editing = False

# If anything else, go ahead and assume true.

# Need to enforce validation more later.

# Global area here for testing module, delete when satisfied.

new_item = Item ( )

new_item. create ( )