Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Euxcbsks/MyColonyFileParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcfp - My Colony File Parser

Just keep this repo as a souvenir, there's a lot of legacy code here, not worth using as a reference

DeepSource

中文版readme

current not suppot My Colony 2

Index of content

Config

  • Description: this module use configparser that in stdlib to provide config function
  • Path: mcfp.config.config
  • Sections
    • network
      • Options
        • timeout(int, default=3): timeout of all the network related function

Classes

Base

CommonBase

  • Description: provide generic method
  • Path: mcfp.base.CommonBase
  • Method
    • __delattr__: disable del object.attr
    • __str__: return self.name

DictBase

  • Description: provide method of dict object
  • Path: mcfp.base.DictBase
  • Inherit: CommonBase

ListBase

  • Description: provide method of list object
  • Path: mcfp.base.ListBase
  • Inherit: CommonBase

FileBase

  • Description: basically same as dict object
  • Path: mcfp.filebase.FileBase
  • Inherit: DictBase
  • Attributes
    • name: file name
    • dict: file data
  • Method
    • categories: alias of file.keys()

Game

  • Description: represents files like game.js
  • Path: mcfp.file.Game
  • Inherit: FileBase

Strings

CategoryBase

  • Path: mcfp.categorybase.CategoryBase
  • Common attributes
    • file: instance of subclass of FileBase which this category belong
    • name: category name
    • data: category data
  • Common method
    • units: Implemented by subclass

DictCategory

  • Description: basically same as dict object
  • Path: mcfp.category.DictCategory
  • Inherit: DictBase, CategoryBase
  • Attributes
    • dict: alias of self.data
  • Method
    • units: alias of self.keys

ListCategory

  • Description: basically same as list object
  • Path: mcfp.category.ListCategory
  • Inherit: ListBase, CategoryBase
  • Attributes
    • list: alias of self.data
  • Method
    • units: similar with self.__iter__ but return str object

UnitBase

  • Path: mcfp.unitbase.UnitBase
  • Common attributes
    • file: instance of subclass of FileBase which this unit belong, same as category.file
    • category: instance of subclass of CategoryBase which this unit belong
    • data: unit data

DictUnit

  • Description: basically same as dict object
  • Path: mcfp.unit.DictUnit
  • Inherit: DictBase, UnitBase

ListUnit

  • Description: basically same as list object
  • Path: mcfp.unit.ListUnit
  • Inherit: ListBase, UnitBase

Excpetions

MCFPError

Base exception of MCFP

FileError

File related error

InvalidFileChannel

Invalid file channel

InvalidFileVersion

Invalid file version

InvalidFileName

Invalid file name

CategoryError

Category related error

InvalidCategoryName

Invalid category name

UnitError

Unit related error

InvalidUnitName

Invalid unit name

About

Parser for My colony's data("game.json" and "string.json")

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages