GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ColdWaters-DotModCampaignChecker/vessel_inventory.py at main · DotModGroup/ColdWaters-DotModCampaignChecker

Expand file tree

/

vessel_inventory.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
48 lines (42 loc) · 1.8 KB
/

vessel_inventory.py

Copy path

File metadata and controls

48 lines (42 loc) · 1.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""This module contains the class for storing the parsed vessel inventory
Classes:
VesselInventory
"""
class VesselInventory:
"""This class stores a vessel inventory and the selectors for a campaign
Attributes:
vessel_inventory: dict[str, int] = {} | Stores a list of vessels and their counts
vesselname: count | The number of vessels of class vessel_name
selectors: dict[str, list[str]] = {} | Stores all selectors and all vessels in each selector
selectorname: listofvessels | Store vessels associated with a selector
Methods:
None
"""
def __init__(self, campaign_directory: str):
self.vessel_inventory: dict[str, int] = {}
self.selectors: dict[str, list[str]] = {}
try:
with open(
f"{campaign_directory}\\vessel_selector.txt", mode="r", encoding="utf-8"
) as vessel_inventory:
reading_selectors = False
for line in vessel_inventory:
if line.startswith("[Selectors]"):
reading_selectors = True
continue
if not reading_selectors:
try:
self.vessel_inventory[line[:-1].split("=")[0]] = int(
line[:-1].split("=")[1]
)
except IndexError:
continue
if reading_selectors:
try:
self.selectors[line[:-1].split("=")[0]] = (
line[:-1].split("=")[1].split(",")
)
except IndexError:
continue
except FileNotFoundError:
pass
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.