aawadall / PyProjMan

Command-line Based Project Management Application written in Python
https://aawadall.github.io/PyProjMan/
MIT License
3 stars 1 forks source link

User Friendly Task ID #6

Closed aawadall closed 6 years ago

aawadall commented 6 years ago

Define user friendly Task IDs, such that users can identify tasks while manipulating them using the text UI

aawadall commented 6 years ago

This will require some sort of mapping function

aawadall commented 6 years ago

required fix: to map the existing UUID to an ID that is 4 digits max

burhania2 commented 6 years ago

Would an increment work? i.e. each instance of a task object has an id of one higher then the previous task. Or would this be unviable for for later tasks?

burhania2 commented 6 years ago
import itertools

class task():
    newid = itertools.count()
    def __init__(self):
        self.id = next(self.newid)
aawadall commented 6 years ago

Why not. Try to put it in the init and test it please

burhania2 commented 6 years ago

Do I test using UnitTesting?

aawadall commented 6 years ago

If you can. If not we can have a second round of unit tests

burhania2 commented 6 years ago

I could not test from the parser as we don't have a way (or I don't fully know how) to track id yet through it. but I added a bunch o instances of tasks at the end of file and printed the task id to screen which worked in giving me a task id for each instance starting with zero.

burhania2 commented 6 years ago

++++++ ` import itertools

class Task: """Building block of a project plan""" type = "Task Element" taskid = itertools.count()

def __init__(self, name=None):
    # Basic Information
    self._id = next(self.taskid)
    self._name = name

a= Task() print(a._id) b= Task() v = Task() ssd=Task() print(ssd._id) ter= Task() qwe = Task() re = Task() print(re.id)

print(a._id) ` +++++ Results: 0 3 6 0

aawadall commented 6 years ago

nice, can you commit this change?

burhania2 commented 6 years ago

I ended up with a fork

aawadall commented 6 years ago

@burhania2 can you create a pull request?